From: Richard Henderson <richard.henderson@linaro.org>
To: Valentin Haudiquet <valentin.haudiquet@canonical.com>,
qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, qemu-trivial@nongnu.org,
zhiwei_liu@linux.alibaba.com, dbarboza@ventanamicro.com,
liwei1518@gmail.com, alistair.francis@wdc.com,
palmer@dabbelt.com, vhaudiquet <vhaudiquet343@hotmail.fr>
Subject: Re: [PATCH] target/riscv: Fix endianness swap on compressed instructions
Date: Mon, 29 Sep 2025 07:41:09 -0700 [thread overview]
Message-ID: <3fb026bf-3b33-4cfa-a20f-8e1d442e7902@linaro.org> (raw)
In-Reply-To: <20250929115543.1648157-1-valentin.haudiquet@canonical.com>
On 9/29/25 04:55, Valentin Haudiquet wrote:
> From: vhaudiquet <vhaudiquet343@hotmail.fr>
>
> Three instructions were not using the endianness swap flag, which resulted in a bug on big-endian architectures.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3131
> Buglink: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2123828
>
> Signed-off-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
> ---
> target/riscv/insn_trans/trans_rvzce.c.inc | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Cc: qemu-stable@nongnu.org
Fixes: e0a3054f18e ("target/riscv: add support for Zcb extension")
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
>
> diff --git a/target/riscv/insn_trans/trans_rvzce.c.inc b/target/riscv/insn_trans/trans_rvzce.c.inc
> index c77c2b927b..dd15af0f54 100644
> --- a/target/riscv/insn_trans/trans_rvzce.c.inc
> +++ b/target/riscv/insn_trans/trans_rvzce.c.inc
> @@ -88,13 +88,13 @@ static bool trans_c_lbu(DisasContext *ctx, arg_c_lbu *a)
> static bool trans_c_lhu(DisasContext *ctx, arg_c_lhu *a)
> {
> REQUIRE_ZCB(ctx);
> - return gen_load(ctx, a, MO_UW);
> + return gen_load(ctx, a, MO_TEUW);
> }
>
> static bool trans_c_lh(DisasContext *ctx, arg_c_lh *a)
> {
> REQUIRE_ZCB(ctx);
> - return gen_load(ctx, a, MO_SW);
> + return gen_load(ctx, a, MO_TESW);
> }
>
> static bool trans_c_sb(DisasContext *ctx, arg_c_sb *a)
> @@ -106,7 +106,7 @@ static bool trans_c_sb(DisasContext *ctx, arg_c_sb *a)
> static bool trans_c_sh(DisasContext *ctx, arg_c_sh *a)
> {
> REQUIRE_ZCB(ctx);
> - return gen_store(ctx, a, MO_UW);
> + return gen_store(ctx, a, MO_TEUW);
> }
>
> #define X_S0 8
next prev parent reply other threads:[~2025-09-29 14:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 11:55 [PATCH] target/riscv: Fix endianness swap on compressed instructions Valentin Haudiquet
2025-09-29 14:04 ` Anton Johansson via
2025-09-29 14:12 ` Daniel Henrique Barboza
2025-09-29 14:37 ` Philippe Mathieu-Daudé
2025-09-29 15:12 ` Anton Johansson via
2025-09-29 15:19 ` Philippe Mathieu-Daudé
2025-09-29 16:14 ` Philippe Mathieu-Daudé
2025-09-30 6:59 ` Heinrich Schuchardt
2025-09-30 7:18 ` Ben Dooks
2025-09-29 14:41 ` Richard Henderson [this message]
2025-10-03 1:06 ` Alistair Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3fb026bf-3b33-4cfa-a20f-8e1d442e7902@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=valentin.haudiquet@canonical.com \
--cc=vhaudiquet343@hotmail.fr \
--cc=zhiwei_liu@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).