diff options
author | Avi Kivity <avi@qumranet.com> | 2007-10-16 10:23:22 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:53 -0500 |
commit | ab6ef34b906546d85d92dbc3e0fb4e01cce05f62 (patch) | |
tree | 7d6d5211b2e6b1cb0f66fe429e5f1d114017b0c2 /drivers | |
parent | e25e3ed56fce591e09477b0ce043d90f97988f37 (diff) |
KVM: Move apic timer interrupt backlog processing to common code
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/kvm/kvm_main.c | 2 | ||||
-rw-r--r-- | drivers/kvm/svm.c | 1 | ||||
-rw-r--r-- | drivers/kvm/vmx.c | 1 |
3 files changed, 2 insertions, 2 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 5fd2864b7811..4c96817929fd 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -2144,6 +2144,8 @@ again: | |||
2144 | if (unlikely(r)) | 2144 | if (unlikely(r)) |
2145 | goto out; | 2145 | goto out; |
2146 | 2146 | ||
2147 | kvm_inject_pending_timer_irqs(vcpu); | ||
2148 | |||
2147 | preempt_disable(); | 2149 | preempt_disable(); |
2148 | 2150 | ||
2149 | kvm_x86_ops->prepare_guest_switch(vcpu); | 2151 | kvm_x86_ops->prepare_guest_switch(vcpu); |
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 7b21576b62bc..ef068d2dddd7 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -1355,7 +1355,6 @@ static void svm_intr_assist(struct kvm_vcpu *vcpu) | |||
1355 | struct vmcb *vmcb = svm->vmcb; | 1355 | struct vmcb *vmcb = svm->vmcb; |
1356 | int intr_vector = -1; | 1356 | int intr_vector = -1; |
1357 | 1357 | ||
1358 | kvm_inject_pending_timer_irqs(vcpu); | ||
1359 | if ((vmcb->control.exit_int_info & SVM_EVTINJ_VALID) && | 1358 | if ((vmcb->control.exit_int_info & SVM_EVTINJ_VALID) && |
1360 | ((vmcb->control.exit_int_info & SVM_EVTINJ_TYPE_MASK) == 0)) { | 1359 | ((vmcb->control.exit_int_info & SVM_EVTINJ_TYPE_MASK) == 0)) { |
1361 | intr_vector = vmcb->control.exit_int_info & | 1360 | intr_vector = vmcb->control.exit_int_info & |
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 6955580bb69e..9f77ddbeb025 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -2191,7 +2191,6 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu) | |||
2191 | int has_ext_irq, interrupt_window_open; | 2191 | int has_ext_irq, interrupt_window_open; |
2192 | int vector; | 2192 | int vector; |
2193 | 2193 | ||
2194 | kvm_inject_pending_timer_irqs(vcpu); | ||
2195 | update_tpr_threshold(vcpu); | 2194 | update_tpr_threshold(vcpu); |
2196 | 2195 | ||
2197 | has_ext_irq = kvm_cpu_has_interrupt(vcpu); | 2196 | has_ext_irq = kvm_cpu_has_interrupt(vcpu); |