Skip to content

Commit 13d7a08

Browse files
author
James Morse
committed
arm64: entry: Move trampoline macros out of ifdef'd section
The macros for building the kpti trampoline are all behind CONFIG_UNMAP_KERNEL_AT_EL0, and in a region that outputs to the .entry.tramp.text section. Move the macros out so they can be used to generate other kinds of trampoline. Only the symbols need to be guarded by CONFIG_UNMAP_KERNEL_AT_EL0 and appear in the .entry.tramp.text section. Reviewed-by: Russell King (Oracle) <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Signed-off-by: James Morse <[email protected]>
1 parent ed50da7 commit 13d7a08

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

arch/arm64/kernel/entry.S

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,6 @@ SYM_CODE_END(ret_to_user)
608608

609609
.popsection // .entry.text
610610

611-
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
612-
/*
613-
* Exception vectors trampoline.
614-
*/
615-
.pushsection ".entry.tramp.text", "ax"
616-
617611
// Move from tramp_pg_dir to swapper_pg_dir
618612
.macro tramp_map_kernel, tmp
619613
mrs \tmp, ttbr1_el1
@@ -709,6 +703,11 @@ alternative_else_nop_endif
709703
.endr
710704
.endm
711705

706+
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
707+
/*
708+
* Exception vectors trampoline.
709+
*/
710+
.pushsection ".entry.tramp.text", "ax"
712711
.align 11
713712
SYM_CODE_START_NOALIGN(tramp_vectors)
714713
generate_tramp_vector

0 commit comments

Comments
 (0)