KVM: VMX: Dump VMCS on unexpected #VE
authorSean Christopherson <seanjc@google.com>
Sat, 18 May 2024 00:04:26 +0000 (17:04 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 May 2024 16:28:04 +0000 (12:28 -0400)
Dump the VMCS on an unexpected #VE, otherwise it's practically impossible
to figure out why the #VE occurred.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240518000430.1118488-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c

index 069fbbc1e04a0077b150b0c694693dd3e5e371d3..a02b2720023a3fb58a3e978be9023432e0dc8503 100644 (file)
@@ -5217,8 +5217,10 @@ static int handle_exception_nmi(struct kvm_vcpu *vcpu)
        if (is_invalid_opcode(intr_info))
                return handle_ud(vcpu);
 
-       if (WARN_ON_ONCE(is_ve_fault(intr_info)))
+       if (WARN_ON_ONCE(is_ve_fault(intr_info))) {
+               dump_vmcs(vcpu);
                return 1;
+       }
 
        error_code = 0;
        if (intr_info & INTR_INFO_DELIVER_CODE_MASK)