svn commit: r215470 - head/sys/i386/xen

Colin Percival cperciva at FreeBSD.org
Thu Nov 18 21:02:40 UTC 2010


Author: cperciva
Date: Thu Nov 18 21:02:40 2010
New Revision: 215470
URL: http://svn.freebsd.org/changeset/base/215470

Log:
  Don't KASSERT in pmap_release that
    xpmap_ptom(VM_PAGE_TO_PHYS(m)) == (pmap->pm_pdpt[i] & PG_FRAME)
  for i = NPGPTD, since pmap->pm_pdpt[i] is only initialized for
  0 <= i < NPGPTD.
  
  This fixes an inevitable panic with XEN && PAE && INVARIANTS when
  pmap_release is called (e.g., when /sbin/init is launched).

Modified:
  head/sys/i386/xen/pmap.c

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Thu Nov 18 20:46:28 2010	(r215469)
+++ head/sys/i386/xen/pmap.c	Thu Nov 18 21:02:40 2010	(r215470)
@@ -1877,8 +1877,9 @@ pmap_release(pmap_t pmap)
 		/* unpinning L1 and L2 treated the same */
                 xen_pgd_unpin(ma);
 #ifdef PAE
-		KASSERT(xpmap_ptom(VM_PAGE_TO_PHYS(m)) == (pmap->pm_pdpt[i] & PG_FRAME),
-		    ("pmap_release: got wrong ptd page"));
+		if (i < NPGPTD)
+			KASSERT(xpmap_ptom(VM_PAGE_TO_PHYS(m)) == (pmap->pm_pdpt[i] & PG_FRAME),
+			    ("pmap_release: got wrong ptd page"));
 #endif
 		m->wire_count--;
 		atomic_subtract_int(&cnt.v_wire_count, 1);


More information about the svn-src-all mailing list