]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/riscv: Drop priv level check in mseccfg predicate()
authorBin Meng <bmeng@tinylab.org>
Tue, 28 Feb 2023 13:45:34 +0000 (21:45 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 2 Mar 2023 00:40:24 +0000 (16:40 -0800)
riscv_csrrw_check() already does the generic privilege level check
hence there is no need to do the specific M-mode access check in
the mseccfg predicate().

With this change debugger can access the mseccfg CSR anytime.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-18-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
target/riscv/csr.c

index 020c3f524fc1a1871b45715960cde866d99a65fb..785f6f4d455fe38a150b0a433bb531888a6b5715 100644 (file)
@@ -451,7 +451,7 @@ static RISCVException pmp(CPURISCVState *env, int csrno)
 
 static RISCVException epmp(CPURISCVState *env, int csrno)
 {
-    if (env->priv == PRV_M && riscv_cpu_cfg(env)->epmp) {
+    if (riscv_cpu_cfg(env)->epmp) {
         return RISCV_EXCP_NONE;
     }