[PATCH 3/5] target/s390x: Improve s390_cpu_dump_state vs cc_op

Richard Henderson posted 5 patches 4 years, 7 months ago
Maintainers: Laurent Vivier <laurent@vivier.eu>, Cornelia Huck <cohuck@redhat.com>, David Hildenbrand <david@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Christian Borntraeger <borntraeger@de.ibm.com>, Halil Pasic <pasic@linux.ibm.com>, Thomas Huth <thuth@redhat.com>
[PATCH 3/5] target/s390x: Improve s390_cpu_dump_state vs cc_op
Posted by Richard Henderson 4 years, 7 months ago
Use s390_cpu_get_psw_mask so that we print the correct
architectural value of psw.mask.  Do not print cc_op
unless tcg_enabled.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/s390x/helper.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/target/s390x/helper.c b/target/s390x/helper.c
index 559fc3573f..1445b74451 100644
--- a/target/s390x/helper.c
+++ b/target/s390x/helper.c
@@ -338,12 +338,14 @@ void s390_cpu_dump_state(CPUState *cs, FILE *f, int flags)
     CPUS390XState *env = &cpu->env;
     int i;
 
-    if (env->cc_op > 3) {
-        qemu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %15s\n",
-                     env->psw.mask, env->psw.addr, cc_name(env->cc_op));
+    qemu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64,
+                 s390_cpu_get_psw_mask(env), env->psw.addr);
+    if (!tcg_enabled()) {
+        qemu_fprintf(f, "\n");
+    } else if (env->cc_op > 3) {
+        qemu_fprintf(f, " cc %15s\n", cc_name(env->cc_op));
     } else {
-        qemu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %02x\n",
-                     env->psw.mask, env->psw.addr, env->cc_op);
+        qemu_fprintf(f, " cc %02x\n", env->cc_op);
     }
 
     for (i = 0; i < 16; i++) {
-- 
2.25.1


Re: [PATCH 3/5] target/s390x: Improve s390_cpu_dump_state vs cc_op
Posted by David Hildenbrand 4 years, 7 months ago
On 15.06.21 05:07, Richard Henderson wrote:
> Use s390_cpu_get_psw_mask so that we print the correct
> architectural value of psw.mask.  Do not print cc_op
> unless tcg_enabled.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/s390x/helper.c | 12 +++++++-----
>   1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/target/s390x/helper.c b/target/s390x/helper.c
> index 559fc3573f..1445b74451 100644
> --- a/target/s390x/helper.c
> +++ b/target/s390x/helper.c
> @@ -338,12 +338,14 @@ void s390_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>       CPUS390XState *env = &cpu->env;
>       int i;
>   
> -    if (env->cc_op > 3) {
> -        qemu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %15s\n",
> -                     env->psw.mask, env->psw.addr, cc_name(env->cc_op));
> +    qemu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64,
> +                 s390_cpu_get_psw_mask(env), env->psw.addr);
> +    if (!tcg_enabled()) {
> +        qemu_fprintf(f, "\n");
> +    } else if (env->cc_op > 3) {
> +        qemu_fprintf(f, " cc %15s\n", cc_name(env->cc_op));
>       } else {
> -        qemu_fprintf(f, "PSW=mask %016" PRIx64 " addr %016" PRIx64 " cc %02x\n",
> -                     env->psw.mask, env->psw.addr, env->cc_op);
> +        qemu_fprintf(f, " cc %02x\n", env->cc_op);
>       }

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 
Thanks,

David / dhildenb