]> xenbits.xensource.com Git - xen.git/commit
x86/spec-ctrl: Knobs for STIBP and PSFD, and follow hardware STIBP hint
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 16 Mar 2022 13:07:40 +0000 (13:07 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 30 Jun 2022 17:07:13 +0000 (18:07 +0100)
commitfef244b179c06fcdfa581f7d57fa6e578c49ff50
treee061d45d92785963d16006614eb0da0c7974bd98
parentffc7694e0c99eea158c32aa164b7d1e1bb1dc46b
x86/spec-ctrl: Knobs for STIBP and PSFD, and follow hardware STIBP hint

STIBP and PSFD are slightly weird bits, because they're both implied by other
bits in MSR_SPEC_CTRL.  Add fine grain controls for them, and take the
implications into account when setting IBRS/SSBD.

Rearrange the IBPB text/variables/logic to keep all the MSR_SPEC_CTRL bits
together, for consistency.

However, AMD have a hardware hint CPUID bit recommending that STIBP be set
unilaterally.  This is advertised on Zen3, so follow the recommendation.
Furthermore, in such cases, set STIBP behind the guest's back for now.  This
has negligible overhead for the guest, but saves a WRMSR on vmentry.  This is
the only default change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
docs/misc/xen-command-line.pandoc
xen/arch/x86/hvm/svm/vmcb.c
xen/arch/x86/spec_ctrl.c