summaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/interrupt.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2014-10-14 09:44:55 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-01-23 13:25:34 +0100
commita3a9c59a683658d881aa2695be2aa875598f2712 (patch)
tree0447c759dddc09f459a07c73e74db4b099d02b28 /arch/s390/kvm/interrupt.c
parent9a022067ad75b117f1c1e5cbf6a592022cf0a749 (diff)
downloadop-kernel-dev-a3a9c59a683658d881aa2695be2aa875598f2712.zip
op-kernel-dev-a3a9c59a683658d881aa2695be2aa875598f2712.tar.gz
KVM: s390: SIGP SET PREFIX cleanup
This patch cleanes up the the SIGP SET PREFIX code. A SIGP SET PREFIX irq may only be injected if the target vcpu is stopped. Let's move the checking code into the injection code and return -EBUSY if the target vcpu is not stopped. Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com> 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/interrupt.c')
-rw-r--r--arch/s390/kvm/interrupt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index f753c0b..1ba9176 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -1026,6 +1026,9 @@ static int __inject_set_prefix(struct kvm_vcpu *vcpu, struct kvm_s390_irq *irq)
trace_kvm_s390_inject_vcpu(vcpu->vcpu_id, KVM_S390_SIGP_SET_PREFIX,
prefix->address, 0, 2);
+ if (!is_vcpu_stopped(vcpu))
+ return -EBUSY;
+
*prefix = irq->u.prefix;
set_bit(IRQ_PEND_SET_PREFIX, &li->pending_irqs);
return 0;
OpenPOWER on IntegriCloud