KVM: VMX: Stop invalid guest state emulation on pending event

Process the event, possibly injecting an interrupt, before continuing.

Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Avi Kivity 2012-06-12 20:21:38 +03:00
parent 612e89f015
commit de87dcddc7
1 changed files with 3 additions and 0 deletions

View File

@ -4986,6 +4986,9 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu)
if (intr_window_requested && vmx_interrupt_allowed(vcpu)) if (intr_window_requested && vmx_interrupt_allowed(vcpu))
return handle_interrupt_window(&vmx->vcpu); return handle_interrupt_window(&vmx->vcpu);
if (test_bit(KVM_REQ_EVENT, &vcpu->requests))
return 1;
err = emulate_instruction(vcpu, 0); err = emulate_instruction(vcpu, 0);
if (err == EMULATE_DO_MMIO) { if (err == EMULATE_DO_MMIO) {