The main purpose of this patch is to avoid opencoding the recovery logic at
the end, but also has the positive side effect of relaxing the SPEC_CTRL
mitigations when working to shut the final CPU down.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
error = 0;
ci = get_cpu_info();
- ci->use_shadow_spec_ctrl = 0;
+ spec_ctrl_enter_idle(ci);
+ /* Avoid NMI/#MC using MSR_SPEC_CTRL until we've reloaded microcode. */
ci->bti_ist_info = 0;
ACPI_FLUSH_CPU_CACHE();
if ( !recheck_cpu_features(0) )
panic("Missing previously available feature(s).");
+ /* Re-enabled default NMI/#MC use of MSR_SPEC_CTRL. */
ci->bti_ist_info = default_bti_ist_info;
- asm volatile (ALTERNATIVE("", "wrmsr", X86_FEATURE_XEN_IBRS_SET)
- :: "a" (SPEC_CTRL_IBRS), "c" (MSR_SPEC_CTRL), "d" (0)
- : "memory");
+ spec_ctrl_exit_idle(ci);
done:
spin_debug_enable();