diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2020-02-10 17:02:39 +0100 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2020-02-23 21:57:15 +0100 |
commit | 6a4db9bfdd56ede30686d8e1cfadedc8b22a6bf5 (patch) | |
tree | 9f49070a773ff9e2060c1b78491d12ac19ad0548 /drivers | |
parent | a46a290a01149120f40f83a694d3e6041bcf8f70 (diff) |
efi/libstub/x86: Permit bootparams struct to be allocated above 4 GB
We now support bootparams structures that are located in memory that
is not 32-bit addressable, so relax the allocation limit on systems
where this feature is enabled.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/firmware/efi/libstub/x86-stub.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index 7e7c50883cce..9d60352baa0f 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -363,6 +363,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, char *cmdline_ptr; unsigned long ramdisk_addr; unsigned long ramdisk_size; + bool above4g; sys_table = sys_table_arg; @@ -376,7 +377,11 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, return status; } - status = efi_low_alloc(0x4000, 1, (unsigned long *)&boot_params); + hdr = &((struct boot_params *)image->image_base)->hdr; + above4g = hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G; + + status = efi_allocate_pages(0x4000, (unsigned long *)&boot_params, + above4g ? ULONG_MAX : UINT_MAX); if (status != EFI_SUCCESS) { efi_printk("Failed to allocate lowmem for boot params\n"); return status; |