|
From: | Richard Henderson |
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 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 |
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~
[Prev in Thread] | Current Thread | [Next in Thread] |