All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Chou <max.chou@sifive.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org, palmer@dabbelt.com,
	 daniel.barboza@oss.qualcomm.com, Alistair.Francis@wdc.com,
	philmd@oss.qualcomm.com
Subject: Re: [PATCH v3 11/11] tcg/riscv64: Fall back when AUIPC pairs are out of range
Date: Wed, 30 Sep 2026 00:32:52 +0800	[thread overview]
Message-ID: <arvoIoyJ9qBu65Ue@sifive.com> (raw)
In-Reply-To: <20260914000814.785155-12-richard.henderson@linaro.org>

On 2026-09-13 14:08, Richard Henderson wrote:
> From: Max Chou <max.chou@sifive.com>
> 
> tcg_out_movi, tcg_out_call_int, and tcg_out_ldst only check whether a
> PC-relative displacement is signed 32-bit before emitting an AUIPC pair.
> This does not account for rounding the signed 12-bit immediate, which
> can require an unencodable positive 0x80000000 AUIPC contribution.
> 
> Validate the split and emit the pair only when it fits.
> 
> Fixes: dfa8e74f9463 ("tcg/riscv: Add the relocation functions")
> Signed-off-by: Max Chou <max.chou@sifive.com>
> [rth: Drop 'ret' local variables; update tcg_out_ldst too.]
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  tcg/riscv64/tcg-target.c.inc | 54 +++++++++++++++++-------------------
>  1 file changed, 25 insertions(+), 29 deletions(-)
> 

Reviewed-by: Max Chou <max.chou@sifive.com>

Thanks,
rnax


  reply	other threads:[~2026-09-29 16:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  0:08 [PATCH v3 00/11] tcg/riscv64: Fix AUIPC pair range validation Richard Henderson
2026-09-14  0:08 ` [PATCH v3 01/11] tcg/riscv64: Return tcg_insn_unit from insn encoders Richard Henderson
2026-09-28  3:28   ` Alistair Francis
2026-09-29 15:42   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 02/11] tcg/riscv64: Rename sb-type to b-type format Richard Henderson
2026-09-28  3:30   ` Alistair Francis
2026-09-29 15:43   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 03/11] tcg/riscv64: Rename uj-type to j-type format Richard Henderson
2026-09-28  3:30   ` Alistair Francis
2026-09-29 15:44   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 04/11] tcg/riscv64: Use signed type for encoding immediates Richard Henderson
2026-09-28  3:38   ` Alistair Francis
2026-09-29 15:44   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 05/11] tcg/riscv64: Adjust sign of lui immediate in tcg_out_movi Richard Henderson
2026-09-28  3:33   ` Alistair Francis
2026-09-29 15:52   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 06/11] tcg/riscv64: Assert immediate in range for [isu]-type insns Richard Henderson
2026-09-28  3:33   ` Alistair Francis
2026-09-29 15:57   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 07/11] tcg/riscv64: Return success from encode_jimm Richard Henderson
2026-09-29 16:00   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 08/11] tcg/riscv64: Return success from encode_bimm Richard Henderson
2026-09-29 16:01   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 09/11] tcg/riscv64: Fix off-by-one in branch range tests Richard Henderson
2026-09-29 16:26   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 10/11] tcg/riscv64: Validate AUIPC relocation range Richard Henderson
2026-09-29 16:32   ` Max Chou
2026-09-14  0:08 ` [PATCH v3 11/11] tcg/riscv64: Fall back when AUIPC pairs are out of range Richard Henderson
2026-09-29 16:32   ` Max Chou [this message]
2026-09-15  9:47 ` [PATCH v3 00/11] tcg/riscv64: Fix AUIPC pair range validation Max Chou
2026-09-27 17:30 ` Richard Henderson
2026-09-30  3:42   ` Max Chou

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=arvoIoyJ9qBu65Ue@sifive.com \
    --to=max.chou@sifive.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=palmer@dabbelt.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.