--- kernel/machdep/ppc/pmap.c 2018/04/24 18:26:08 1.1.1.1 +++ kernel/machdep/ppc/pmap.c 2018/04/24 18:32:53 1.1.1.2 @@ -1467,6 +1467,8 @@ pmap_enter( /* if wired status has changed, update stats and change bit */ if (was_wired != wired) { pmap->stats.wired_count += wired ? 1 : -1; + if (wired && pmap->stats.wired_count == 0) + panic("pmap_enter: wired_count"); mp->vm_info.bits.wired = wired; #if DEBUG if (pmdebug & (PDB_WIRED)) @@ -1554,7 +1556,8 @@ pmap_change_wiring( waswired = mp->vm_info.bits.wired; if (wired && !waswired) { mp->vm_info.bits.wired = TRUE; - pmap->stats.wired_count++; + if (++pmap->stats.wired_count == 0) + panic("pmap_change_wiring: wired_count"); } else if (!wired && waswired) { mp->vm_info.bits.wired = FALSE; pmap->stats.wired_count--;