From a35cd0f861b6ded0811b5c365635e53710d0e157 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 6 Apr 2020 01:28:34 +0200 Subject: 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. --- sys/src/9/pc/mmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/src/9/pc/mmu.c b/sys/src/9/pc/mmu.c index edcf866db..c0b13674a 100644 --- a/sys/src/9/pc/mmu.c +++ b/sys/src/9/pc/mmu.c @@ -524,8 +524,7 @@ mmuwalk(ulong* pdb, ulong va, int level, int create) 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)); -- cgit v1.2.3 From 9e2344a5be97b416c73c81f01913702fd6d2da6c Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 6 Apr 2020 01:29:12 +0200 Subject: pc64: remove rampage() nil check rampage() never returns nil --- sys/src/9/pc64/mmu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/src/9/pc64/mmu.c b/sys/src/9/pc64/mmu.c index 78725b3e4..f7c8bb7e5 100644 --- a/sys/src/9/pc64/mmu.c +++ b/sys/src/9/pc64/mmu.c @@ -299,8 +299,6 @@ ptesplit(uintptr* table, uintptr va) if(pte == nil || (*pte & PTESIZE) == 0 || (va & PGLSZ(1)-1) == 0) return; table = rampage(); - if(table == nil) - panic("ptesplit: out of memory\n"); va &= -PGLSZ(1); pa = *pte & ~PTESIZE; for(off = 0; off < PGLSZ(1); off += PGLSZ(0)) -- cgit v1.2.3