diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2012-07-23 21:37:04 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-08-15 17:47:09 +0200 |
commit | 9abf567d95a4e840df868ca993219175fbef8c22 (patch) | |
tree | 96a17a16305e08c755b883a04d0ad9b12ea321ee /target-s390x/kvm.c | |
parent | 03834e22abafbc8dc4052d46a5ccd6dd135a54a3 (diff) | |
download | qemu-9abf567d95a4e840df868ca993219175fbef8c22.zip qemu-9abf567d95a4e840df868ca993219175fbef8c22.tar.gz qemu-9abf567d95a4e840df868ca993219175fbef8c22.tar.bz2 |
s390: Fix error handling and condition code of service call
Invalid sccb addresses will cause specification or addressing exception.
Lets add those checks. Furthermore, the good case (cc=0) was incorrect
for KVM, we did not set the CC at all. We now use return codes < 0
as program checks and return codes > 0 as condition code values.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x/kvm.c')
-rw-r--r-- | target-s390x/kvm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 47008c2..07edf93 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -273,9 +273,10 @@ static int kvm_sclp_service_call(CPUS390XState *env, struct kvm_run *run, code = env->regs[(ipbh0 & 0xf0) >> 4]; r = sclp_service_call(env, sccb, code); - if (r) { - setcc(env, 3); + if (r < 0) { + enter_pgmcheck(env, -r); } + setcc(env, r); return 0; } |