aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/interrupt.c
diff options
context:
space:
mode:
authorJens Freimann <jfrei@linux.vnet.ibm.com>2014-12-18 09:48:14 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-01-23 07:25:39 -0500
commit49538d12380fa8970f35db1f063189e49e69399c (patch)
treed0f52d203c2a87c67855d7aa03a15b5690958ab1 /arch/s390/kvm/interrupt.c
parent3cfad02380f761af99770f22c327e5eedfad3934 (diff)
KVM: s390: fix bug in sigp emergency signal injection
Currently we are always setting the wrong bit in the bitmap for pending emergency signals. Instead of using emerg.code from the passed in irq parameter, we use the value in our per-vcpu local_int structure, which is always zero. That means all emergency signals will have address 0 as parameter. If two CPUs send a SIGP to the same target, one might be lost. Let's fix this by using the value from the parameter and also trace the correct value. Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/interrupt.c')
-rw-r--r--arch/s390/kvm/interrupt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 8ebae298a24d..eb5fb66380e3 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -1103,14 +1103,13 @@ static int __inject_sigp_emergency(struct kvm_vcpu *vcpu,
1103 struct kvm_s390_irq *irq) 1103 struct kvm_s390_irq *irq)
1104{ 1104{
1105 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int; 1105 struct kvm_s390_local_interrupt *li = &vcpu->arch.local_int;
1106 struct kvm_s390_emerg_info *emerg = &li->irq.emerg;
1107 1106
1108 VCPU_EVENT(vcpu, 3, "inject: emergency %u\n", 1107 VCPU_EVENT(vcpu, 3, "inject: emergency %u\n",
1109 irq->u.emerg.code); 1108 irq->u.emerg.code);
1110 trace_kvm_s390_inject_vcpu(vcpu->vcpu_id, KVM_S390_INT_EMERGENCY, 1109 trace_kvm_s390_inject_vcpu(vcpu->vcpu_id, KVM_S390_INT_EMERGENCY,
1111 emerg->code, 0, 2); 1110 irq->u.emerg.code, 0, 2);
1112 1111
1113 set_bit(emerg->code, li->sigp_emerg_pending); 1112 set_bit(irq->u.emerg.code, li->sigp_emerg_pending);
1114 set_bit(IRQ_PEND_EXT_EMERGENCY, &li->pending_irqs); 1113 set_bit(IRQ_PEND_EXT_EMERGENCY, &li->pending_irqs);
1115 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags); 1114 atomic_set_mask(CPUSTAT_EXT_INT, li->cpuflags);
1116 return 0; 1115 return 0;