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>
Fri, 4 Feb 2022 15:45:25 +0000 (15:45 +0000)
commite7ccc7a8ab92502a12dc31f652b0ca3b1be04b7e
treebafb5f205eee584af0c4f5bc77e277c95779c676
parent6ef732726add103ee8f63293e326ad43b1643239
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>
(cherry picked from commit 378f2e6df31442396f0afda19794c5c6091d96f9)
xen/arch/x86/acpi/power.c
xen/arch/x86/cpu/amd.c
xen/arch/x86/smpboot.c
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/hvm/svm/svm.h