From 9abf567d95a4e840df868ca993219175fbef8c22 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Mon, 23 Jul 2012 21:37:04 +0000 Subject: 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 Signed-off-by: Alexander Graf --- target-s390x/kvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'target-s390x/kvm.c') 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; } -- cgit v1.1