From: Thomas Huth <th...@linux.vnet.ibm.com>

In the SCLP handler function, the condition code register must
only be set if no exception occured.

Signed-off-by: Thomas Huth <th...@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.h...@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntrae...@de.ibm.com>
---
 target-s390x/kvm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index e7b3b13..d3f0d4a 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -451,8 +451,9 @@ static int kvm_sclp_service_call(S390CPU *cpu, struct 
kvm_run *run,
     r = sclp_service_call(env, sccb, code);
     if (r < 0) {
         enter_pgmcheck(cpu, -r);
+    } else {
+        setcc(cpu, r);
     }
-    setcc(cpu, r);
 
     return 0;
 }
-- 
1.8.4.2


Reply via email to