kernel - pmap (64bit) add missing wiring to fix panic
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Oct 2011 22:43:09 +0000 (15:43 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Oct 2011 22:43:09 +0000 (15:43 -0700)
* When entering an unmanaged pte into a user pmap we have to bump the
  wiring count of the parent page table page.

Reported-by: thesjg
sys/platform/pc64/x86_64/pmap.c

index e01e676..ffda71f 100644 (file)
@@ -3166,6 +3166,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
                vm_page_flag_set(m, PG_MAPPED);
                vm_page_spin_unlock(m);
                pa |= PG_MANAGED;
+       } else if (pt_pv && opa == 0) {
+               vm_page_wire_quick(pt_pv->pv_m);
        }
 
        /*
@@ -3212,6 +3214,7 @@ validate:
                if (pte_pv == NULL)
                        atomic_add_long(&pmap->pm_stats.resident_count, 1);
        }
+
        KKASSERT((newpte & PG_MANAGED) == 0 || (m->flags & PG_MAPPED));
        if ((prot & VM_PROT_NOSYNC) == 0)
                pmap_inval_done(&info);