Skip to content

Commit f756200

Browse files
iii-iAlexei Starovoitov
authored andcommitted
s390: always declare expoline thunks
It would be convenient to use the following pattern in the BPF JIT: if (nospec_uses_trampoline()) emit_call(__s390_indirect_jump_r1); Unfortunately with CONFIG_EXPOLINE=n the compiler complains about the missing prototype of __s390_indirect_jump_r1(). One could wrap the whole "if" statement in an #ifdef, but this clutters the code. Instead, declare expoline thunk prototypes even when compiling without expolines. When using the above code structure and compiling without expolines, references to them are optimized away, and there are no linker errors. Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Ilya Leoshkevich <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 4e2e684 commit f756200

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ static inline bool nospec_uses_trampoline(void)
2626
return __is_defined(CC_USING_EXPOLINE) && !nospec_disable;
2727
}
2828

29-
#ifdef CONFIG_EXPOLINE_EXTERN
30-
3129
void __s390_indirect_jump_r1(void);
3230
void __s390_indirect_jump_r2(void);
3331
void __s390_indirect_jump_r3(void);
@@ -44,8 +42,6 @@ void __s390_indirect_jump_r13(void);
4442
void __s390_indirect_jump_r14(void);
4543
void __s390_indirect_jump_r15(void);
4644

47-
#endif
48-
4945
#endif /* __ASSEMBLY__ */
5046

5147
#endif /* _ASM_S390_EXPOLINE_H */

0 commit comments

Comments
 (0)