]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb2a1bc02db2e1dc77349a8b497916fd3320435dd
tree2a8e9b48dac78563871a5676b6b3a0e4babf0b56
parent1ddc008181a744b02ef159f4912846c688f23953
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