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

Colin Percival cperciva at FreeBSD.org
Fri Nov 19 15:12:19 UTC 2010


Author: cperciva
Date: Fri Nov 19 15:12:19 2010
New Revision: 215525
URL: http://svn.freebsd.org/changeset/base/215525

Log:
  Make pmap_release consistent with pmap_pinit with respect to unpinning
  pages.  The pinning of NPGPTD pages is #if 0ed out in pmap_pinit (I'm
  not quite sure why...) and this commit adds a corresponding #if 0 in
  pmap_release to avoid unpinning those pages.
  
  Some versions of Xen seem to silently ignore requests to unpin pages
  which were never pinned in the first place, but some return an error
  (causing FreeBSD to panic) prior to this commit.

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

Modified: head/sys/i386/xen/pmap.c
==============================================================================
--- head/sys/i386/xen/pmap.c	Fri Nov 19 15:07:36 2010	(r215524)
+++ head/sys/i386/xen/pmap.c	Fri Nov 19 15:12:19 2010	(r215525)
@@ -1875,7 +1875,12 @@ pmap_release(pmap_t pmap)
 		m = ptdpg[i];
 		ma = xpmap_ptom(VM_PAGE_TO_PHYS(m));
 		/* unpinning L1 and L2 treated the same */
+#if 0
                 xen_pgd_unpin(ma);
+#else
+		if (i == NPGPTD)
+	                xen_pgd_unpin(ma);
+#endif
 #ifdef PAE
 		if (i < NPGPTD)
 			KASSERT(xpmap_ptom(VM_PAGE_TO_PHYS(m)) == (pmap->pm_pdpt[i] & PG_FRAME),


More information about the svn-src-head mailing list