Skip to content

Commit e71356f

Browse files
committed
efi/libstub/arm64: Switch to ordinary page allocator for kernel image
It is no longer necessary to locate the kernel as low as possible in physical memory, and so we can switch from efi_low_alloc() [which is a rather nasty concoction on top of GetMemoryMap()] to a new helper called efi_allocate_pages_aligned(), which simply rounds up the size to account for the alignment, and frees the misaligned pages again. So considering that the kernel can live anywhere in the physical address space, as long as its alignment requirements are met, let's switch to efi_allocate_pages_aligned() to allocate the pages. Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 43b1df0 commit e71356f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/firmware/efi/libstub/arm64-stub.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
9898
return EFI_SUCCESS;
9999
}
100100

101-
status = efi_low_alloc(*reserve_size,
102-
min_kimg_align, reserve_addr);
101+
status = efi_allocate_pages_aligned(*reserve_size, reserve_addr,
102+
ULONG_MAX, min_kimg_align);
103103

104104
if (status != EFI_SUCCESS) {
105105
pr_efi_err("Failed to relocate kernel\n");

0 commit comments

Comments
 (0)