diff mbox series

[2/2] x86: make __ibp_barrier visible

Message ID 20180205151300.539874-3-arnd@arndb.de
State New
Headers show
Series LTO: two more fixes | expand

Commit Message

Arnd Bergmann Feb. 5, 2018, 3:12 p.m. UTC
LTO linking was broken by the addition of __ibp_barrier, which only
has relocations from assembler code, and not from C, so the linker
decides to drop it:

./ccfzUJ1l.ltrans0.ltrans.o:(.altinstr_replacement+0x42): undefined reference to `__ibp_barrier'

Fixes: 64e16720ea08 ("x86/speculation: Simplify indirect_branch_prediction_barrier()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 arch/x86/kernel/cpu/bugs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.9.0
diff mbox series

Patch

diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
index 71949bf2de5a..c3f5fe1c6e83 100644
--- a/arch/x86/kernel/cpu/bugs.c
+++ b/arch/x86/kernel/cpu/bugs.c
@@ -338,7 +338,7 @@  ssize_t cpu_show_spectre_v2(struct device *dev,
 }
 #endif
 
-void __ibp_barrier(void)
+void __visible __ibp_barrier(void)
 {
 	__wrmsr(MSR_IA32_PRED_CMD, PRED_CMD_IBPB, 0);
 }