arm64: efi: prefer AllocatePages() over efi_low_alloc() for vmlinux
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 24 Jul 2015 11:38:27 +0000 (12:38 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 27 Jul 2015 10:08:41 +0000 (11:08 +0100)
commite38457c361b30c5a2379cc767877c3e5c2505dc6
tree66b2d1ac7d059ad95a7557d4207ce237a6a701b5
parente094d44568680d4e5e2722c4ad090ff0810719b9
arm64: efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

When allocating memory for the kernel image, try the AllocatePages()
boot service to obtain memory at the preferred offset of
'dram_base + TEXT_OFFSET', and only revert to efi_low_alloc() if that
fails. This is the only way to allocate at the base of DRAM if DRAM
starts at 0x0, since efi_low_alloc() refuses to allocate at 0x0.

Tested-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/efi-stub.c