diff options
| author | Ilias Apalodimas <[email protected]> | 2021-10-11 15:10:23 +0300 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2021-10-21 03:46:04 +0200 |
| commit | ebdea88d57d5e67b8f6e6cf615300eedbc7200a9 (patch) | |
| tree | 0d10af5c52e927ac6a0ab2789729ddaf7e3566c9 /include | |
| parent | fa00b6fc3f86c88bf7afe00253340f529eeacb6d (diff) | |
efi_loader: Fix loaded image alignment
We are ignoring the alignment communicated via the PE/COFF header.
Starting 5.10 the Linux kernel will loudly complain about it. For more
details look at [1] (in linux kernel).
So add a function that can allocate aligned EFI memory and use it for our
relocated loaded image.
[1] c32ac11da3f83 ("efi/libstub: arm64: Double check image alignment at entry")
Signed-off-by: Ilias Apalodimas <[email protected]>
Tested-by: Vincent Stehlé <[email protected]>
Acked-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/efi_loader.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h index c440962fe52..5cdc72345e5 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -675,6 +675,8 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid); #define efi_size_in_pages(size) (((size) + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT) /* Generic EFI memory allocator, call this to get memory */ void *efi_alloc(uint64_t len, int memory_type); +/* Allocate pages on the specified alignment */ +void *efi_alloc_aligned_pages(u64 len, int memory_type, size_t align); /* More specific EFI memory allocator, called by EFI payloads */ efi_status_t efi_allocate_pages(enum efi_allocate_type type, enum efi_memory_type memory_type, |
