Skip to content

Commit 4fe79e7

Browse files
author
Peter Zijlstra
committed
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) <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Tested-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 134ab5b commit 4fe79e7

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

arch/x86/include/asm/asm-prototypes.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,4 @@ extern void cmpxchg8b_emu(void);
2424
extern asmlinkage void __x86_indirect_thunk_ ## reg (void);
2525
#include <asm/GEN-for-each-reg.h>
2626

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-
3727
#endif /* CONFIG_RETPOLINE */

arch/x86/lib/retpoline.S

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,6 @@ SYM_FUNC_END(__x86_indirect_thunk_\reg)
4040

4141
.endm
4242

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-
7343
/*
7444
* Despite being an assembler file we can't just use .irp here
7545
* because __KSYM_DEPS__ only uses the C preprocessor and would
@@ -92,15 +62,3 @@ STACK_FRAME_NON_STANDARD(__x86_indirect_alt_jmp_\reg)
9262
#undef GEN
9363
#define GEN(reg) EXPORT_THUNK(reg)
9464
#include <asm/GEN-for-each-reg.h>
95-
96-
#undef GEN
97-
#define GEN(reg) ALT_THUNK reg
98-
#include <asm/GEN-for-each-reg.h>
99-
100-
#undef GEN
101-
#define GEN(reg) __EXPORT_THUNK(__x86_indirect_alt_call_ ## reg)
102-
#include <asm/GEN-for-each-reg.h>
103-
104-
#undef GEN
105-
#define GEN(reg) __EXPORT_THUNK(__x86_indirect_alt_jmp_ ## reg)
106-
#include <asm/GEN-for-each-reg.h>

0 commit comments

Comments
 (0)