summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kernel/setup.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-02-14 13:29:02 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2024-02-16 13:42:32 +0100
commit293d865f0af58e6ff2ff0ba0e890674e00d036b1 (patch)
tree5581033bbf73a940bc92e58c47e10458effa4f65 /arch/arm64/kernel/setup.c
parentarm64: head: move memstart_offset_seed handling to C code (diff)
downloadlinux-293d865f0af58e6ff2ff0ba0e890674e00d036b1.tar.xz
linux-293d865f0af58e6ff2ff0ba0e890674e00d036b1.zip
arm64: mm: Make kaslr_requires_kpti() a static inline
In preparation for moving the first assignment of arm64_use_ng_mappings to an earlier stage in the boot, ensure that kaslr_requires_kpti() is accessible without relying on the core kernel's view on whether or not KASLR is enabled. So make it a static inline, and move the kaslr_enabled() check out of it and into the callers, one of which will disappear in a subsequent patch. Once/when support for the obsolete ThunderX 1 platform is dropped, this check reduces to a E0PD feature check on the local CPU. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20240214122845.2033971-61-ardb+git@google.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/setup.c')
-rw-r--r--arch/arm64/kernel/setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 97d2143669cf..0ef45d1927b3 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -288,7 +288,7 @@ void __init __no_sanitize_address setup_arch(char **cmdline_p)
* mappings from the start, avoiding the cost of rewriting
* everything later.
*/
- arm64_use_ng_mappings = kaslr_requires_kpti();
+ arm64_use_ng_mappings = kaslr_enabled() && kaslr_requires_kpti();
early_fixmap_init();
early_ioremap_init();