Don't use dynamic IBRS that toggle IBRS on entry/exit
to kernel code if retpoline is used.

Signed-off-by: Tim Chen <tim.c.c...@linux.intel.com>
---
 arch/x86/kernel/cpu/spec_ctrl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/spec_ctrl.c b/arch/x86/kernel/cpu/spec_ctrl.c
index 28107a2..076c470 100644
--- a/arch/x86/kernel/cpu/spec_ctrl.c
+++ b/arch/x86/kernel/cpu/spec_ctrl.c
@@ -26,10 +26,12 @@ DEFINE_MUTEX(spec_ctrl_mutex);
 
 static inline void set_ibrs_feature(void)
 {
+#if !defined(RETPOLINE)
        if (!ibrs_admin_disabled) {
                dynamic_ibrs = 1;
                ibrs_enabled = IBRS_ENABLED;
        }
+#endif
 }
 
 void scan_spec_ctrl_feature(struct cpuinfo_x86 *c)
-- 
2.9.4

Reply via email to