From 5c335752c4fb7e472d68b2b2731c3674a10cbd97 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 26 Oct 2021 12:42:01 +0300 Subject: Identified issue with vmem implementation + Sensible mappings should help, discard what I wrote in the previous commit. Nothing works unless I get vmem up and running properly. --- arch/riscv/init/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/riscv/init/init.c') diff --git a/arch/riscv/init/init.c b/arch/riscv/init/init.c index 9b7d371..721712c 100644 --- a/arch/riscv/init/init.c +++ b/arch/riscv/init/init.c @@ -244,8 +244,6 @@ struct vm_branch_t *prepare_vmem() /* map root pte */ map_vmem(branch, (pm_t)branch, ROOT_PTE, VM_R | VM_W | VM_V, MM_KPAGE); - map_vmem(branch, 0x10000000, 0x10000000, VM_R | VM_W | VM_V, MM_KPAGE); - /* TODO: map more stuff? */ return branch; } @@ -276,6 +274,7 @@ void start_vmem(void *fdt, struct vm_branch_t *branch) else csr_write(CSR_SATP, SATP_MODE_Sv48 | pm_to_pnum((pm_t)(branch))); + __asm__ ("sfence.vma" : : : "memory"); /* Sv57 && Sv64 in the future? */ } -- cgit v1.3