x86/spec-ctrl: Clean up MSR_MCU_OPT_CTRL handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 19 May 2021 18:40:28 +0000 (19:40 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Feb 2022 18:00:08 +0000 (18:00 +0000)
commit39a40f3835efcc25c1b05a25c321a01d7e11cbd7
tree60abca2837e5c71e3c8861ce57b4f8aeece93f48
parent345746045b49258547d67f456c368f23353575d4
x86/spec-ctrl: Clean up MSR_MCU_OPT_CTRL handling

Introduce cpu_has_srbds_ctrl as more users are going to appear shortly.

MSR_MCU_OPT_CTRL is gaining extra functionality, meaning that the current
default_xen_mcu_opt_ctrl is no longer a good fit.

Introduce two new helpers, update_mcu_opt_ctrl() which does a full RMW cycle
on the MSR, and set_in_mcu_opt_ctrl() which lets callers configure specific
bits at a time without clobbering each others settings.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/power.c
xen/arch/x86/cpu/intel.c
xen/arch/x86/include/asm/cpufeature.h
xen/arch/x86/include/asm/processor.h
xen/arch/x86/include/asm/spec_ctrl.h
xen/arch/x86/smpboot.c
xen/arch/x86/spec_ctrl.c