diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2014-08-05 11:40:47 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-01-23 07:25:34 -0500 |
commit | 9a022067ad75b117f1c1e5cbf6a592022cf0a749 (patch) | |
tree | f73884c87fe971a52c6f6966a20d8be695f13486 /arch/s390/kvm/intercept.c | |
parent | 6cddd432e3da5e25eccbc13844d03c871674a62e (diff) |
KVM: s390: a VCPU may only stop when no interrupts are left pending
As a SIGP STOP is an interrupt with the least priority, it may only result
in stop of the vcpu when no other interrupts are left pending.
To detect whether a non-stop irq is pending, we need a way to mask out
stop irqs from the general kvm_cpu_has_interrupt() function. For this
reason, the existing function (with an outdated name) is replaced by
kvm_s390_vcpu_has_irq() which allows to mask out pending stop irqs.
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/intercept.c')
-rw-r--r-- | arch/s390/kvm/intercept.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index 08e01acc13c3..897669454fb0 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c | |||
@@ -74,6 +74,10 @@ static int handle_stop(struct kvm_vcpu *vcpu) | |||
74 | 74 | ||
75 | vcpu->stat.exit_stop_request++; | 75 | vcpu->stat.exit_stop_request++; |
76 | 76 | ||
77 | /* delay the stop if any non-stop irq is pending */ | ||
78 | if (kvm_s390_vcpu_has_irq(vcpu, 1)) | ||
79 | return 0; | ||
80 | |||
77 | /* avoid races with the injection/SIGP STOP code */ | 81 | /* avoid races with the injection/SIGP STOP code */ |
78 | spin_lock(&li->lock); | 82 | spin_lock(&li->lock); |
79 | flags = li->irq.stop.flags; | 83 | flags = li->irq.stop.flags; |