Message ID | 20190530135135.19715-1-Hesham.Almatary@cl.cam.ac.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [PATCHv4,1/6] RISC-V: Only Check PMP if MMU translation succeeds | expand |
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 41d6db41c3..40fb47e794 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -401,6 +401,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size, " prot %d\n", __func__, address, ret, pa, prot); if (riscv_feature(env, RISCV_FEATURE_PMP) && + (ret == TRANSLATE_SUCCESS) && !pmp_hart_has_privs(env, pa, TARGET_PAGE_SIZE, 1 << access_type)) { ret = TRANSLATE_FAIL; }