kernel - Probable fix to vm_fault: PG_BUSY panic on i386
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 10 Oct 2012 21:47:57 +0000 (14:47 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 10 Oct 2012 21:47:57 +0000 (14:47 -0700)
* The info structure for the pmap_inval*() API is only initialized
  conditionally as an optimization.

* There was a case where the info structure was being used without
  first being initialized which matches reported panics (essentially
  a pipe buffer page in kernel memory is swapped out and the faulted back
  in during a uiomove).

Reported-by: vsrinivas, marino, several others
sys/platform/pc32/i386/pmap.c

index fcd60c3..ec7454d 100644 (file)
@@ -2354,6 +2354,10 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
        while (opa) {
                KKASSERT((origpte & PG_FRAME) ==
                         (*(vm_offset_t *)pte & PG_FRAME));
+               if (prot & VM_PROT_NOSYNC) {
+                       prot &= ~VM_PROT_NOSYNC;
+                       pmap_inval_init(&info);
+               }
                pmap_remove_pte(pmap, pte, va, &info);
                pte = pmap_pte(pmap, va);
                origpte = *(vm_offset_t *)pte;