From 3f3b30e3846f47333dee457b69bfed8a099d7268 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Wed, 1 Nov 2023 14:35:38 +0200 Subject: [PATCH] riscv_addrenv: Fix static page table mapping (paddr instead of vaddr) Connecting the static page tables to each other was done with the page table virtual address (riscv_pgvaddr) when the page table physical address is needed. --- arch/risc-v/src/common/riscv_addrenv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/risc-v/src/common/riscv_addrenv.c b/arch/risc-v/src/common/riscv_addrenv.c index cb49c1a51daf0..f26a5d11c2869 100644 --- a/arch/risc-v/src/common/riscv_addrenv.c +++ b/arch/risc-v/src/common/riscv_addrenv.c @@ -132,9 +132,9 @@ static void map_spgtables(arch_addrenv_t *addrenv, uintptr_t vaddr) for (i = 0; i < (ARCH_SPGTS - 1); i++) { - uintptr_t next = riscv_pgvaddr(addrenv->spgtables[i + 1]); + uintptr_t next = addrenv->spgtables[i + 1]; mmu_ln_setentry(i + 1, prev, next, vaddr, MMU_UPGT_FLAGS); - prev = next; + prev = riscv_pgvaddr(next); } }