Message ID | 20250325065043.3263864-7-mjt@tls.msk.ru (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Patch Round-up for stable 9.2.3, freeze on 2025-03-24 (frozen) | expand |
diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 9846770820..c2e39c91b6 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -190,6 +190,11 @@ static RISCVException cfi_ss(CPURISCVState *env, int csrno) return RISCV_EXCP_ILLEGAL_INST; } + /* If ext implemented, M-mode always have access to SSP CSR */ + if (env->priv == PRV_M) { + return RISCV_EXCP_NONE; + } + /* if bcfi not active for current env, access to csr is illegal */ if (!cpu_get_bcfien(env)) { #if !defined(CONFIG_USER_ONLY)