svn commit: r252865 - projects/bhyve_npt_pmap/sys/amd64/amd64

Neel Natu neel at FreeBSD.org
Sat Jul 6 06:24:21 UTC 2013


Author: neel
Date: Sat Jul  6 06:24:19 2013
New Revision: 252865
URL: http://svnweb.freebsd.org/changeset/base/252865

Log:
  Since 'pm_pml4' is always a direct mapped address use DMAP_TO_PHYS() to get
  the physical address instead of getting it from recursive page table index.
  
  This allows 'pmap_release()' to work with pmaps that may not have the
  recursive page table index populated (e.g. PT_EPT).

Modified:
  projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c

Modified: projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c	Sat Jul  6 04:46:42 2013	(r252864)
+++ projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c	Sat Jul  6 06:24:19 2013	(r252865)
@@ -2273,7 +2273,7 @@ pmap_release(pmap_t pmap)
 	KASSERT(vm_radix_is_empty(&pmap->pm_root),
 	    ("pmap_release: pmap has reserved page table page(s)"));
 
-	m = PHYS_TO_VM_PAGE(pmap->pm_pml4[PML4PML4I] & PG_FRAME);
+	m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4));
 
 	pmap->pm_pml4[KPML4I] = 0;	/* KVA */
 	for (i = 0; i < NDMPML4E; i++)	/* Direct Map */


More information about the svn-src-projects mailing list