Skip to content

Commit 8885c73

Browse files
ardbiesheuvelwilldeacon
authored andcommitted
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 <ardb@kernel.org> Acked-by: Mark Rutland <mark.rutland@arm.com> Link: https://lore.kernel.org/r/20231127120049.2258650-7-ardb@google.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 103423a commit 8885c73

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/arm64/mm/mmu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,9 @@ static int __init map_entry_trampoline(void)
674674
{
675675
int i;
676676

677+
if (!arm64_kernel_unmapped_at_el0())
678+
return 0;
679+
677680
pgprot_t prot = kernel_exec_prot();
678681
phys_addr_t pa_start = __pa_symbol(__entry_tramp_text_start);
679682

0 commit comments

Comments
 (0)