summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/efistub.h
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2022-08-02 11:00:16 +0200
committerArd Biesheuvel <ardb@kernel.org>2022-11-18 09:14:08 +0100
commit9cf42bca30e98a1c6c9e8abf876940a551eaa3d1 (patch)
tree9f3dc73b8f91db7baefbf1d81ccefaaa1f76d29d /drivers/firmware/efi/libstub/efistub.h
parent977122898ea5e3d568014ec9fe089cfba7c73e76 (diff)
efi: libstub: use EFI_LOADER_CODE region when moving the kernel in memory
The EFI spec is not very clear about which permissions are being given when allocating pages of a certain type. However, it is quite obvious that EFI_LOADER_CODE is more likely to permit execution than EFI_LOADER_DATA, which becomes relevant once we permit booting the kernel proper with the firmware's 1:1 mapping still active. Ostensibly, recent systems such as the Surface Pro X grant executable permissions to EFI_LOADER_CODE regions but not EFI_LOADER_DATA regions. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/efistub.h')
-rw-r--r--drivers/firmware/efi/libstub/efistub.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index 21b01d6c77ba..e85916ed5311 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -880,7 +880,8 @@ void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size,
efi_status_t efi_get_random_bytes(unsigned long size, u8 *out);
efi_status_t efi_random_alloc(unsigned long size, unsigned long align,
- unsigned long *addr, unsigned long random_seed);
+ unsigned long *addr, unsigned long random_seed,
+ int memory_type);
efi_status_t check_platform_features(void);
@@ -905,7 +906,8 @@ efi_status_t efi_allocate_pages(unsigned long size, unsigned long *addr,
unsigned long max);
efi_status_t efi_allocate_pages_aligned(unsigned long size, unsigned long *addr,
- unsigned long max, unsigned long align);
+ unsigned long max, unsigned long align,
+ int memory_type);
efi_status_t efi_low_alloc_above(unsigned long size, unsigned long align,
unsigned long *addr, unsigned long min);