• Ard Biesheuvel's avatar
    efi/libstub: arm32: Use low allocation for the uncompressed kernel · 762cd288
    Ard Biesheuvel authored
    Before commit
    
      d0f9ca9b ("ARM: decompressor: run decompressor in place if loaded via UEFI")
    
    we were rather limited in the choice of base address for the uncompressed
    kernel, as we were relying on the logic in the decompressor that blindly
    rounds down the decompressor execution address to the next multiple of 128
    MiB, and decompresses the kernel there. For this reason, we have a lot of
    complicated memory region handling code, to ensure that this memory window
    is available, even though it could be occupied by reserved regions or
    other allocations that may or may not collide with the uncompressed image.
    
    Today, we simply pass the target address for the decompressed image to the
    decompressor directly, and so we can choose a suitable window just by
    finding a 16 MiB aligned region, while taking TEXT_OFFSET and the region
    for the swapper page tables into account.
    
    So let's get rid of the complicated logic, and instead, use the existing
    bottom up allocation routine to allocate a suitable window as low as
    possible, and carve out a memory region that has the right properties.
    
    Note that this removes any dependencies on the 'dram_base' argument to
    handle_kernel_image(), and so this is removed as well. Given that this
    was the only remaining use of dram_base, the code that produces it is
    removed entirely as well.
    Reviewed-by: default avatarMaxim Uvarov <maxim.uvarov@linaro.org>
    Tested-by: default avatarMaxim Uvarov <maxim.uvarov@linaro.org>
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    762cd288
arm64-stub.c 3.26 KB