]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/x86/lib/delay.c
UBUNTU: SAUCE: x86/bugs: Honour SPEC_CTRL default
[mirror_ubuntu-artful-kernel.git] / arch / x86 / lib / delay.c
index 72a17464255081b8e45149a8b93499fd0d3b5046..c12988c7a2674b779d0ee46ea2cf940f6b9a406e 100644 (file)
@@ -108,7 +108,7 @@ static void delay_mwaitx(unsigned long __loops)
                delay = min_t(u64, MWAITX_MAX_LOOPS, loops);
 
                if (ibrs_inuse && (delay > IBRS_DISABLE_THRESHOLD))
-                       native_wrmsrl(MSR_IA32_SPEC_CTRL, 0);
+                       native_wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_get_default());
 
                /*
                 * Use cpu_tss_rw as a cacheline-aligned, seldomly
@@ -124,7 +124,7 @@ static void delay_mwaitx(unsigned long __loops)
                __mwaitx(MWAITX_DISABLE_CSTATES, delay, MWAITX_ECX_TIMER_ENABLE);
 
                if (ibrs_inuse && (delay > IBRS_DISABLE_THRESHOLD))
-                       native_wrmsrl(MSR_IA32_SPEC_CTRL, FEATURE_ENABLE_IBRS);
+                       native_wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_get_default() | SPEC_CTRL_IBRS);
 
                end = rdtsc_ordered();