x86/kvm/vmx: Add MDS protection when L1D Flush is not active
authorThomas Gleixner <tglx@linutronix.de>
Wed, 27 Feb 2019 11:48:14 +0000 (12:48 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 6 Mar 2019 20:52:13 +0000 (21:52 +0100)
commit650b68a0622f933444a6d66936abb3103029413b
tree04546d2bf324a808655a05e15cad21aacf779391
parent04dcbdb8057827b043b3c71aa397c4c63e67d086
x86/kvm/vmx: Add MDS protection when L1D Flush is not active

CPUs which are affected by L1TF and MDS mitigate MDS with the L1D Flush on
VMENTER when updated microcode is installed.

If a CPU is not affected by L1TF or if the L1D Flush is not in use, then
MDS mitigation needs to be invoked explicitly.

For these cases, follow the host mitigation state and invoke the MDS
mitigation before VMENTER.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Jon Masters <jcm@redhat.com>
Tested-by: Jon Masters <jcm@redhat.com>
arch/x86/kernel/cpu/bugs.c
arch/x86/kvm/vmx/vmx.c