Skip to content

Commit 6fda8a3

Browse files
author
Peter Zijlstra
committed
x86/retpoline: Move the retpoline thunk declarations to nospec-branch.h
Because it makes no sense to split the retpoline gunk over multiple headers. 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 b6d3d99 commit 6fda8a3

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,3 @@
1717
extern void cmpxchg8b_emu(void);
1818
#endif
1919

20-
#ifdef CONFIG_RETPOLINE
21-
22-
#define GEN(reg) \
23-
extern asmlinkage void __x86_indirect_thunk_ ## reg (void);
24-
#include <asm/GEN-for-each-reg.h>
25-
#undef GEN
26-
27-
#endif /* CONFIG_RETPOLINE */

arch/x86/include/asm/nospec-branch.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <linux/static_key.h>
77
#include <linux/objtool.h>
8+
#include <linux/linkage.h>
89

910
#include <asm/alternative.h>
1011
#include <asm/cpufeatures.h>
@@ -118,6 +119,12 @@
118119
".popsection\n\t"
119120

120121
#ifdef CONFIG_RETPOLINE
122+
123+
#define GEN(reg) \
124+
extern asmlinkage void __x86_indirect_thunk_ ## reg (void);
125+
#include <asm/GEN-for-each-reg.h>
126+
#undef GEN
127+
121128
#ifdef CONFIG_X86_64
122129

123130
/*

arch/x86/net/bpf_jit_comp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <asm/set_memory.h>
1616
#include <asm/nospec-branch.h>
1717
#include <asm/text-patching.h>
18-
#include <asm/asm-prototypes.h>
1918

2019
static u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len)
2120
{

0 commit comments

Comments
 (0)