diff options
Diffstat (limited to 'target')
-rw-r--r-- | target/riscv/csr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 0f51c7e..f9e2910 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -723,7 +723,9 @@ static int write_satp(CPURISCVState *env, int csrno, target_ulong val) if (env->priv == PRV_S && get_field(env->mstatus, MSTATUS_TVM)) { return -1; } else { - tlb_flush(CPU(riscv_env_get_cpu(env))); + if((val ^ env->satp) & SATP_ASID) { + tlb_flush(CPU(riscv_env_get_cpu(env))); + } env->satp = val; } } |