target/riscv: remove obsolete smstateen check for JVT
A message that is not in the archive (sent off-list or not yet received): [email protected]
Daniel Henrique Barboza
Reviewed-byQuoted 8 lines · Zongmin Zhou
From: Zongmin Zhou <[email protected]>
The RISC-V ISA manual used to (incorrectly) state that the JVT CSR and the cm.jalt/cm.jt instructions are controlled by mstateen0/hstateen0 bit 2. That text was spurious and has been removed from the spec by riscv/riscv-isa-manual PR #2637 (merged 2026-02-05, closing issue #2620).
Quoted 8 lines
Drop the corresponding
smstateen_acc_ok()checks from the Zcmt CSR predicate and thecm_jalt()helper, along with the now unusedSMSTATEEN0_JVTdefinition, so that JVT accesses are no longer incorrectly trapped when stateen0 bit 2 is clear.Reference: https://github.com/riscv/riscv-isa-manual/pull/2637
Signed-off-by Zongmin Zhou <[email protected]>---
Reviewed-by Daniel Henrique Barboza <[email protected]>
Quoted 53 lines
target/riscv/cpu_bits.h | 1 - target/riscv/tcg/csr.c | 7 ------- target/riscv/tcg/zce_helper.c | 7 ------- 3 files changed, 15 deletions(-)target/riscv/cpu_bits.h +0
-1@@ -354,7 +354,6 @@#define SMSTATEEN_MAX_COUNT 4#define SMSTATEEN0_CS (1ULL << 0)#define SMSTATEEN0_FCSR (1ULL << 1) -#define SMSTATEEN0_JVT (1ULL << 2)#define SMSTATEEN0_CTR (1ULL << 54)#define SMSTATEEN0_P1P13 (1ULL << 56)#define SMSTATEEN0_HSCONTXT (1ULL << 57)target/riscv/tcg/csr.c +0
-7@@ -180,13 +180,6 @@ static RISCVException zcmt(CPURISCVState *env, int csrno)return RISCV_EXCP_ILLEGAL_INST ; } -#if !defined(CONFIG_USER_ONLY ) -RISCVException ret =smstateen_acc_ok (env,0 ,SMSTATEEN0_JVT ); -if (ret !=RISCV_EXCP_NONE ) { -return ret; - } -#endif -return RISCV_EXCP_NONE ; }target/riscv/tcg/zce_helper.c +0
-7@@ -28,13 +28,6 @@ target_ulong HELPER(cm_jalt)(CPURISCVState *env, uint32_t index)MemOp endian =mo_endian_env (env);MemOpIdx oi; -#if !defined(CONFIG_USER_ONLY ) -RISCVException ret =smstateen_acc_ok (env,0 ,SMSTATEEN0_JVT ); -if (ret !=RISCV_EXCP_NONE ) { -riscv_raise_exception (env, ret,0 ); - } -#endif -target_ulong target;target_ulong val = env->jvt;int xlen =riscv_cpu_xlen (env);