]> xenbits.xensource.com Git - xen.git/commit
amd/msr: implement VIRT_SPEC_CTRL for HVM guests on top of SPEC_CTRL
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 15 Aug 2022 07:57:23 +0000 (09:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 15 Aug 2022 07:57:23 +0000 (09:57 +0200)
commitebaaa72ee080c8774b1df5783220d4811159c327
treeb5773811ee2b9cc25d5b6b0f8cc942a95c995a17
parent7547268c359eeef1a4d8e578c612e7cc9350992d
amd/msr: implement VIRT_SPEC_CTRL for HVM guests on top of SPEC_CTRL

Use the logic to set shadow SPEC_CTRL values in order to implement
support for VIRT_SPEC_CTRL (signaled by VIRT_SSBD CPUID flag) for HVM
guests. This includes using the spec_ctrl vCPU MSR variable to store
the guest set value of VIRT_SPEC_CTRL.SSBD, which will be OR'ed with
any SPEC_CTRL values being set by the guest.

On hardware having SPEC_CTRL VIRT_SPEC_CTRL will not be offered by
default to guests. VIRT_SPEC_CTRL will only be part of the max CPUID
policy so it can be enabled for compatibility purposes.

Use '!' to annotate the feature in order to express that the presence
of the bit is not directly tied to its value in the host policy.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpuid.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/include/asm/msr.h
xen/arch/x86/msr.c
xen/arch/x86/spec_ctrl.c
xen/include/public/arch-x86/cpufeatureset.h