Description
In OpenXiangShan NEMU, when Smstateen is enabled, clearing mstateen0.ENVCFG does not correctly restrict access to henvcfg and senvcfg. As a result, less-privileged code may read or write these CSRs without the required exception, potentially bypassing intended state-enable based isolation controls in virtualized or multi-privilege environments.
References
github.com/OpenXiangShan/NEMU/issues/690
github.com/OpenXiangShan/NEMU/issues/690
github.com/OpenXiangShan/XiangShan/pull/3978
docs.riscv.org/reference/isa/priv/smstateen.html