Subject: (old) vm problem: is this fix good?
To: None <tech-kern@NetBSD.ORG>
From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
List: tech-kern
Date: 02/13/1998 14:51:06
There is a problem which shows up if one debugs a process which has
mmap()ed some device space, ie pages which are not managed by
vm_page*. When accessing inferior's data, the page is faulted in, wired
into the kernel space, read and removed (in procfs_mem.c:procfs_rwmem()).
vm_map_remove() finally calls vm_page_unwire() which panics if
the page is not a managed one.
Can someone reviev this patch and tell if this is appropriate?

best regards
Matthias

Index: vm_fault.c
===================================================================
RCS file: /cvsroot/src/sys/vm/vm_fault.c,v
retrieving revision 1.21
diff -c -2 -r1.21 vm_fault.c
*** vm_fault.c	1998/01/31 04:02:39	1.21
--- vm_fault.c	1998/02/13 13:10:37
***************
*** 922,926 ****
  		}
  		pmap_change_wiring(pmap, va, FALSE);
! 		vm_page_unwire(PHYS_TO_VM_PAGE(pa));
  	}
  	vm_page_unlock_queues();
--- 922,927 ----
  		}
  		pmap_change_wiring(pmap, va, FALSE);
! 		if (IS_VM_PHYSADDR(pa))
! 			vm_page_unwire(PHYS_TO_VM_PAGE(pa));
  	}
  	vm_page_unlock_queues();