Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>

+5 -6
+5 -6
arch/arm64/kernel/entry.S
··· 608 608 609 609 .popsection // .entry.text 610 610 611 - #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 612 - /* 613 - * Exception vectors trampoline. 614 - */ 615 - .pushsection ".entry.tramp.text", "ax" 616 - 617 611 // Move from tramp_pg_dir to swapper_pg_dir 618 612 .macro tramp_map_kernel, tmp 619 613 mrs \tmp, ttbr1_el1 ··· 703 709 .endr 704 710 .endm 705 711 712 + #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 713 + /* 714 + * Exception vectors trampoline. 715 + */ 716 + .pushsection ".entry.tramp.text", "ax" 706 717 .align 11 707 718 SYM_CODE_START_NOALIGN(tramp_vectors) 708 719 generate_tramp_vector