shithub: riscv

Download patch

ref: a35cd0f861b6ded0811b5c365635e53710d0e157
parent: 0ba08200707e5d761cbe39d6b08174f8eb868125
author: cinap_lenrek <[email protected]>
date: Sun Apr 5 21:28:34 EDT 2020

pc: zero rampage() memory (thanks LordCreepity)

memory returned by rampage() is not zeroed, so we have to
zero it ourselfs. apparently, this bug didnt show up as we
where zeroing conventional low memory before the new memory
map code. also rampage() never returns nil.

--- a/sys/src/9/pc/mmu.c
+++ b/sys/src/9/pc/mmu.c
@@ -524,8 +524,7 @@
 			panic("mmuwalk2: va %luX entry %luX", va, *table);
 		if(!(*table & PTEVALID)){
 			map = rampage();
-			if(map == nil)
-				panic("mmuwalk: page alloc failed");
+			memset(map, 0, BY2PG);
 			*table = PADDR(map)|PTEWRITE|PTEVALID;
 		}
 		table = KADDR(PPN(*table));