summaryrefslogtreecommitdiffstats
path: root/target/riscv/csr.c
diff options
context:
space:
mode:
authorLIU Zhiwei2021-12-10 08:55:49 +0100
committerAlistair Francis2021-12-20 05:51:36 +0100
commit61b4b69d122c055fbf6310e629f3f2d1e70c2599 (patch)
tree584be60c06f2456326547d4d0f266b62e57552f7 /target/riscv/csr.c
parenttarget/riscv: Use FIELD_EX32() to extract wd field (diff)
downloadqemu-61b4b69d122c055fbf6310e629f3f2d1e70c2599.tar.gz
qemu-61b4b69d122c055fbf6310e629f3f2d1e70c2599.tar.xz
qemu-61b4b69d122c055fbf6310e629f3f2d1e70c2599.zip
target/riscv: rvv-1.0: add mstatus VS field
Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com> Signed-off-by: Frank Chang <frank.chang@sifive.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20211210075704.23951-4-frank.chang@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'target/riscv/csr.c')
-rw-r--r--target/riscv/csr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 9f41954894..9b5bd5d7b4 100644
--- a/target/riscv/csr.c
+++ b/target/riscv/csr.c
@@ -273,6 +273,7 @@ static RISCVException write_fcsr(CPURISCVState *env, int csrno,
{
#if !defined(CONFIG_USER_ONLY)
env->mstatus |= MSTATUS_FS;
+ env->mstatus |= MSTATUS_VS;
#endif
env->frm = (val & FSR_RD) >> FSR_RD_SHIFT;
if (vs(env, csrno) >= 0) {
@@ -307,6 +308,9 @@ static RISCVException read_vxrm(CPURISCVState *env, int csrno,
static RISCVException write_vxrm(CPURISCVState *env, int csrno,
target_ulong val)
{
+#if !defined(CONFIG_USER_ONLY)
+ env->mstatus |= MSTATUS_VS;
+#endif
env->vxrm = val;
return RISCV_EXCP_NONE;
}
@@ -321,6 +325,9 @@ static RISCVException read_vxsat(CPURISCVState *env, int csrno,
static RISCVException write_vxsat(CPURISCVState *env, int csrno,
target_ulong val)
{
+#if !defined(CONFIG_USER_ONLY)
+ env->mstatus |= MSTATUS_VS;
+#endif
env->vxsat = val;
return RISCV_EXCP_NONE;
}
@@ -335,6 +342,9 @@ static RISCVException read_vstart(CPURISCVState *env, int csrno,
static RISCVException write_vstart(CPURISCVState *env, int csrno,
target_ulong val)
{
+#if !defined(CONFIG_USER_ONLY)
+ env->mstatus |= MSTATUS_VS;
+#endif
env->vstart = val;
return RISCV_EXCP_NONE;
}
@@ -535,7 +545,7 @@ static RISCVException write_mstatus(CPURISCVState *env, int csrno,
mask = MSTATUS_SIE | MSTATUS_SPIE | MSTATUS_MIE | MSTATUS_MPIE |
MSTATUS_SPP | MSTATUS_FS | MSTATUS_MPRV | MSTATUS_SUM |
MSTATUS_MPP | MSTATUS_MXR | MSTATUS_TVM | MSTATUS_TSR |
- MSTATUS_TW;
+ MSTATUS_TW | MSTATUS_VS;
if (riscv_cpu_mxl(env) != MXL_RV32) {
/*