Skip to content

Commit

Permalink
KVM: Move apic timer interrupt backlog processing to common code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avi Kivity committed Jan 30, 2008
1 parent e25e3ed commit ab6ef34
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2144,6 +2144,8 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
if (unlikely(r))
goto out;

kvm_inject_pending_timer_irqs(vcpu);

preempt_disable();

kvm_x86_ops->prepare_guest_switch(vcpu);
Expand Down
1 change: 0 additions & 1 deletion drivers/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down
1 change: 0 additions & 1 deletion drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ab6ef34

Please sign in to comment.