• Ard Biesheuvel's avatar
    efi/arm-stub: Correct FDT and initrd allocation rules for arm64 · 138728dd
    Ard Biesheuvel authored
    On arm64, we have made some changes over the past year to the way the
    kernel itself is allocated and to how it deals with the initrd and FDT.
    This patch brings the allocation logic in the EFI stub in line with that,
    which is necessary because the introduction of KASLR has created the
    possibility for the initrd to be allocated in a place where the kernel
    may not be able to map it. (This is mostly a theoretical scenario, since
    it only affects systems where the physical memory footprint exceeds the
    size of the linear mapping.)
    
    Since we know the kernel itself will be covered by the linear mapping,
    choose a suitably sized window (i.e., based on the size of the linear
    region) covering the kernel when allocating memory for the initrd.
    
    The FDT may be anywhere in memory on arm64 now that we map it via the
    fixmap, so we can lift the address restriction there completely.
    Tested-by: default avatarRichard Ruigrok <rruigrok@codeaurora.org>
    Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
    Reviewed-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Matt Fleming <matt@codeblueprint.co.uk>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-efi@vger.kernel.org
    Link: http://lkml.kernel.org/r/20170404160245.27812-4-ard.biesheuvel@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    138728dd
efi.h 3.04 KB