[PATCH v2] arm64/efi: prefer AllocatePages() over efi_low_alloc() for vmlinux

Timur Tabi timur at codeaurora.org
Tue Oct 27 14:15:45 PDT 2015


On Fri, Jul 24, 2015 at 6:38 AM, Ard Biesheuvel
<ard.biesheuvel at linaro.org> wrote:
>
> +               /*
> +                * First, try a straight allocation at the preferred offset.
> +                * This will work around the issue where, if dram_base == 0x0,
> +                * efi_low_alloc() refuses to allocate at 0x0 (to prevent the
> +                * address of the allocation to be mistaken for a FAIL return
> +                * value or a NULL pointer). It will also ensure that, on
> +                * platforms where the [dram_base, dram_base + TEXT_OFFSET)
> +                * interval is partially occupied by the firmware (like on APM
> +                * Mustang), we can still place the kernel at the address
> +                * 'dram_base + TEXT_OFFSET'.
> +                */
> +               *image_addr = *reserve_addr = dram_base + TEXT_OFFSET;
> +               nr_pages = round_up(kernel_memsize, EFI_ALLOC_ALIGN) /
> +                          EFI_PAGE_SIZE;
> +               status = efi_call_early(allocate_pages, EFI_ALLOCATE_ADDRESS,
> +                                       EFI_LOADER_DATA, nr_pages,
> +                                       (efi_physical_addr_t *)reserve_addr);

This causes our kernel to crash, because on our system, dram_base is
not 2MB aligned.  I'll be posting a patch soon that fixes this.

-- 
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