x86/spec-ctrl: Use common MSR_SPEC_CTRL logic for AMD
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 21 Jan 2022 15:59:03 +0000 (15:59 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 Feb 2022 13:20:44 +0000 (13:20 +0000)
commit378f2e6df31442396f0afda19794c5c6091d96f9
tree4886d375268189cc012a0ca46fd006f21772ac2e
parent00f2992b6c7a9d4090443c1a85bf83224a87eeb9
x86/spec-ctrl: Use common MSR_SPEC_CTRL logic for AMD

Currently, amd_init_ssbd() works by being the only write to MSR_SPEC_CTRL in
the system.  This ceases to be true when using the common logic.

Include AMD MSR_SPEC_CTRL in has_spec_ctrl to activate the common paths, and
introduce an AMD specific block to control alternatives.  Also update the
boot/resume paths to configure default_xen_spec_ctrl.

svm.h needs an adjustment to remove a dependency on include order.

For now, only active alternatives for HVM - PV will require more work.  No
functional change, as no alternatives are defined yet for HVM yet.

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/amd.c
xen/arch/x86/include/asm/hvm/svm/svm.h
xen/arch/x86/smpboot.c
xen/arch/x86/spec_ctrl.c