summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2008-11-17 14:50:35 +0100
committerAvi Kivity <avi@redhat.com>2008-11-23 14:34:39 +0200
commit3eb77d5116d78cce5b9fa9eb19d012bc636116b6 (patch)
tree45d8ef487464702a2b2c12f8edf08c9f79d3caf6
parented313489badef16d700f5a3be50e8fd8f8294bc8 (diff)
downloadop-kernel-dev-3eb77d5116d78cce5b9fa9eb19d012bc636116b6.zip
op-kernel-dev-3eb77d5116d78cce5b9fa9eb19d012bc636116b6.tar.gz
KVM: s390: Fix problem state handling in guest sigp handler
We can get an exit for instructions starting with 0xae, even if the guest is in userspace. Lets make sure, that the signal processor handler is only called in guest supervisor mode. Otherwise, send a program check. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/s390/kvm/sigp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 1703926..2a01b9e 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -237,6 +237,11 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
u8 order_code;
int rc;
+ /* sigp in userspace can exit */
+ if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
+ return kvm_s390_inject_program_int(vcpu,
+ PGM_PRIVILEGED_OPERATION);
+
order_code = disp2;
if (base2)
order_code += vcpu->arch.guest_gprs[base2];
OpenPOWER on IntegriCloud