]> xenbits.xensource.com Git - xen.git/commit
x86/cpuid: Improvements to guest policies for speculative sidechannel features
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 May 2018 10:59:03 +0000 (11:59 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 16 May 2018 11:19:10 +0000 (12:19 +0100)
commitcb06b308ec71b23f37a44f5e2351fe2cae0306e9
treee8675234e2b16d700fcde6fd1235e22536934f92
parentcb8c12020307b39a89273d7699e89000451987ab
x86/cpuid: Improvements to guest policies for speculative sidechannel features

If Xen isn't virtualising MSR_SPEC_CTRL for guests, IBRSB shouldn't be
advertised.  It is not currently possible to express this via the existing
command line options, but such an ability will be introduced.

Another useful option in some usecases is to offer IBPB without IBRS.  When a
guest kernel is known to be compatible (uses retpoline and knows about the AMD
IBPB feature bit), an administrator with pre-Skylake hardware may wish to hide
IBRS.  This allows the VM to have full protection, without Xen or the VM
needing to touch MSR_SPEC_CTRL, which can reduce the overhead of Spectre
mitigations.

Break the logic common to both PV and HVM CPUID calculations into a common
helper, to avoid duplication.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/cpuid.c