]> xenbits.xensource.com Git - xen.git/commit
x86/spec_ctrl: Updates to retpoline-safety decision making
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Apr 2018 12:48:01 +0000 (12:48 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Apr 2018 16:28:23 +0000 (17:28 +0100)
commit1232378bd2fef45f613db049b33852fdf84d7ddf
tree82c8fd9e32318f18be92814be00554758ba823a9
parentaf7e907c33e7a8d81448e3fd2ce7939e24b200f8
x86/spec_ctrl: Updates to retpoline-safety decision making

All of this is as recommended by the Intel whitepaper:

https://software.intel.com/sites/default/files/managed/1d/46/Retpoline-A-Branch-Target-Injection-Mitigation.pdf

The 'RSB Alternative' bit in MSR_ARCH_CAPABILITIES may be set by a hypervisor
to indicate that the virtual machine may migrate to a processor which isn't
retpoline-safe.  Introduce a shortened name (to reduce code volume), treat it
as authorative in retpoline_safe(), and print its value along with the other
ARCH_CAPS bits.

The exact processor models which do have RSB semantics which fall back to BTB
predictions are enumerated, and include Kabylake and Coffeelake.  Leave a
printk() in the default case to help identify cases which aren't covered.

The exact microcode versions from Broadwell RSB-safety are taken from the
referenced microcode update file (adjusting for the known-bad microcode
versions).  Despite the exact wording of the text, it is only Broadwell
processors which need a microcode check.

In practice, this means that all Broadwell hardware with up-to-date microcode
will use retpoline in preference to IBRS, which will be a performance
improvement for desktop and server systems which would previously always opt
for IBRS over retpoline.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/msr-index.h