KVM: VMX: Set VMENTER_L1D_FLUSH_NOT_REQUIRED if !X86_BUG_L1TF
authorWaiman Long <longman@redhat.com>
Mon, 26 Aug 2019 19:30:23 +0000 (15:30 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 27 Sep 2019 16:04:18 +0000 (18:04 +0200)
commit19a36d329f5b1e5d3d06f7093de992693d0fdee6
tree2a8e9b48dac78563871a5676b6b3a0e4babf0b56
parent094444204570a5420d9e6ce3d4558877c3487856
KVM: VMX: Set VMENTER_L1D_FLUSH_NOT_REQUIRED if !X86_BUG_L1TF

The l1tf_vmx_mitigation is only set to VMENTER_L1D_FLUSH_NOT_REQUIRED
when the ARCH_CAPABILITIES MSR indicates that L1D flush is not required.
However, if the CPU is not affected by L1TF, l1tf_vmx_mitigation will
still be set to VMENTER_L1D_FLUSH_AUTO. This is certainly not the best
option for a !X86_BUG_L1TF CPU.

So force l1tf_vmx_mitigation to VMENTER_L1D_FLUSH_NOT_REQUIRED to make it
more explicit in case users are checking the vmentry_l1d_flush parameter.

Signed-off-by: Waiman Long <longman@redhat.com>
[Patch rewritten accoring to Borislav Petkov's suggestion. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c