aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
Diffstat (limited to 'pk')
-rw-r--r--pk/minit.c2
-rw-r--r--pk/vm.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/pk/minit.c b/pk/minit.c
index 71539fe..2c662b4 100644
--- a/pk/minit.c
+++ b/pk/minit.c
@@ -117,7 +117,7 @@ void init_other_hart()
while (*(pte_t* volatile*)&root_page_table == NULL)
;
mb();
- write_csr(sptbr, root_page_table);
+ write_csr(sptbr, (uintptr_t)root_page_table >> RISCV_PGSHIFT);
boot_other_hart();
}
diff --git a/pk/vm.c b/pk/vm.c
index 4f3523e..3f5cb30 100644
--- a/pk/vm.c
+++ b/pk/vm.c
@@ -123,7 +123,7 @@ static void __maybe_create_root_page_table()
return;
root_page_table = (void*)__page_alloc();
if (have_vm)
- write_csr(sptbr, root_page_table);
+ write_csr(sptbr, (uintptr_t)root_page_table >> RISCV_PGSHIFT);
}
static pte_t* __walk_internal(uintptr_t addr, int create)
@@ -477,7 +477,7 @@ void supervisor_vm_init()
mb();
root_page_table = root_pt;
- write_csr(sptbr, root_pt);
+ write_csr(sptbr, (uintptr_t)root_pt >> RISCV_PGSHIFT);
}
uintptr_t pk_vm_init()