target/riscv: Flush TLB when MMWP or MML bits are changed
MMWP and MML bits may affect the allowed privs of PMP entries and the default privs, both of which may change the allowed privs of exsited TLB entries. So we need flush TLB when they are changed. Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20230517091519.34439-8-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
97ec5aef08
commit
37e7905803
@ -578,6 +578,9 @@ void mseccfg_csr_write(CPURISCVState *env, target_ulong val)
|
|||||||
if (riscv_cpu_cfg(env)->epmp) {
|
if (riscv_cpu_cfg(env)->epmp) {
|
||||||
/* Sticky bits */
|
/* Sticky bits */
|
||||||
val |= (env->mseccfg & (MSECCFG_MMWP | MSECCFG_MML));
|
val |= (env->mseccfg & (MSECCFG_MMWP | MSECCFG_MML));
|
||||||
|
if ((val ^ env->mseccfg) & (MSECCFG_MMWP | MSECCFG_MML)) {
|
||||||
|
tlb_flush(env_cpu(env));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
val &= ~(MSECCFG_MMWP | MSECCFG_MML | MSECCFG_RLB);
|
val &= ~(MSECCFG_MMWP | MSECCFG_MML | MSECCFG_RLB);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user