aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-02-12 12:27:17 -0800
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-02-19 13:01:11 -0800
commit26a9320050305bb131921e3a3f0ace95a53f7877 (patch)
tree2913e837b45ebf41dd6b27b1941ac1fd007b2226 /pk
parent3c0620321d6316aaa5559a97dadeba5547171576 (diff)
downloadpk-26a9320050305bb131921e3a3f0ace95a53f7877.zip
pk-26a9320050305bb131921e3a3f0ace95a53f7877.tar.gz
pk-26a9320050305bb131921e3a3f0ace95a53f7877.tar.bz2
sptbr now holds a PPN, not an address
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()