OSDN Git Service

kvm: vmx: Reinstate support for CPUs without virtual NMI
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Nov 2017 12:31:12 +0000 (13:31 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 17 Nov 2017 12:20:07 +0000 (13:20 +0100)
commit8a1b43922d0d1279e7936ba85c4c2a870403c95f
tree91fddc62cba72c3c8ce85460a66d85cee12ab087
parent15038e14724799b8c205beb5f20f9e54896013c3
kvm: vmx: Reinstate support for CPUs without virtual NMI

This is more or less a revert of commit 2c82878b0cb3 ("KVM: VMX: require
virtual NMI support", 2017-03-27); it turns out that Core 2 Duo machines
only had virtual NMIs in some SKUs.

The revert is not trivial because in the meanwhile there have been several
fixes to nested NMI injection.  Therefore, the entire vNMI state is moved
to struct loaded_vmcs.

Another change compared to before the patch is a simplification here:

       if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked &&
           !(is_guest_mode(vcpu) && nested_cpu_has_virtual_nmis(
                                       get_vmcs12(vcpu))))) {

The final condition here is always true (because nested_cpu_has_virtual_nmis
is always false) and is removed.

Fixes: 2c82878b0cb38fd516fd612c67852a6bbf282003
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1490803
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c