Perform mitigations for Intel L1TF screwup. There are three options:
authorderaadt <deraadt@openbsd.org>
Tue, 21 Aug 2018 19:04:38 +0000 (19:04 +0000)
committerderaadt <deraadt@openbsd.org>
Tue, 21 Aug 2018 19:04:38 +0000 (19:04 +0000)
commitc844c4ad37ba222ab37c64cfbe4c5eb1ec73c844
treeddd3d7c8f1a7cb67069d44ecdbe3c6504aed8e63
parenta1c86173e923de9fd7c13c451d6bc13c19eb64b8
Perform mitigations for Intel L1TF screwup.  There are three options:
(1) Future cpus which don't have the bug, (2) cpu's with microcode
containing a L1D flush operation, (3) stuffing the L1D cache with fresh
data and expiring old content.  This stuffing loop is complicated and
interesting, no details on the mitigation have been released by Intel so
Mike and I studied other systems for inspiration.  Replacement algorithm
for the L1D is described in the tlbleed paper. We use a 64K PA-linear
region filled with trapsleds (in case there is L1D->L1I data movement).
The TLBs covering the region are loaded first, because TLB loading
apparently flows through the D cache.  Before performing vmlaunch or
vmresume, the cachelines covering the guest registers are also flushed.
with mlarkin, additional testing by pd, handy comments from the
kettenis and guenther peanuts
sys/arch/amd64/amd64/identcpu.c
sys/arch/amd64/amd64/vmm.c
sys/arch/amd64/amd64/vmm_support.S
sys/arch/amd64/include/cpu.h
sys/arch/amd64/include/specialreg.h
sys/arch/amd64/include/vmmvar.h