]> www.infradead.org Git - users/willy/xarray.git/commit
efi: arm64: enter with MMU and caches enabled
authorArd Biesheuvel <ardb@kernel.org>
Wed, 11 Jan 2023 10:22:36 +0000 (11:22 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 24 Jan 2023 11:51:08 +0000 (11:51 +0000)
commit61786170383093908e9f5f8fd8c5c3ff0c3bbe03
treefb1bf4849a02cd89bb0ba73e7385f8b5daf4c52f
parent3dcf60bbfd284e5ebfa40c56172222425d10abf0
efi: arm64: enter with MMU and caches enabled

Instead of cleaning the entire loaded kernel image to the PoC and
disabling the MMU and caches before branching to the kernel's bare metal
entry point, we can leave the MMU and caches enabled, and rely on EFI's
cacheable 1:1 mapping of all of system RAM (which is mandated by the
spec) to populate the initial page tables.

This removes the need for managing coherency in software, which is
tedious and error prone.

Note that we still need to clean the executable region of the image to
the PoU if this is required for I/D coherency, but only if we actually
decided to move the image in memory, as otherwise, this will have been
taken care of by the loader.

This change affects both the builtin EFI stub as well as the zboot
decompressor, which now carries the entire EFI stub along with the
decompression code and the compressed image.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20230111102236.1430401-7-ardb@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/efi.h
arch/arm64/kernel/image-vars.h
arch/arm64/mm/cache.S
drivers/firmware/efi/libstub/Makefile
drivers/firmware/efi/libstub/arm64-entry.S [deleted file]
drivers/firmware/efi/libstub/arm64-stub.c
drivers/firmware/efi/libstub/arm64.c