From 689f73d8a754bb823280df536c50908110c793aa Mon Sep 17 00:00:00 2001 From: gdamore Date: Thu, 30 Mar 2006 05:57:01 +0000 Subject: [PATCH] Don't pmap_remove_pv mappings for unmanaged pages. Closes PR mips/33166. Reviewed by chuq@ --- sys/arch/mips/mips/pmap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/arch/mips/mips/pmap.c b/sys/arch/mips/mips/pmap.c index 4c81c0ebdd29..444bb48d5b92 100644 --- a/sys/arch/mips/mips/pmap.c +++ b/sys/arch/mips/mips/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.166 2005/12/24 20:07:19 perry Exp $ */ +/* $NetBSD: pmap.c,v 1.167 2006/03/30 05:57:01 gdamore Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.166 2005/12/24 20:07:19 perry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.167 2006/03/30 05:57:01 gdamore Exp $"); /* * Manages physical address maps. @@ -730,7 +730,8 @@ pmap_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva) pmap->pm_stats.wired_count--; pmap->pm_stats.resident_count--; pg = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(entry)); - pmap_remove_pv(pmap, sva, pg); + if (pg) + pmap_remove_pv(pmap, sva, pg); if (MIPS_HAS_R4K_MMU) /* See above about G bit */ pte->pt_entry = MIPS3_PG_NV | MIPS3_PG_G; @@ -789,7 +790,8 @@ pmap_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva) pmap->pm_stats.wired_count--; pmap->pm_stats.resident_count--; pg = PHYS_TO_VM_PAGE(mips_tlbpfn_to_paddr(entry)); - pmap_remove_pv(pmap, sva, pg); + if (pg) + pmap_remove_pv(pmap, sva, pg); pte->pt_entry = mips_pg_nv_bit(); /* * Flush the TLB for the given address.