From: Richard Henderson <richard.henderson@linaro.org>
To: Weiwei Li <liweiwei@iscas.ac.cn>,
palmer@dabbelt.com, alistair.francis@wdc.com,
bin.meng@windriver.com, qemu-riscv@nongnu.org,
qemu-devel@nongnu.org
Cc: wangjunqiang@iscas.ac.cn, lazyparser@gmail.com, ardxwe@gmail.com
Subject: Re: [PATCH v2 2/6] target/riscv: hardwire mstatus.FS to zero when enable zfinx
Date: Fri, 31 Dec 2021 11:56:22 -0800 [thread overview]
Message-ID: <09ecdc1d-2f51-d5bf-1ecd-9ab6c132fd2e@linaro.org> (raw)
In-Reply-To: <20211231032337.15579-3-liweiwei@iscas.ac.cn>
On 12/30/21 7:23 PM, Weiwei Li wrote:
> @@ -363,6 +363,10 @@ static void riscv_cpu_reset(DeviceState *dev)
> env->misa_mxl = env->misa_mxl_max;
> env->priv = PRV_M;
> env->mstatus &= ~(MSTATUS_MIE | MSTATUS_MPRV);
> + /* hardwire mstatus.FS to zero when enable zfinx */
> + if (RISCV_CPU(env_cpu(env))->cfg.ext_zfinx) {
> + env->mstatus &= ~MSTATUS_FS;
> + }
This shouldn't be necessary because it should never have been set.
> - uint64_t mstatus_mask = MSTATUS_MXR | MSTATUS_SUM | MSTATUS_FS |
> + uint64_t mstatus_mask = MSTATUS_MXR | MSTATUS_SUM|
> MSTATUS_SPP | MSTATUS_SPIE | MSTATUS_SIE |
> MSTATUS64_UXL | MSTATUS_VS;
> + /* hardwire mstatus.FS to zero when enable zfinx */
> + if (!RISCV_CPU(env_cpu(env))->cfg.ext_zfinx) {
> + mstatus_mask |= MSTATUS_FS;
> + }
I would think it would be more correct to have a positive test for RVF, rather than a
negative test for ZFINX?
r~
next prev parent reply other threads:[~2021-12-31 19:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-31 3:23 [PATCH v2 0/6] support subsets of Float-Point in Integer Registers extensions Weiwei Li
2021-12-31 3:23 ` [PATCH v2 1/6] target/riscv: add cfg properties for zfinx, zdinx and zhinx{min} Weiwei Li
2021-12-31 6:28 ` Bin Meng
2021-12-31 3:23 ` [PATCH v2 2/6] target/riscv: hardwire mstatus.FS to zero when enable zfinx Weiwei Li
2021-12-31 19:56 ` Richard Henderson [this message]
2022-01-01 5:55 ` Weiwei Li
2022-01-01 19:46 ` Richard Henderson
2022-01-02 5:53 ` Weiwei Li
2021-12-31 3:23 ` [PATCH v2 3/6] target/riscv: add support for zfinx Weiwei Li
2021-12-31 20:03 ` Richard Henderson
2021-12-31 20:06 ` Richard Henderson
2022-01-01 6:05 ` Weiwei Li
2022-01-01 19:48 ` Richard Henderson
2022-01-02 5:56 ` Weiwei Li
2021-12-31 3:23 ` [PATCH v2 4/6] target/riscv: add support for zdinx Weiwei Li
2021-12-31 20:07 ` Richard Henderson
2022-01-01 6:06 ` Weiwei Li
2021-12-31 3:23 ` [PATCH v2 5/6] target/riscv: add support for zhinx/zhinxmin Weiwei Li
2021-12-31 20:08 ` Richard Henderson
2021-12-31 3:23 ` [PATCH v2 6/6] target/riscv: expose zfinx, zdinx, zhinx{min} properties Weiwei Li
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=09ecdc1d-2f51-d5bf-1ecd-9ab6c132fd2e@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=ardxwe@gmail.com \
--cc=bin.meng@windriver.com \
--cc=lazyparser@gmail.com \
--cc=liweiwei@iscas.ac.cn \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=wangjunqiang@iscas.ac.cn \
/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).