This is a no-op:

  val |= (val & MSECCFG_MLPE);

Doing an IOR with 'val' and a bit from 'val' and storing it in 'val'
does nothing. 'val' is unchanged.

If we analyze the commit that introduced it we might have a hint on what
was the original intent of this line (a bit clear ... maybe).  We're
going to rework mseccfg_csr_write() in the next patch though, so instead
of trying to figure it out we'll just remove it.

Fixes: 4923f672e3d7 ("target/riscv: Introduce elp state and enabling controls 
for zicfilp")
Signed-off-by: Daniel Henrique Barboza <[email protected]>
---
 target/riscv/tcg/pmp.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/target/riscv/tcg/pmp.c b/target/riscv/tcg/pmp.c
index 04df53c234..7b41c628f3 100644
--- a/target/riscv/tcg/pmp.c
+++ b/target/riscv/tcg/pmp.c
@@ -712,11 +712,6 @@ void mseccfg_csr_write(CPURISCVState *env, uint64_t val)
         val &= ~(mask);
     }
 
-    /* M-mode forward cfi to be enabled if cfi extension is implemented */
-    if (env_archcpu(env)->cfg.ext_zicfilp) {
-        val |= (val & MSECCFG_MLPE);
-    }
-
     env->mseccfg = val;
 }
 
-- 
2.43.0


Reply via email to