svn commit: r252407 - in projects/bhyve_npt_pmap/sys/amd64: amd64 include
Neel Natu
neel at FreeBSD.org
Sun Jun 30 06:44:32 UTC 2013
Author: neel
Date: Sun Jun 30 06:44:31 2013
New Revision: 252407
URL: http://svnweb.freebsd.org/changeset/base/252407
Log:
Replace the bits 'PG_PTE_PAT | PG_NC_PCD | PG_NC_PWT' with 'PG_PTE_CACHE'
in the macro 'PG_PTE_PROMOTE'
By initializing 'PG_PTE_CACHE' at runtime we can now test the correct bits
for page promotion for regular as well as nested page tables.
Modified:
projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c
projects/bhyve_npt_pmap/sys/amd64/include/pmap.h
Modified: projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c Sun Jun 30 06:05:32 2013 (r252406)
+++ projects/bhyve_npt_pmap/sys/amd64/amd64/pmap.c Sun Jun 30 06:44:31 2013 (r252407)
@@ -2989,10 +2989,12 @@ pmap_demote_pde_locked(pmap_t pmap, pd_e
pt_entry_t *firstpte, newpte, PG_G, PG_A, PG_M;
vm_paddr_t mptepa;
vm_page_t free, mpte;
+ int PG_PTE_CACHE;
PG_G = pmap_global_bit(pmap);
PG_A = pmap_accessed_bit(pmap);
PG_M = pmap_modified_bit(pmap);
+ PG_PTE_CACHE = pmap_cache_mask(pmap, 0);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
oldpde = *pde;
@@ -3647,10 +3649,12 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t
pt_entry_t *firstpte, oldpte, pa, *pte, PG_G, PG_A, PG_M;
vm_offset_t oldpteva;
vm_page_t mpte;
+ int PG_PTE_CACHE;
PG_G = pmap_global_bit(pmap);
PG_A = pmap_accessed_bit(pmap);
PG_M = pmap_modified_bit(pmap);
+ PG_PTE_CACHE = pmap_cache_mask(pmap, 0);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
Modified: projects/bhyve_npt_pmap/sys/amd64/include/pmap.h
==============================================================================
--- projects/bhyve_npt_pmap/sys/amd64/include/pmap.h Sun Jun 30 06:05:32 2013 (r252406)
+++ projects/bhyve_npt_pmap/sys/amd64/include/pmap.h Sun Jun 30 06:44:31 2013 (r252407)
@@ -87,8 +87,8 @@
* Promotion to a 2MB (PDE) page mapping requires that the corresponding 4KB
* (PTE) page mappings have identical settings for the following fields:
*/
-#define PG_PTE_PROMOTE (PG_NX | PG_MANAGED | PG_W | PG_G | PG_PTE_PAT | \
- PG_M | PG_A | PG_NC_PCD | PG_NC_PWT | PG_U | PG_RW | PG_V)
+#define PG_PTE_PROMOTE (PG_NX | PG_MANAGED | PG_W | PG_G | PG_PTE_CACHE | \
+ PG_M | PG_A | PG_U | PG_RW | PG_V)
/*
* Page Protection Exception bits
More information about the svn-src-projects
mailing list