KVM: s390: use atomic bitops to access pending_irqs bitmap
authorJens Freimann <jfrei@linux.vnet.ibm.com>
Mon, 1 Dec 2014 15:43:40 +0000 (16:43 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 4 Dec 2014 15:38:57 +0000 (16:38 +0100)
Currently we use a mixture of atomic/non-atomic bitops
and the local_int spin lock to protect the pending_irqs bitmap
and interrupt payload data.

We need to use atomic bitops for the pending_irqs bitmap everywhere
and in addition acquire the local_int lock where interrupt data needs
to be protected.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/interrupt.c

index 6c0d14b5fec5af3849cc13c3f6b8372424bde722..86bc89a2c6e654cbe48be16d26d8aa5aa952ebec 100644 (file)
@@ -929,7 +929,7 @@ static int __inject_prog(struct kvm_vcpu *vcpu, struct kvm_s390_irq *irq)
        struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
 
        li->irq.pgm = irq->u.pgm;
-       __set_bit(IRQ_PEND_PROG, &li->pending_irqs);
+       set_bit(IRQ_PEND_PROG, &li->pending_irqs);
        return 0;
 }
 
@@ -995,7 +995,7 @@ int __inject_extcall(struct kvm_vcpu *vcpu, struct kvm_s390_irq *irq)
                                   irq->u.extcall.code, 0, 2);
 
        *extcall = irq->u.extcall;
-       __set_bit(IRQ_PEND_EXT_EXTERNAL, &li->pending_irqs);
+       set_bit(IRQ_PEND_EXT_EXTERNAL, &li->pending_irqs);
        atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);
        return 0;
 }