[PATCH v2] s390x: sigp: Fix sense running reporting

Janosch Frank posted 1 patch 5 years, 9 months ago
Test FreeBSD passed
Test docker-mingw@fedora passed
Test checkpatch passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200124134818.9981-1-frankja@linux.ibm.com
Maintainers: Richard Henderson <rth@twiddle.net>, Cornelia Huck <cohuck@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>
target/s390x/sigp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH v2] s390x: sigp: Fix sense running reporting
Posted by Janosch Frank 5 years, 9 months ago
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>
---

Switched the actions instead of the condition so the comment still
applies.

---
 target/s390x/sigp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c
index 727875bb4a..c604f17710 100644
--- a/target/s390x/sigp.c
+++ b/target/s390x/sigp.c
@@ -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;
     }
 }
 
-- 
2.20.1


Re: [PATCH v2] s390x: sigp: Fix sense running reporting
Posted by Cornelia Huck 5 years, 9 months ago
On Fri, 24 Jan 2020 08:48:18 -0500
Janosch Frank <frankja@linux.ibm.com> wrote:

> 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>
> ---
> 
> Switched the actions instead of the condition so the comment still
> applies.
> 
> ---
>  target/s390x/sigp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, applied.