diff options
-rw-r--r-- | arch/x86/kvm/vmx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9d3f972aa19c..28c72da93a1b 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3582,8 +3582,17 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu) | |||
3582 | struct vcpu_vmx *vmx = to_vmx(vcpu); | 3582 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
3583 | enum emulation_result err = EMULATE_DONE; | 3583 | enum emulation_result err = EMULATE_DONE; |
3584 | int ret = 1; | 3584 | int ret = 1; |
3585 | u32 cpu_exec_ctrl; | ||
3586 | bool intr_window_requested; | ||
3587 | |||
3588 | cpu_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); | ||
3589 | intr_window_requested = cpu_exec_ctrl & CPU_BASED_VIRTUAL_INTR_PENDING; | ||
3585 | 3590 | ||
3586 | while (!guest_state_valid(vcpu)) { | 3591 | while (!guest_state_valid(vcpu)) { |
3592 | if (intr_window_requested | ||
3593 | && (kvm_get_rflags(&vmx->vcpu) & X86_EFLAGS_IF)) | ||
3594 | return handle_interrupt_window(&vmx->vcpu); | ||
3595 | |||
3587 | err = emulate_instruction(vcpu, 0, 0, 0); | 3596 | err = emulate_instruction(vcpu, 0, 0, 0); |
3588 | 3597 | ||
3589 | if (err == EMULATE_DO_MMIO) { | 3598 | if (err == EMULATE_DO_MMIO) { |