freebsd-dev/sys/amd64/vmm/intel
Konstantin Belousov c1141fba00 Update L1TF workaround to sustain L1D pollution from NMI.
Current mitigation for L1TF in bhyve flushes L1D either by an explicit
WRMSR command, or by software reading enough uninteresting data to
fully populate all lines of L1D.  If NMI occurs after either of
methods is completed, but before VM entry, L1D becomes polluted with
the cache lines touched by NMI handlers.  There is no interesting data
which NMI accesses, but something sensitive might be co-located on the
same cache line, and then L1TF exposes that to a rogue guest.

Use VM entry MSR load list to ensure atomicity of L1D cache and VM
entry if updated microcode was loaded.  If only software flush method
is available, try to help the bhyve sw flusher by also flushing L1D on
NMI exit to kernel mode.

Suggested by and discussed with: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D16790
2018-08-19 18:47:16 +00:00
..
ept.c sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
ept.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
vmcs.c Provide further mitigation against CVE-2017-5715 by flushing the 2018-02-12 14:45:27 +00:00
vmcs.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
vmx_controls.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
vmx_cpufunc.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
vmx_genassym.c Provide part of the mitigation for L1TF-VMM. 2018-08-14 17:29:41 +00:00
vmx_msr.c sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
vmx_msr.h sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00
vmx_support.S Update L1TF workaround to sustain L1D pollution from NMI. 2018-08-19 18:47:16 +00:00
vmx.c Update L1TF workaround to sustain L1D pollution from NMI. 2018-08-19 18:47:16 +00:00
vmx.h Provide further mitigation against CVE-2017-5715 by flushing the 2018-02-12 14:45:27 +00:00
vtd.c sys/amd64: further adoption of SPDX licensing ID tags. 2017-11-27 15:03:07 +00:00