Commit 93e1750f authored by Thomas Huth's avatar Thomas Huth Committed by Paolo Bonzini

KVM: s390: Check for PSTATE when handling DIAGNOSE

DIAGNOSE is a privileged instruction and thus we must make sure that we are
in supervisor mode before taking any other actions.
Signed-off-by: default avatarThomas Huth <thuth@linux.vnet.ibm.com>
Acked-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 5087dfa6
...@@ -132,6 +132,9 @@ int kvm_s390_handle_diag(struct kvm_vcpu *vcpu) ...@@ -132,6 +132,9 @@ int kvm_s390_handle_diag(struct kvm_vcpu *vcpu)
{ {
int code = (vcpu->arch.sie_block->ipb & 0xfff0000) >> 16; int code = (vcpu->arch.sie_block->ipb & 0xfff0000) >> 16;
if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
trace_kvm_s390_handle_diag(vcpu, code); trace_kvm_s390_handle_diag(vcpu, code);
switch (code) { switch (code) {
case 0x10: case 0x10:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment