sfence before enabling paging

This commit is contained in:
Robert Morris 2022-08-24 13:42:59 -04:00
parent 29ce3161f8
commit 581bc4cbd1

View file

@ -61,7 +61,12 @@ kvminit(void)
void void
kvminithart() kvminithart()
{ {
// wait for any previous writes to the page table memory to finish.
sfence_vma();
w_satp(MAKE_SATP(kernel_pagetable)); w_satp(MAKE_SATP(kernel_pagetable));
// flush stale entries from the TLB.
sfence_vma(); sfence_vma();
} }