From: Chao Liu via <qemu-riscv@nongnu.org>
To: frederic.petrot@univ-grenoble-alpes.fr
Cc: alistair.francis@wdc.com, daniel.barboza@oss.qualcomm.com,
palmer@dabbelt.com, liwei1518@gmail.com,
zhiwei_liu@linux.alibaba.com, qemu-riscv@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2 1/2] target/riscv: Fix sstatus update in rv128
Date: Wed, 19 Aug 2026 19:48:25 +0800 [thread overview]
Message-ID: <aoWYAIx74S25ZEmG@ChaodeMacBook-Pro.local> (raw)
In-Reply-To: <20260819105655.33391-2-frederic.petrot@univ-grenoble-alpes.fr>
On Wed, Aug 19, 2026 at 12:56:54PM +0800, frederic.petrot@univ-grenoble-alpes.fr wrote:
> From: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
>
> The sstatus register assignment was performed before the write
> mask was fully constructed, leading to an incomplete update of
> sstatus fields on the experimental rv128 target.
>
> Move the sstatus write after the mask completion so the full
> write mask is applied correctly.
>
> Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
> Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Chao Liu <chao.liu@processmission.com>
Thanks,
Chao
> ---
> target/riscv/tcg/csr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/tcg/csr.c b/target/riscv/tcg/csr.c
> index ffd751caa5..9cc6297328 100644
> --- a/target/riscv/tcg/csr.c
> +++ b/target/riscv/tcg/csr.c
> @@ -3998,7 +3998,7 @@ static RISCVException read_sstatus_i128(CPURISCVState *env, int csrno,
> Int128 *val)
> {
> uint64_t mask = sstatus_v1_10_mask;
> - uint64_t sstatus = env->mstatus & mask;
> + uint64_t sstatus;
> if (env->xl != MXL_RV32 || env->debugger) {
> mask |= SSTATUS64_UXL;
> }
> @@ -4009,7 +4009,7 @@ static RISCVException read_sstatus_i128(CPURISCVState *env, int csrno,
> if (env_archcpu(env)->cfg.ext_zicfilp) {
> mask |= SSTATUS_SPELP;
> }
> -
> + sstatus = env->mstatus & mask;
> *val = int128_make128(sstatus, add_status_sd(MXL_RV128, sstatus));
> return RISCV_EXCP_NONE;
> }
> --
> 2.43.0
>
WARNING: multiple messages have this Message-ID (diff)
From: Chao Liu via qemu development <qemu-devel@nongnu.org>
To: frederic.petrot@univ-grenoble-alpes.fr
Cc: alistair.francis@wdc.com, daniel.barboza@oss.qualcomm.com,
palmer@dabbelt.com, liwei1518@gmail.com,
zhiwei_liu@linux.alibaba.com, qemu-riscv@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH v2 1/2] target/riscv: Fix sstatus update in rv128
Date: Wed, 19 Aug 2026 19:48:25 +0800 [thread overview]
Message-ID: <aoWYAIx74S25ZEmG@ChaodeMacBook-Pro.local> (raw)
In-Reply-To: <20260819105655.33391-2-frederic.petrot@univ-grenoble-alpes.fr>
On Wed, Aug 19, 2026 at 12:56:54PM +0800, frederic.petrot@univ-grenoble-alpes.fr wrote:
> From: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
>
> The sstatus register assignment was performed before the write
> mask was fully constructed, leading to an incomplete update of
> sstatus fields on the experimental rv128 target.
>
> Move the sstatus write after the mask completion so the full
> write mask is applied correctly.
>
> Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
> Reviewed-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Chao Liu <chao.liu@processmission.com>
Thanks,
Chao
> ---
> target/riscv/tcg/csr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/riscv/tcg/csr.c b/target/riscv/tcg/csr.c
> index ffd751caa5..9cc6297328 100644
> --- a/target/riscv/tcg/csr.c
> +++ b/target/riscv/tcg/csr.c
> @@ -3998,7 +3998,7 @@ static RISCVException read_sstatus_i128(CPURISCVState *env, int csrno,
> Int128 *val)
> {
> uint64_t mask = sstatus_v1_10_mask;
> - uint64_t sstatus = env->mstatus & mask;
> + uint64_t sstatus;
> if (env->xl != MXL_RV32 || env->debugger) {
> mask |= SSTATUS64_UXL;
> }
> @@ -4009,7 +4009,7 @@ static RISCVException read_sstatus_i128(CPURISCVState *env, int csrno,
> if (env_archcpu(env)->cfg.ext_zicfilp) {
> mask |= SSTATUS_SPELP;
> }
> -
> + sstatus = env->mstatus & mask;
> *val = int128_make128(sstatus, add_status_sd(MXL_RV128, sstatus));
> return RISCV_EXCP_NONE;
> }
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-08-19 11:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 10:56 [PATCH 0/2] target/riscv: Handle [ms]status updates for rv128 frederic.petrot
2026-08-19 10:56 ` [PATCH v2 1/2] target/riscv: Fix sstatus update in rv128 frederic.petrot
2026-08-19 11:48 ` Chao Liu via [this message]
2026-08-19 11:48 ` Chao Liu via qemu development
2026-08-19 10:56 ` [PATCH v2 2/2] target/riscv: Allow UXL to be 3 in mstatus on rv128 frederic.petrot
2026-08-19 11:48 ` Chao Liu via
2026-08-19 11:48 ` Chao Liu via qemu development
2026-08-19 11:17 ` [PATCH 0/2] target/riscv: Handle [ms]status updates for rv128 Philippe Mathieu-Daudé
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=aoWYAIx74S25ZEmG@ChaodeMacBook-Pro.local \
--to=qemu-riscv@nongnu.org \
--cc=alistair.francis@wdc.com \
--cc=chao.liu@processmission.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=frederic.petrot@univ-grenoble-alpes.fr \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--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 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.