Re: panic upon starting X in recent -CURRENTs (intel driver)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Michiel Boland <michiel@...>
Cc: <alc@...>, <freebsd-current@...>
Date: Tuesday, February 19, 2008 - 9:24 am

On Mon, Feb 18, 2008 at 11:35:31PM +0100, Michiel Boland wrote:
=20
=20
=20

What happen there is that munmap() do the split for the /dev/mem mapping.
This caused the OBJT_DEVICE ref_count to be bumped, and vm_map_entry_delete=
()
called vm_object_page_remove(). The later called pmap_remove_all()
unconditionally.

pmap_remove_all has the KASSERT that fails exactly when supplied
fictitious page. It becomes KASSERT in the rev. 1.106 of i386/pmap.c,
committed 2008/01/08, it was under the PMAP_DIAGNOSTIC before.

Since such page has md.pv_list empty anyway, this KASSERT seems to be
only the statement of intent. The change below would prevent the panic
by not calling pmap_remove_all from vm_object_page_remove for such pages.

Alan, do you have objections ? [Alternative seems to be a removal of the
assertions from all pmap implementations, that also weaken the invariants
for other callers that do skip fictitious pages].

diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 21c0ac6..21ee10d 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1884,7 +1884,8 @@ again:
 		 */
 		if ((wirings =3D p->wire_count) !=3D 0 &&
 		    (wirings =3D pmap_page_wired_mappings(p)) !=3D p->wire_count) {
-			pmap_remove_all(p);
+			if ((p->flags & PG_FICTITIOUS) =3D=3D 0)
+				pmap_remove_all(p);
 			/* Account for removal of managed, wired mappings. */
 			p->wire_count -=3D wirings;
 			if (!clean_only)
@@ -1898,7 +1899,8 @@ again:
 			if (p->valid & p->dirty)
 				continue;
 		}
-		pmap_remove_all(p);
+		if ((p->flags & PG_FICTITIOUS) =3D=3D 0)
+			pmap_remove_all(p);
 		/* Account for removal of managed, wired mappings. */
 		if (wirings !=3D 0)
 			p->wire_count -=3D wirings;
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
panic upon starting X in recent -CURRENTs (intel driver), Michiel Boland, (Fri Feb 1, 11:42 am)
Re: panic upon starting X in recent -CURRENTs (intel driver), Kostik Belousov, (Tue Feb 19, 9:24 am)