s390x: sigp: Fix sense running reporting
authorJanosch Frank <frankja@linux.ibm.com>
Fri, 24 Jan 2020 13:48:18 +0000 (08:48 -0500)
committerCornelia Huck <cohuck@redhat.com>
Mon, 27 Jan 2020 11:13:10 +0000 (12:13 +0100)
The logic was inverted and reported running if the cpu was stopped.
Let's fix that.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Fixes: d1b468bc8869 ("s390x/tcg: implement SIGP SENSE RUNNING STATUS")
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20200124134818.9981-1-frankja@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
target/s390x/sigp.c

index 727875bb4ab9b6c6f606e4ba8afbf6a2d2834d9f..c604f177100fd85dfcc8ff0ff22fa5d84bdb524b 100644 (file)
@@ -348,9 +348,9 @@ static void sigp_sense_running(S390CPU *dst_cpu, SigpInfo *si)
 
     /* If halted (which includes also STOPPED), it is not running */
     if (CPU(dst_cpu)->halted) {
-        si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
-    } else {
         set_sigp_status(si, SIGP_STAT_NOT_RUNNING);
+    } else {
+        si->cc = SIGP_CC_ORDER_CODE_ACCEPTED;
     }
 }