kernel: fix issue #62 (vunmap bug) reported from http://9fans.net/archive/2011/06/262

This commit is contained in:
cinap_lenrek 2011-06-27 06:47:18 +02:00
parent a5717fb10f
commit 402ee30714

View file

@ -739,16 +739,13 @@ pdbunmap(ulong *pdb, ulong va, int size)
vae = va+size; vae = va+size;
while(va < vae){ while(va < vae){
table = &pdb[PDX(va)]; table = &pdb[PDX(va)];
if(!(*table & PTEVALID)){ if(!(*table & PTEVALID))
panic("vunmap: not mapped"); panic("vunmap: not mapped");
/*
va = (va+4*MB-1) & ~(4*MB-1);
continue;
*/
}
if(*table & PTESIZE){ if(*table & PTESIZE){
if(va & 4*MB-1)
panic("vunmap: misaligned: %#p\n", va);
*table = 0; *table = 0;
va = (va+4*MB-1) & ~(4*MB-1); va += 4*MB;
continue; continue;
} }
table = KADDR(PPN(*table)); table = KADDR(PPN(*table));