From bcff90f20d5c407526e833b406327339cdbc3322 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 11 Oct 2012 14:34:09 -0700 Subject: [PATCH] kernel - Fix i386 pmap bug * mpte will be NULL for KVM page table pages, there is no need to track the wire count. Conditionalize-out the unwiring call. * This is believed to be (this time for sure to the third power!) the PG_BUSY crash that vsrinivas was getting on i386 related to paging in a swapped kernel pipe buffer. --- sys/platform/pc32/i386/pmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/platform/pc32/i386/pmap.c b/sys/platform/pc32/i386/pmap.c index c8da41303a..1381a84ac7 100644 --- a/sys/platform/pc32/i386/pmap.c +++ b/sys/platform/pc32/i386/pmap.c @@ -2422,7 +2422,7 @@ validate: if (*pte) { KKASSERT((*pte & PG_FRAME) == (newpte & PG_FRAME)); - if (vm_page_unwire_quick(mpte)) + if (mpte && vm_page_unwire_quick(mpte)) panic("pmap_enter: Insufficient wire_count"); } @@ -2434,7 +2434,7 @@ validate: } else { if (*pte) { KKASSERT((*pte & PG_FRAME) == (newpte & PG_FRAME)); - if (vm_page_unwire_quick(mpte)) + if (mpte && vm_page_unwire_quick(mpte)) panic("pmap_enter: Insufficient wire_count"); } } -- 2.41.0