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

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) <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/20211026120310.106290934@infradead.org

+7 -9
-8
arch/x86/include/asm/asm-prototypes.h
··· 17 17 extern void cmpxchg8b_emu(void); 18 18 #endif 19 19 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 */
+7
arch/x86/include/asm/nospec-branch.h
··· 5 5 6 6 #include <linux/static_key.h> 7 7 #include <linux/objtool.h> 8 + #include <linux/linkage.h> 8 9 9 10 #include <asm/alternative.h> 10 11 #include <asm/cpufeatures.h> ··· 119 118 ".popsection\n\t" 120 119 121 120 #ifdef CONFIG_RETPOLINE 121 + 122 + #define GEN(reg) \ 123 + extern asmlinkage void __x86_indirect_thunk_ ## reg (void); 124 + #include <asm/GEN-for-each-reg.h> 125 + #undef GEN 126 + 122 127 #ifdef CONFIG_X86_64 123 128 124 129 /*
-1
arch/x86/net/bpf_jit_comp.c
··· 15 15 #include <asm/set_memory.h> 16 16 #include <asm/nospec-branch.h> 17 17 #include <asm/text-patching.h> 18 - #include <asm/asm-prototypes.h> 19 18 20 19 static u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) 21 20 {