]> err.no Git - linux-2.6/commitdiff
KVM: Move apic timer interrupt backlog processing to common code
authorAvi Kivity <avi@qumranet.com>
Tue, 16 Oct 2007 14:23:22 +0000 (16:23 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:52:53 +0000 (17:52 +0200)
Beside the obvious goodness of making code more common, this prevents
a livelock with the next patch which moves interrupt injection out of the
critical section.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/kvm_main.c
drivers/kvm/svm.c
drivers/kvm/vmx.c

index 5fd2864b7811429f2cb8c49ea1f4d9938ada95c6..4c96817929fd68e8fec900b3dd216ba5836a54fc 100644 (file)
@@ -2144,6 +2144,8 @@ again:
        if (unlikely(r))
                goto out;
 
+       kvm_inject_pending_timer_irqs(vcpu);
+
        preempt_disable();
 
        kvm_x86_ops->prepare_guest_switch(vcpu);
index 7b21576b62bca45f7b9086286d3aaeeb7d224092..ef068d2dddd75f68da42f2f15f07c1f5c3388777 100644 (file)
@@ -1355,7 +1355,6 @@ static void svm_intr_assist(struct kvm_vcpu *vcpu)
        struct vmcb *vmcb = svm->vmcb;
        int intr_vector = -1;
 
-       kvm_inject_pending_timer_irqs(vcpu);
        if ((vmcb->control.exit_int_info & SVM_EVTINJ_VALID) &&
            ((vmcb->control.exit_int_info & SVM_EVTINJ_TYPE_MASK) == 0)) {
                intr_vector = vmcb->control.exit_int_info &
index 6955580bb69ec53bdd4e267a83a712ceefd938e4..9f77ddbeb025a8482c6b192fec81854242db4550 100644 (file)
@@ -2191,7 +2191,6 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
        int has_ext_irq, interrupt_window_open;
        int vector;
 
-       kvm_inject_pending_timer_irqs(vcpu);
        update_tpr_threshold(vcpu);
 
        has_ext_irq = kvm_cpu_has_interrupt(vcpu);