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>
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 5fd2864..4c96817 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2144,6 +2144,8 @@
if (unlikely(r))
goto out;
+ kvm_inject_pending_timer_irqs(vcpu);
+
preempt_disable();
kvm_x86_ops->prepare_guest_switch(vcpu);