KVM: PPC: Update int_pending also on dequeue
authorAlexander Graf <agraf@suse.de>
Thu, 5 Aug 2010 10:24:40 +0000 (12:24 +0200)
committerAvi Kivity <avi@redhat.com>
Sun, 24 Oct 2010 08:52:14 +0000 (10:52 +0200)
When having a decrementor interrupt pending, the dequeuing happens manually
through an mtdec instruction. This instruction simply calls dequeue on that
interrupt, so the int_pending hint doesn't get updated.

This patch enables updating the int_pending hint also on dequeue, thus
correctly enabling guests to stay in guest contexts more often.

Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s.c

index 02a9cb165d53cff3e8c373fdd3dc6d5c42bbfae2..7adea6320654e9ee539047ac366db933ab4200d1 100644 (file)
@@ -201,6 +201,9 @@ static void kvmppc_book3s_dequeue_irqprio(struct kvm_vcpu *vcpu,
 {
        clear_bit(kvmppc_book3s_vec2irqprio(vec),
                  &vcpu->arch.pending_exceptions);
+
+       if (!vcpu->arch.pending_exceptions)
+               vcpu->arch.shared->int_pending = 0;
 }
 
 void kvmppc_book3s_queue_irqprio(struct kvm_vcpu *vcpu, unsigned int vec)