[PATCH RFC/RFT 0/3] efi/libstub: arm32: Remove dependency on dram_base

Palmer Dabbelt palmer at dabbelt.com
Wed Sep 9 16:52:52 EDT 2020

On Wed, 09 Sep 2020 08:16:20 PDT (-0700), ardb at kernel.org wrote:
> Maxim reports boot failures on platforms that describe reserved memory
> regions in DT that are disjoint from system DRAM, and which are converted
> to EfiReservedMemory regions by the EFI subsystem in u-boot.
> As it turns out, the whole notion of discovering the base of DRAM is
> problematic, and it would be better to simply rely on the EFI memory
> allocation routines instead, and derive the FDT and initrd allocation
> limits from the actual placement of the kernel (which is what defines
> the start of the linear region anyway)
> Finally, we should be able to get rid of get_dram_base() entirely.
> However, as RISC-V only just started using it, we will need to address
> that at a later time.

Looks like we're using dram_base to derive two argumets to
efi_relocate_kernel(): the preferred load address and the minimum load address.
I don't see any reason why we can't use the same PAGE_OFFSET-like logic that
x86 uses for the minimum load address, but I don't think we have any mechanism
like "struct boot_params" so we'd need to come up with something.

> Cc: Maxim Uvarov <maxim.uvarov at linaro.org>
> Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Cc: Atish Patra <atish.patra at wdc.com>
> Cc: Palmer Dabbelt <palmer at dabbelt.com>
> Cc: Jens Wiklander <jens.wiklander at linaro.org>
> Cc: Francois Ozog <francois.ozog at linaro.org>
> Cc: Etienne CARRIERE <etienne.carriere at st.com>
> Cc: Takahiro Akashi <takahiro.akashi at linaro.org>
> Cc: Patrice CHOTARD <patrice.chotard at st.com>
> Cc: Sumit Garg <sumit.garg at linaro.org>
> Cc: Grant Likely <Grant.Likely at arm.com>
> Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
> Cc: Christophe Priouzeau <christophe.priouzeau at linaro.org>
> Cc: Rouven Czerwinski <r.czerwinski at pengutronix.de>
> Cc: Patrick DELAUNAY <patrick.delaunay at st.com>
> Ard Biesheuvel (3):
>   efi/libstub: Export efi_low_alloc_above() to other units
>   efi/libstub: Use low allocation for the uncompressed kernel
>   efi/libstub: base FDT and initrd placement on image address not DRAM
>     base
>  arch/arm/include/asm/efi.h                |   6 +-
>  arch/arm64/include/asm/efi.h              |   2 +-
>  drivers/firmware/efi/libstub/arm32-stub.c | 177 ++++----------------
>  drivers/firmware/efi/libstub/efi-stub.c   |   2 +-
>  drivers/firmware/efi/libstub/efistub.h    |   3 +
>  drivers/firmware/efi/libstub/relocate.c   |   4 +-
>  6 files changed, 47 insertions(+), 147 deletions(-)

More information about the linux-arm-kernel mailing list