[PATCH] arm64: efi: make sure vmlinux load address aligned on 2MBytes

Timur Tabi timur at codeaurora.org
Wed Oct 28 10:11:57 PDT 2015


On 10/27/2015 09:06 PM, Ard Biesheuvel wrote:
>
> diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c
> index 816120ece6bc..a60ce249cfc0 100644
> --- a/arch/arm64/kernel/efi-stub.c
> +++ b/arch/arm64/kernel/efi-stub.c
> @@ -42,7 +42,8 @@
>                   * Mustang), we can still place the kernel at the address
>                   * 'dram_base + TEXT_OFFSET'.
>                   */
> -               *image_addr = *reserve_addr = dram_base + TEXT_OFFSET;
> +               *image_addr = *reserve_addr = round_up(dram_base, SZ_2M) +
> +                                                      TEXT_OFFSET);
>                  nr_pages = round_up(kernel_memsize, EFI_ALLOC_ALIGN) /
>                             EFI_PAGE_SIZE;
>                  status = efi_call_early(allocate_pages, EFI_ALLOCATE_ADDRESS,

Tested-by: Timur Tabi <timur at codeaurora.org>
Tested-by: Shanker Donthineni <shankerd at codeaurora.org>

However, I think this formatting is easier to read:

		*image_addr = *reserve_addr =
			round_up(dram_base, SZ_2M) + TEXT_OFFSET;

This does make the kernel boot, but we suspect that there may be another 
problem.  We need to investigate it, but we have a suspicion that the 
EFI stub is trying to allocate from the Runtime Data block, and the 
alignment adjustment "fixes" the problem by moving the pointer to 
Conventional Memory.

Anyway, is there any chance we can get this fix into 4.3?  I'd hate to 
have 4.3 released knowing that it's broken on our hardware.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.



More information about the linux-arm-kernel mailing list