KVM: s390: ignore sigp stop overinitiative
authorJens Freimann <jfrei@linux.vnet.ibm.com>
Mon, 6 Feb 2012 09:59:05 +0000 (10:59 +0100)
committerAvi Kivity <avi@redhat.com>
Thu, 8 Mar 2012 12:10:16 +0000 (14:10 +0200)
In __inject_sigp_stop() do nothing when the CPU is already in stopped
state.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/s390/kvm/sigp.c

index c703b1cbb0aa79255dc1e2083fc8feab2021c1a1..f3d5cc2970127c324f1d5263f6b4a88919efb70c 100644 (file)
@@ -160,12 +160,15 @@ static int __inject_sigp_stop(struct kvm_s390_local_interrupt *li, int action)
        inti->type = KVM_S390_SIGP_STOP;
 
        spin_lock_bh(&li->lock);
+       if ((atomic_read(li->cpuflags) & CPUSTAT_STOPPED))
+               goto out;
        list_add_tail(&inti->list, &li->list);
        atomic_set(&li->active, 1);
        atomic_set_mask(CPUSTAT_STOP_INT, li->cpuflags);
        li->action_bits |= action;
        if (waitqueue_active(&li->wq))
                wake_up_interruptible(&li->wq);
+out:
        spin_unlock_bh(&li->lock);
 
        return 0; /* order accepted */