KVM: pit: Do not check pending pit timer in vcpu thread
authorJason Wang <jasowang@redhat.com>
Fri, 27 Aug 2010 09:15:06 +0000 (17:15 +0800)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:51:45 +0000 (10:51 +0200)
Pit interrupt injection was done by workqueue, so no need to check
pending pit timer in vcpu thread which could lead unnecessary
unblocking of vcpu.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/i8254.c
arch/x86/kvm/irq.c

index ddeb2314b522455df6352bd434019030be9a88e5..2ad40a4ddc34ddd40dfac9fb8b60fe1bc27392ba 100644 (file)
@@ -232,15 +232,6 @@ static void pit_latch_status(struct kvm *kvm, int channel)
        }
 }
 
-int pit_has_pending_timer(struct kvm_vcpu *vcpu)
-{
-       struct kvm_pit *pit = vcpu->kvm->arch.vpit;
-
-       if (pit && kvm_vcpu_is_bsp(vcpu) && pit->pit_state.irq_ack)
-               return atomic_read(&pit->pit_state.pit_timer.pending);
-       return 0;
-}
-
 static void kvm_pit_ack_irq(struct kvm_irq_ack_notifier *kian)
 {
        struct kvm_kpit_state *ps = container_of(kian, struct kvm_kpit_state,
index 2095a049835e4916b4bd504688e82a2a6cc3796a..f994da40ad940e97c395e526d2a762981897b14d 100644 (file)
  */
 int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
 {
-       int ret;
-
-       ret = pit_has_pending_timer(vcpu);
-       ret |= apic_has_pending_timer(vcpu);
-
-       return ret;
+       return apic_has_pending_timer(vcpu);
 }
 EXPORT_SYMBOL(kvm_cpu_has_pending_timer);