From dbfec06bf1f8de922ca3af09d14675ef44ada5d2 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 10 May 2020 16:54:42 +0200 Subject: kernel: fix checkpages() and segflush() on SG_PHYSICAL type segments do not touch s->map on SG_PHYSICAL type segments as they do not have a pte map (s->mapsize == 0 && s->map == nil). also remove the SG_PHYSICAL switch in freepte(), this is never reached. --- sys/src/9/port/fault.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sys/src/9/port/fault.c') diff --git a/sys/src/9/port/fault.c b/sys/src/9/port/fault.c index 4b6e12f67..9e499b722 100644 --- a/sys/src/9/port/fault.c +++ b/sys/src/9/port/fault.c @@ -438,14 +438,16 @@ checkpages(void) if((s = *sp) == nil) continue; qlock(s); - for(addr=s->base; addrtop; addr+=BY2PG){ - off = addr - s->base; - if((p = s->map[off/PTEMAPMEM]) == nil) - continue; - pg = p->pages[(off&(PTEMAPMEM-1))/BY2PG]; - if(pagedout(pg)) - continue; - checkmmu(addr, pg->pa); + if(s->mapsize > 0){ + for(addr=s->base; addrtop; addr+=BY2PG){ + off = addr - s->base; + if((p = s->map[off/PTEMAPMEM]) == nil) + continue; + pg = p->pages[(off&(PTEMAPMEM-1))/BY2PG]; + if(pagedout(pg)) + continue; + checkmmu(addr, pg->pa); + } } qunlock(s); } -- cgit v1.2.3