powerpc/kvm: Fix kvmppc_core_pending_dec
authorPaul Mackerras <paulus@samba.org>
Wed, 11 May 2011 00:38:50 +0000 (00:38 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 20 May 2011 03:43:41 +0000 (13:43 +1000)
The vcpu->arch.pending_exceptions field is a bitfield indexed by
interrupt priority number as returned by kvmppc_book3s_vec2irqprio.
However, kvmppc_core_pending_dec was using an interrupt vector shifted
by 7 as the bit index.  Fix it to use the irqprio value for the
decrementer interrupt instead.  This problem was found by code
inspection.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kvm/book3s.c

index c961de40c676b0d59c230fba9bc99b6d33389cca..0f95b5cce033026ff5e9e02e0357d91c4cdefd7e 100644 (file)
@@ -236,7 +236,7 @@ void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu)
 
 int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu)
 {
-       return test_bit(BOOK3S_INTERRUPT_DECREMENTER >> 7, &vcpu->arch.pending_exceptions);
+       return test_bit(BOOK3S_IRQPRIO_DECREMENTER, &vcpu->arch.pending_exceptions);
 }
 
 void kvmppc_core_dequeue_dec(struct kvm_vcpu *vcpu)