instead of using it if the CPU has detected that it exists.
This conflicts with retpoline - as when retpoline is enabled
we end up enabling/disabling the IBRS even though we should
not be touching this MSR.
OraBug:
27526563
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
smp_mb(); /* quirk */
}
- if (boot_cpu_has(X86_FEATURE_IBRS))
+ if (ibrs_inuse)
native_wrmsrl(MSR_IA32_SPEC_CTRL, SPEC_CTRL_FEATURE_DISABLE_IBRS);
__monitor((void *)¤t_thread_info()->flags, 0, 0);
if (!need_resched()) {
__sti_mwait(0, 0);
- if (boot_cpu_has(X86_FEATURE_IBRS))
+ if (ibrs_inuse)
native_wrmsrl(MSR_IA32_SPEC_CTRL,
SPEC_CTRL_FEATURE_ENABLE_IBRS);
} else {
- if (boot_cpu_has(X86_FEATURE_IBRS))
+ if (ibrs_inuse)
native_wrmsrl(MSR_IA32_SPEC_CTRL, SPEC_CTRL_FEATURE_ENABLE_IBRS);
local_irq_enable();
}