]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
KVM: VMX: avoid running vmx_handle_exit_irqoff in case of emulation
authorMaxim Levitsky <mlevitsk@redhat.com>
Thu, 26 Aug 2021 09:57:49 +0000 (12:57 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Sep 2021 10:00:27 +0000 (06:00 -0400)
If we are emulating an invalid guest state, we don't have a correct
exit reason, and thus we shouldn't do anything in this function.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20210826095750.1650467-2-mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 95b5a48c4f2b ("KVM: VMX: Handle NMIs, #MCs and async #PFs in common irqs-disabled fn", 2019-06-18)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c

index fada1055f32500058368806a71df325f9e3d1164..0c2c0d5ae8734b0da27563f5e9f97077b6d6d041 100644 (file)
@@ -6382,6 +6382,9 @@ static void vmx_handle_exit_irqoff(struct kvm_vcpu *vcpu)
 {
        struct vcpu_vmx *vmx = to_vmx(vcpu);
 
+       if (vmx->emulation_required)
+               return;
+
        if (vmx->exit_reason.basic == EXIT_REASON_EXTERNAL_INTERRUPT)
                handle_external_interrupt_irqoff(vcpu);
        else if (vmx->exit_reason.basic == EXIT_REASON_EXCEPTION_NMI)