]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/x86/kernel/process.c
x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature
[mirror_ubuntu-artful-kernel.git] / arch / x86 / kernel / process.c
index 3adb3806a28495fcd5a27fabf52cfae17a8cbaea..3fdf5358998e3a0b57b3b1996a37317117c73a92 100644 (file)
@@ -447,16 +447,16 @@ static __cpuidle void mwait_idle(void)
                        mb(); /* quirk */
                }
 
-               if (boot_cpu_has(X86_FEATURE_SPEC_CTRL))
+               if (ibrs_inuse)
                         native_wrmsrl(MSR_IA32_SPEC_CTRL, 0);
 
                __monitor((void *)&current_thread_info()->flags, 0, 0);
                if (!need_resched()) {
                        __sti_mwait(0, 0);
-                       if (boot_cpu_has(X86_FEATURE_SPEC_CTRL))
+                       if (ibrs_inuse)
                                native_wrmsrl(MSR_IA32_SPEC_CTRL, FEATURE_ENABLE_IBRS);
                } else {
-                       if (boot_cpu_has(X86_FEATURE_SPEC_CTRL))
+                       if (ibrs_inuse)
                                native_wrmsrl(MSR_IA32_SPEC_CTRL, FEATURE_ENABLE_IBRS);
                        local_irq_enable();
                }