From: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
To: Evgenii Prokopiev <evgenii.prokopiev@syntacore.com>, palmer@dabbelt.com
Cc: alistair.francis@wdc.com, bmeng.cn@gmail.com,
liwei1518@gmail.com, zhiwei_liu@linux.alibaba.com,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] target/riscv/csr.c: Turn off mstatus.vs when misa.v is turned off
Date: Tue, 14 Jan 2025 10:02:21 -0300 [thread overview]
Message-ID: <4326cc98-a280-4a47-9c9d-42709f5b8080@ventanamicro.com> (raw)
In-Reply-To: <20250114092012.29024-1-evgenii.prokopiev@syntacore.com>
On 1/14/25 6:20 AM, Evgenii Prokopiev wrote:
> A behavior of misa.v must be similar as misa.f.
> So when this bit's field is turned off, mstatus.vs must be turned off
> too. It follows from the privileged manual of RISC-V, paragraph 3.1.1.
> "Machine ISA (misa) Register".
>
> Signed-off-by: Evgenii Prokopiev <evgenii.prokopiev@syntacore.com>
> ---
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> target/riscv/csr.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/target/riscv/csr.c b/target/riscv/csr.c
> index eab8e50012..fca2b1b40f 100644
> --- a/target/riscv/csr.c
> +++ b/target/riscv/csr.c
> @@ -1537,6 +1537,10 @@ static RISCVException write_misa(CPURISCVState *env, int csrno,
> env->mstatus &= ~MSTATUS_FS;
> }
>
> + if (!(env->misa_ext & RVV)) {
> + env->mstatus &= ~MSTATUS_VS;
> + }
> +
> /* flush translation cache */
> tb_flush(env_cpu(env));
> env->xl = riscv_cpu_mxl(env);
next prev parent reply other threads:[~2025-01-14 13:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 9:20 [PATCH] target/riscv/csr.c: Turn off mstatus.vs when misa.v is turned off Evgenii Prokopiev
2025-01-14 13:02 ` Daniel Henrique Barboza [this message]
2025-01-29 1:24 ` Alistair Francis
2025-01-29 1:28 ` 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=4326cc98-a280-4a47-9c9d-42709f5b8080@ventanamicro.com \
--to=dbarboza@ventanamicro.com \
--cc=alistair.francis@wdc.com \
--cc=bmeng.cn@gmail.com \
--cc=evgenii.prokopiev@syntacore.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@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.