summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/libstub/arm64-stub.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2022-10-13 10:17:20 +0200
committerArd Biesheuvel <ardb@kernel.org>2022-11-09 12:42:03 +0100
commitd9ffe524a538720328b5bf98733a6c641e236bc8 (patch)
treeee042bb1d78d3c2cf3d541fc3f33acbbd25248d1 /drivers/firmware/efi/libstub/arm64-stub.c
parentefi/riscv: libstub: Split off kernel image relocation for builtin stub (diff)
downloadlinux-d9ffe524a538720328b5bf98733a6c641e236bc8.tar.xz
linux-d9ffe524a538720328b5bf98733a6c641e236bc8.zip
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>
Diffstat (limited to 'drivers/firmware/efi/libstub/arm64-stub.c')
-rw-r--r--drivers/firmware/efi/libstub/arm64-stub.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c
index f35c0e54e294..c14028b625b4 100644
--- a/drivers/firmware/efi/libstub/arm64-stub.c
+++ b/drivers/firmware/efi/libstub/arm64-stub.c
@@ -11,37 +11,9 @@
#include <asm/efi.h>
#include <asm/memory.h>
#include <asm/sections.h>
-#include <asm/sysreg.h>
#include "efistub.h"
-efi_status_t check_platform_features(void)
-{
- u64 tg;
-
- /*
- * If we have 48 bits of VA space for TTBR0 mappings, we can map the
- * UEFI runtime regions 1:1 and so calling SetVirtualAddressMap() is
- * unnecessary.
- */
- if (VA_BITS_MIN >= 48)
- efi_novamap = true;
-
- /* UEFI mandates support for 4 KB granularity, no need to check */
- if (IS_ENABLED(CONFIG_ARM64_4K_PAGES))
- return EFI_SUCCESS;
-
- tg = (read_cpuid(ID_AA64MMFR0_EL1) >> ID_AA64MMFR0_EL1_TGRAN_SHIFT) & 0xf;
- if (tg < ID_AA64MMFR0_EL1_TGRAN_SUPPORTED_MIN || tg > ID_AA64MMFR0_EL1_TGRAN_SUPPORTED_MAX) {
- if (IS_ENABLED(CONFIG_ARM64_64K_PAGES))
- efi_err("This 64 KB granular kernel is not supported by your CPU\n");
- else
- efi_err("This 16 KB granular kernel is not supported by your CPU\n");
- return EFI_UNSUPPORTED;
- }
- return EFI_SUCCESS;
-}
-
/*
* Distro versions of GRUB may ignore the BSS allocation entirely (i.e., fail
* to provide space, and fail to zero it). Check for this condition by double