From ba3fa38d55326736820df7b1469adc60916e1d2e Mon Sep 17 00:00:00 2001 From: Nicolas Royer Date: Thu, 2 Jul 2020 19:10:28 +0200 Subject: [PATCH] target/riscv: Set TLB entry according to PMP granularity Signed-off-by: Nicolas Royer --- target/riscv/cpu_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 75d2ae3434..9060e17d08 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -783,8 +783,8 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size, } if (ret == TRANSLATE_SUCCESS) { - tlb_set_page(cs, address & TARGET_PAGE_MASK, pa & TARGET_PAGE_MASK, - prot, mmu_idx, TARGET_PAGE_SIZE); + tlb_set_page(cs, address & ~0x3, pa & ~0x3, + prot, mmu_idx, size); return true; } else if (probe) { return false; -- 2.17.1