Skip to content

Commit

Permalink
KVM: s390: Fix problem state handling in guest sigp handler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Borntraeger authored and Avi Kivity committed Nov 23, 2008
1 parent ed31348 commit 3eb77d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/s390/kvm/sigp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 3eb77d5

Please sign in to comment.