efi/arm64: libstub: Split off kernel image relocation for builtin stub
authorArd Biesheuvel <ardb@kernel.org>
Thu, 13 Oct 2022 08:17:20 +0000 (10:17 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Wed, 9 Nov 2022 11:42:03 +0000 (12:42 +0100)
commitd9ffe524a538720328b5bf98733a6c641e236bc8
treeee042bb1d78d3c2cf3d541fc3f33acbbd25248d1
parentf1a116c055e3aee0c579d39bd777c9155e8bf5d1
efi/arm64: libstub: Split off kernel image relocation for builtin stub

The arm64 build of the EFI stub is part of the core kernel image, and
therefore accesses section markers directly when it needs to figure out
the size of the various section.

The zboot decompressor does not have access to those symbols, but
doesn't really need that either. So let's move handle_kernel_image()
into a separate file (or rather, move everything else into a separate
file) so that the zboot build does not pull in unused code that links to
symbols that it does not define.

While at it, introduce a helper routine that the generic zboot loader
will need to invoke after decompressing the image but before invoking
it, to ensure that the I-side view of memory is consistent.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/Makefile
drivers/firmware/efi/libstub/arm64-entry.S
drivers/firmware/efi/libstub/arm64-stub.c
drivers/firmware/efi/libstub/arm64.c [new file with mode: 0644]
drivers/firmware/efi/libstub/efistub.h