efi: Add tracking for dynamically allocated memmaps
authorDan Williams <dan.j.williams@intel.com>
Mon, 13 Jan 2020 17:22:43 +0000 (18:22 +0100)
committerIngo Molnar <mingo@kernel.org>
Mon, 20 Jan 2020 07:14:29 +0000 (08:14 +0100)
commit1db91035d01aa8bfa2350c00ccb63d629b4041ad
tree8e71bbf16648063805b4a959510cd45852733bf2
parent26c0e44a213b272abec0e8fba4a5a2801f95208e
efi: Add tracking for dynamically allocated memmaps

In preparation for fixing efi_memmap_alloc() leaks, add support for
recording whether the memmap was dynamically allocated from slab,
memblock, or is the original physical memmap provided by the platform.

Given this tracking is established in efi_memmap_alloc() and needs to be
carried to efi_memmap_install(), use 'struct efi_memory_map_data' to
convey the flags.

Some small cleanups result from this reorganization, specifically the
removal of local variables for 'phys' and 'size' that are already
tracked in @data.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200113172245.27925-12-ardb@kernel.org
arch/x86/platform/efi/efi.c
arch/x86/platform/efi/quirks.c
drivers/firmware/efi/fake_mem.c
drivers/firmware/efi/memmap.c
include/linux/efi.h