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

x86/retpoline: Remove unused replacement symbols

Now that objtool no longer creates alternatives, these replacement
symbols are no longer needed, remove them.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/r/20211026120309.915051744@infradead.org

-52
-10
arch/x86/include/asm/asm-prototypes.h
··· 24 24 extern asmlinkage void __x86_indirect_thunk_ ## reg (void); 25 25 #include <asm/GEN-for-each-reg.h> 26 26 27 - #undef GEN 28 - #define GEN(reg) \ 29 - extern asmlinkage void __x86_indirect_alt_call_ ## reg (void); 30 - #include <asm/GEN-for-each-reg.h> 31 - 32 - #undef GEN 33 - #define GEN(reg) \ 34 - extern asmlinkage void __x86_indirect_alt_jmp_ ## reg (void); 35 - #include <asm/GEN-for-each-reg.h> 36 - 37 27 #endif /* CONFIG_RETPOLINE */
-42
arch/x86/lib/retpoline.S
··· 41 41 .endm 42 42 43 43 /* 44 - * This generates .altinstr_replacement symbols for use by objtool. They, 45 - * however, must not actually live in .altinstr_replacement since that will be 46 - * discarded after init, but module alternatives will also reference these 47 - * symbols. 48 - * 49 - * Their names matches the "__x86_indirect_" prefix to mark them as retpolines. 50 - */ 51 - .macro ALT_THUNK reg 52 - 53 - .align 1 54 - 55 - SYM_FUNC_START_NOALIGN(__x86_indirect_alt_call_\reg) 56 - ANNOTATE_RETPOLINE_SAFE 57 - 1: call *%\reg 58 - 2: .skip 5-(2b-1b), 0x90 59 - SYM_FUNC_END(__x86_indirect_alt_call_\reg) 60 - 61 - STACK_FRAME_NON_STANDARD(__x86_indirect_alt_call_\reg) 62 - 63 - SYM_FUNC_START_NOALIGN(__x86_indirect_alt_jmp_\reg) 64 - ANNOTATE_RETPOLINE_SAFE 65 - 1: jmp *%\reg 66 - 2: .skip 5-(2b-1b), 0x90 67 - SYM_FUNC_END(__x86_indirect_alt_jmp_\reg) 68 - 69 - STACK_FRAME_NON_STANDARD(__x86_indirect_alt_jmp_\reg) 70 - 71 - .endm 72 - 73 - /* 74 44 * Despite being an assembler file we can't just use .irp here 75 45 * because __KSYM_DEPS__ only uses the C preprocessor and would 76 46 * only see one instance of "__x86_indirect_thunk_\reg" rather ··· 61 91 62 92 #undef GEN 63 93 #define GEN(reg) EXPORT_THUNK(reg) 64 - #include <asm/GEN-for-each-reg.h> 65 - 66 - #undef GEN 67 - #define GEN(reg) ALT_THUNK reg 68 - #include <asm/GEN-for-each-reg.h> 69 - 70 - #undef GEN 71 - #define GEN(reg) __EXPORT_THUNK(__x86_indirect_alt_call_ ## reg) 72 - #include <asm/GEN-for-each-reg.h> 73 - 74 - #undef GEN 75 - #define GEN(reg) __EXPORT_THUNK(__x86_indirect_alt_jmp_ ## reg) 76 94 #include <asm/GEN-for-each-reg.h>