qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH qemu] s390x: sck: load into a temporary not into in1


From: Nico Boehr
Subject: [PATCH qemu] s390x: sck: load into a temporary not into in1
Date: Tue, 25 Jan 2022 13:29:14 +0100

We previously loaded into in1, but in1 is not filled during
disassembly and hence always zero. This leads to an assertion failure:

  qemu-system-s390x: /home/nrb/qemu/include/tcg/tcg.h:654: temp_idx:
  Assertion `n >= 0 && n < tcg_ctx->nb_temps' failed.`

Instead, load into a temporary and pass that to the helper.

This fixes the SCK test I sent here under TCG:
<https://www.spinics.net/lists/kvm/msg265169.html>

Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
---
 target/s390x/tcg/translate.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index 46dea733571e..dc0baec5a5f4 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -4290,9 +4290,16 @@ static DisasJumpType op_stcke(DisasContext *s, DisasOps 
*o)
 #ifndef CONFIG_USER_ONLY
 static DisasJumpType op_sck(DisasContext *s, DisasOps *o)
 {
-    tcg_gen_qemu_ld_i64(o->in1, o->addr1, get_mem_index(s), MO_TEUQ | 
MO_ALIGN);
-    gen_helper_sck(cc_op, cpu_env, o->in1);
+    TCGv_i64 t1;
+
+    t1 = tcg_temp_new_i64();
+
+    tcg_gen_qemu_ld_i64(t1, o->addr1, get_mem_index(s), MO_TEUQ | MO_ALIGN);
+    gen_helper_sck(cc_op, cpu_env, t1);
     set_cc_static(s);
+
+    tcg_temp_free_i64(t1);
+
     return DISAS_NEXT;
 }
 
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]