shithub: riscv

Download patch

ref: 3cc15d2301ae47d6727cf1059ce855f3487bdc56
parent: 20b2f7a38ef20b6ce866c515bc911f8c988b6d79
parent: 7bc8f4d993fce693f664a9bc8361e7b5633ed7df
author: cinap_lenrek <[email protected]>
date: Sat Jun 7 05:28:33 EDT 2014

merge

--- a/sys/src/9/pc64/mmu.c
+++ b/sys/src/9/pc64/mmu.c
@@ -438,10 +438,19 @@
 		invlpg(va);
 }
 
+/*
+ * Double-check the user MMU.
+ * Error checking only.
+ */
 void
 checkmmu(uintptr va, uintptr pa)
 {
-	USED(va, pa);
+	uintptr *pte;
+
+	pte = mmuwalk(m->pml4, va, 0, 0);
+	if(pte != 0 && (*pte & PTEVALID) != 0 && PPN(*pte) != pa)
+		print("%ld %s: va=%#p pa=%#p pte=%#p\n",
+			up->pid, up->text, va, pa, *pte);
 }
 
 uintptr