diff --git a/qemu/target/riscv/pmp.c b/qemu/target/riscv/pmp.c index 52771042..46bd91a1 100644 --- a/qemu/target/riscv/pmp.c +++ b/qemu/target/riscv/pmp.c @@ -28,6 +28,7 @@ #include "qapi/error.h" #include "cpu.h" #include "qemu-common.h" +#include "exec/exec-all.h" #ifndef CONFIG_USER_ONLY @@ -350,6 +351,9 @@ void pmpcfg_csr_write(CPURISCVState *env, uint32_t reg_index, cfg_val = (val >> 8 * i) & 0xff; pmp_write_cfg(env, (reg_index * 4) + i, cfg_val); } + + /* If PMP permission of any addr has been changed, flush TLB pages. */ + tlb_flush(env_cpu(env)); }