KVM: x86: unify handling of interrupt window
[deliverable/linux.git] / arch / x86 / kvm / svm.c
index 9a37e487aca0ca283c6aa857a251bfc2691cf5c7..54a86183e5d3cbcb38fd511e2cc809c6727447c5 100644 (file)
@@ -3060,7 +3060,7 @@ static int cr8_write_interception(struct vcpu_svm *svm)
        u8 cr8_prev = kvm_get_cr8(&svm->vcpu);
        /* instruction emulation calls kvm_set_cr8() */
        r = cr_interception(svm);
-       if (irqchip_in_kernel(svm->vcpu.kvm))
+       if (lapic_in_kernel(&svm->vcpu))
                return r;
        if (cr8_prev <= kvm_get_cr8(&svm->vcpu))
                return r;
@@ -3294,24 +3294,11 @@ static int msr_interception(struct vcpu_svm *svm)
 
 static int interrupt_window_interception(struct vcpu_svm *svm)
 {
-       struct kvm_run *kvm_run = svm->vcpu.run;
-
        kvm_make_request(KVM_REQ_EVENT, &svm->vcpu);
        svm_clear_vintr(svm);
        svm->vmcb->control.int_ctl &= ~V_IRQ_MASK;
        mark_dirty(svm->vmcb, VMCB_INTR);
        ++svm->vcpu.stat.irq_window_exits;
-       /*
-        * If the user space waits to inject interrupts, exit as soon as
-        * possible
-        */
-       if (!irqchip_in_kernel(svm->vcpu.kvm) &&
-           kvm_run->request_interrupt_window &&
-           !kvm_cpu_has_interrupt(&svm->vcpu)) {
-               kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN;
-               return 0;
-       }
-
        return 1;
 }
 
This page took 0.029211 seconds and 5 git commands to generate.