diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2008-11-17 08:50:35 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-11-23 07:34:39 -0500 |
commit | 3eb77d5116d78cce5b9fa9eb19d012bc636116b6 (patch) | |
tree | 45d8ef487464702a2b2c12f8edf08c9f79d3caf6 | |
parent | ed313489badef16d700f5a3be50e8fd8f8294bc8 (diff) |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c index 170392687ce0..2a01b9e02801 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) | |||
237 | u8 order_code; | 237 | u8 order_code; |
238 | int rc; | 238 | int rc; |
239 | 239 | ||
240 | /* sigp in userspace can exit */ | ||
241 | if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) | ||
242 | return kvm_s390_inject_program_int(vcpu, | ||
243 | PGM_PRIVILEGED_OPERATION); | ||
244 | |||
240 | order_code = disp2; | 245 | order_code = disp2; |
241 | if (base2) | 246 | if (base2) |
242 | order_code += vcpu->arch.guest_gprs[base2]; | 247 | order_code += vcpu->arch.guest_gprs[base2]; |