[PATCH v2 2/3] arm64: mm: Only map KPTI trampoline if it is going to be used
Ard Biesheuvel
ardb at google.com
Mon Nov 27 04:00:52 PST 2023
From: Ard Biesheuvel <ardb at kernel.org>
Avoid creating the fixmap entries for the KPTI trampoline if KPTI is not
in use.
Signed-off-by: Ard Biesheuvel <ardb at kernel.org>
---
arch/arm64/mm/mmu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 15f6347d23b6..6c8078916f5e 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -674,6 +674,9 @@ static int __init map_entry_trampoline(void)
{
int i;
+ if (!arm64_kernel_unmapped_at_el0())
+ return 0;
+
pgprot_t prot = kernel_exec_prot();
phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
--
2.43.0.rc1.413.gea7ed67945-goog
More information about the linux-arm-kernel
mailing list