aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <[email protected]>2023-11-27 13:00:52 +0100
committerWill Deacon <[email protected]>2023-12-11 11:40:38 +0000
commit8885c7398fe56c49f14be6ce0ac202385f3cd818 (patch)
tree20cd2e9f4cf48acca8c0c6c40c69377e31275d98
parent103423ad7e56d6c756738823c332c414b07899e6 (diff)
arm64: mm: Only map KPTI trampoline if it is going to be used
Avoid creating the fixmap entries for the KPTI trampoline if KPTI is not in use. Signed-off-by: Ard Biesheuvel <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
-rw-r--r--arch/arm64/mm/mmu.c3
1 files changed, 3 insertions, 0 deletions
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);