summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeffrey Hugo <jhugo@codeaurora.org>2016-08-29 14:38:51 -0600
committerBen Hutchings <ben@decadent.org.uk>2016-11-20 01:17:23 +0000
commitb4bcdf6887af71ab3bdb378d189454dc16bd696d (patch)
tree1c6986cdd9bcf351233d27f5e1b3c5c80df67020 /include
parent35f6b4a95e8ada05cbb7809bafcbae5c092a1dad (diff)
downloadlinux-stable-b4bcdf6887af71ab3bdb378d189454dc16bd696d.tar.gz
linux-stable-b4bcdf6887af71ab3bdb378d189454dc16bd696d.tar.bz2
linux-stable-b4bcdf6887af71ab3bdb378d189454dc16bd696d.zip
efi/libstub: Allocate headspace in efi_get_memory_map()
commit dadb57abc37499f565b23933dbf49b435c3ba8af upstream. efi_get_memory_map() allocates a buffer to store the memory map that it retrieves. This buffer may need to be reused by the client after ExitBootServices() is called, at which point allocations are not longer permitted. To support this usecase, provide the allocated buffer size back to the client, and allocate some additional headroom to account for any reasonable growth in the map that is likely to happen between the call to efi_get_memory_map() and the client reusing the buffer. Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> [bwh: Backported to 3.16: - Adjust filenames, context - In allocate_new_fdt_and_exit_boot(), only fill memory_map - Drop changes to efi_random_alloc()] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/efi.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 8cb09c9d81ef..1431089c54dc 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -117,6 +117,15 @@ typedef struct {
u32 imagesize;
} efi_capsule_header_t;
+struct efi_boot_memmap {
+ efi_memory_desc_t **map;
+ unsigned long *map_size;
+ unsigned long *desc_size;
+ u32 *desc_ver;
+ unsigned long *key_ptr;
+ unsigned long *buff_size;
+};
+
/*
* Allocation types for calls to boottime->allocate_pages.
*/