[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 09/13] target/sh4: revert to using cpu_lduw_code to decode gus
From: |
Alex Bennée |
Subject: |
[PATCH v1 09/13] target/sh4: revert to using cpu_lduw_code to decode gusa |
Date: |
Thu, 9 Jul 2020 15:13:23 +0100 |
The translator_ld* functions very much expect us to be decoding one
instruction at a time. Otherwise we will see weirdness such as:
qemu-sh4: warning: plugin_disas: 6 bytes left over
when we use the disas functions. For what SH4 is doing here (scanning
ahead in the instruction stream) this is the right function to use.
Reported-by: Claudio Fontana <cfontana@suse.de>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
target/sh4/translate.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 6192d83e8c66..919da72a0c98 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -1915,9 +1915,13 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State
*env)
goto fail;
}
- /* Read all of the insns for the region. */
+ /*
+ * Read all of the insns for the region. We do this directly with
+ * cpu_lduw_code to avoid confusing the plugins by decoding
+ * multiple instructions.
+ */
for (i = 0; i < max_insns; ++i) {
- insns[i] = translator_lduw(env, pc + i * 2);
+ insns[i] = cpu_lduw_code(env, pc + i * 2);
}
ld_adr = ld_dst = ld_mop = -1;
--
2.20.1
[PATCH v1 11/13] tests/docker: fall back more gracefully when pull fails, Alex Bennée, 2020/07/09