[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 09/13] target/sh4: revert to using cpu_lduw_code to decode
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v1 09/13] target/sh4: revert to using cpu_lduw_code to decode gusa |
Date: |
Thu, 9 Jul 2020 16:42:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 7/9/20 4:13 PM, Alex Bennée wrote:
> 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);
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> }
>
> ld_adr = ld_dst = ld_mop = -1;
>
[PATCH v1 05/13] hw/virtio/pci: include vdev name in registered PCI sections, Alex Bennée, 2020/07/09
[PATCH v1 08/13] plugins: expand the bb plugin to be thread safe and track per-cpu, Alex Bennée, 2020/07/09
[PATCH v1 09/13] target/sh4: revert to using cpu_lduw_code to decode gusa, Alex Bennée, 2020/07/09
[PATCH v1 10/13] tests/plugins: add -Wno-unknown-warning-option to handle -Wpsabi, Alex Bennée, 2020/07/09
[PATCH v1 11/13] tests/docker: fall back more gracefully when pull fails, Alex Bennée, 2020/07/09
[PATCH v1 12/13] tests/docker: update toolchain set in debian-xtensa-cross, Alex Bennée, 2020/07/09