From: Ard Biesheuvel Date: Mon, 27 Nov 2023 12:00:52 +0000 (+0100) Subject: arm64: mm: Only map KPTI trampoline if it is going to be used X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8885c7398fe56c49f14be6ce0ac202385f3cd818;p=linux.git 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 Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20231127120049.2258650-7-ardb@google.com Signed-off-by: Will Deacon --- diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 15f6347d23b69..6c8078916f5e6 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);