qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Weiwei Li <liweiwei@iscas.ac.cn>
To: Richard Henderson <richard.henderson@linaro.org>,
	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: Sat, 1 Jan 2022 13:55:31 +0800	[thread overview]
Message-ID: <4b38e2e8-f288-f53a-71a6-f34feafb18b4@iscas.ac.cn> (raw)
In-Reply-To: <09ecdc1d-2f51-d5bf-1ecd-9ab6c132fd2e@linaro.org>

Thanks for your comments.

在 2022/1/1 上午3:56, Richard Henderson 写道:
> 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.
Yes, I think so. However, I have a question about MSTATUS_MIE and 
MSTATUS_MPRV, will they be set before cpu reset?
>
>> -    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?
It may  deviate from the original value of mstatus_mask with a positive 
test for RVF.
>
>
> r~



  reply	other threads:[~2022-01-01  5:58 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
2022-01-01  5:55     ` Weiwei Li [this message]
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=4b38e2e8-f288-f53a-71a6-f34feafb18b4@iscas.ac.cn \
    --to=liweiwei@iscas.ac.cn \
    --cc=alistair.francis@wdc.com \
    --cc=ardxwe@gmail.com \
    --cc=bin.meng@windriver.com \
    --cc=lazyparser@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.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).