Changeset 16203 in vbox
- Timestamp:
- Jan 23, 2009 4:36:23 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
-
PGM.cpp (modified) (1 diff)
-
PGMInternal.h (modified) (11 diffs)
-
PGMMap.cpp (modified) (1 diff)
-
VMMAll/PGMAll.cpp (modified) (13 diffs)
-
VMMAll/PGMAllBth.h (modified) (16 diffs)
-
VMMAll/PGMAllPool.cpp (modified) (24 diffs)
-
testcase/tstVMStructGC.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r16172 r16203 1963 1963 pVM->pgm.s.GCPtrCR3Mapping += offDelta; 1964 1964 /** @todo move this into shadow and guest specific relocation functions. */ 1965 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1966 AssertMsg(pVM->pgm.s.pShwNestedRootR3, ("Init order, no relocation before paging is initialized!\n")); 1967 #else 1965 1968 AssertMsg(pVM->pgm.s.pShw32BitPdR3, ("Init order, no relocation before paging is initialized!\n")); 1969 pVM->pgm.s.pShw32BitPdRC += offDelta; 1970 #endif 1971 pVM->pgm.s.pGst32BitPdRC += offDelta; 1972 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apGstPaePDsRC); i++) 1973 { 1966 1974 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1967 pVM->pgm.s.pShw32BitPdRC += offDelta; 1968 #endif 1969 pVM->pgm.s.pGst32BitPdRC += offDelta; 1970 AssertCompile(RT_ELEMENTS(pVM->pgm.s.apShwPaePDsRC) == RT_ELEMENTS(pVM->pgm.s.apGstPaePDsRC)); 1971 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apShwPaePDsRC); i++) 1972 { 1973 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1975 AssertCompile(RT_ELEMENTS(pVM->pgm.s.apShwPaePDsRC) == RT_ELEMENTS(pVM->pgm.s.apGstPaePDsRC)); 1974 1976 pVM->pgm.s.apShwPaePDsRC[i] += offDelta; 1975 1977 #endif -
trunk/src/VBox/VMM/PGMInternal.h
r16182 r16203 53 53 * @{ 54 54 */ 55 56 /* 57 * Enable to use the PGM pool for all levels in the paging chain in all paging modes. 58 */ 59 //#define VBOX_WITH_PGMPOOL_PAGING_ONLY 55 60 56 61 /** … … 1405 1410 /** The first normal index. */ 1406 1411 #define PGMPOOL_IDX_FIRST_SPECIAL 1 1407 /** Page directory (32-bit root). */1408 #define PGMPOOL_IDX_PD 11409 1412 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1410 1413 /** Page directory (32-bit root). */ … … 1419 1422 #define PGMPOOL_IDX_FIRST 5 1420 1423 #else 1424 /** Page directory (32-bit root). */ 1425 #define PGMPOOL_IDX_PD 1 1421 1426 /** The extended PAE page directory (2048 entries, works as root currently). */ 1422 1427 #define PGMPOOL_IDX_PAE_PD 2 … … 1822 1827 1823 1828 1824 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)1825 DECLINLINE(void *) pgmPoolMapPageInlined(PVM pVM, PPGMPOOLPAGE pPage);1826 #endif1827 1828 1829 /** @def PGMPOOL_PAGE_2_PTR 1829 1830 * Maps a pool page pool into the current context. … … 2234 2235 R0PTRTYPE(void *) pShwRootR0; 2235 2236 # endif 2237 /** The root page table - RC Ptr. */ 2238 RCPTRTYPE(void *) pShwRootRC; 2239 # if HC_ARCH_BITS == 64 2240 uint32_t u32Padding1; /**< alignment padding. */ 2241 # endif 2236 2242 /** The Physical Address (HC) of the current active shadow CR3. */ 2237 2243 RTHCPHYS HCPhysShwCR3; … … 2256 2262 RCPTRTYPE(PX86PD) pShw32BitPdRC; 2257 2263 # if HC_ARCH_BITS == 64 2258 uint32_t u32Padding1 ; /**< alignment padding. */2264 uint32_t u32Padding10; /**< alignment padding. */ 2259 2265 # endif 2260 2266 /** The Physical Address (HC) of the 32-Bit PD. */ … … 2291 2297 RTRCPTR alignment5; /**< structure size alignment. */ 2292 2298 # endif 2293 2299 #endif /* !VBOX_WITH_PGMPOOL_PAGING_ONLY */ 2294 2300 /** @name Nested Shadow Paging 2295 2301 * @{ */ … … 2302 2308 /** The Physical Address (HC) of the nested paging root. */ 2303 2309 RTHCPHYS HCPhysShwNestedRoot; 2304 #endif2305 2310 /** @} */ 2306 2311 … … 2966 2971 2967 2972 2973 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) 2974 /** 2975 * Maps the page into current context (RC and maybe R0). 2976 * 2977 * @returns pointer to the mapping. 2978 * @param pVM Pointer to the PGM instance data. 2979 * @param pPage The page. 2980 */ 2981 DECLINLINE(void *) pgmPoolMapPageInlined(PPGM pPGM, PPGMPOOLPAGE pPage) 2982 { 2983 if (pPage->idx >= PGMPOOL_IDX_FIRST) 2984 { 2985 Assert(pPage->idx < pPGM->CTX_SUFF(pPool)->cCurPages); 2986 void *pv; 2987 # ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 2988 pgmR0DynMapHCPageInlined(pPGM, pPage->Core.Key, &pv); 2989 # else 2990 PGMDynMapHCPage(PGM2VM(pPGM), pPage->Core.Key, &pv); 2991 # endif 2992 return pv; 2993 } 2994 return pgmPoolMapPageFallback(pPGM, pPage); 2995 } 2996 #endif 2997 2968 2998 /** 2969 2999 * Gets the PGMRAMRANGE structure for a guest page. … … 4283 4313 4284 4314 #ifndef IN_RC 4285 4286 4315 /** 4287 4316 * Gets the shadow page map level-4 pointer. … … 4642 4671 #endif /* PGMPOOL_WITH_CACHE */ 4643 4672 4644 4645 #if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)4646 /**4647 * Maps the page into current context (RC and maybe R0).4648 *4649 * @returns pointer to the mapping.4650 * @param pVM Pointer to the PGM instance data.4651 * @param pPage The page.4652 */4653 DECLINLINE(void *) pgmPoolMapPageInlined(PPGM pPGM, PPGMPOOLPAGE pPage)4654 {4655 if (pPage->idx >= PGMPOOL_IDX_FIRST)4656 {4657 Assert(pPage->idx < pPGM->CTX_SUFF(pPool)->cCurPages);4658 void *pv;4659 # ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R04660 pgmR0DynMapHCPageInlined(pPGM, pPage->Core.Key, &pv);4661 # else4662 PGMDynMapHCPage(PGM2VM(pPGM), pPage->Core.Key, &pv);4663 # endif4664 return pv;4665 }4666 return pgmPoolMapPageFallback(pPGM, pPage);4667 }4668 #endif4669 4670 4671 4673 /** 4672 4674 * Tells if mappings are to be put into the shadow page table or not -
trunk/src/VBox/VMM/PGMMap.cpp
r16182 r16203 61 61 { 62 62 LogFlow(("PGMR3MapPT: GCPtr=%#x cb=%d pfnRelocate=%p pvUser=%p pszDesc=%s\n", GCPtr, cb, pfnRelocate, pvUser, pszDesc)); 63 AssertMsg(pVM->pgm.s.pInterPD && pVM->pgm.s.pShw 32BitPdR3, ("Paging isn't initialized, init order problems!\n"));63 AssertMsg(pVM->pgm.s.pInterPD && pVM->pgm.s.pShwNestedRootR3, ("Paging isn't initialized, init order problems!\n")); 64 64 65 65 /* -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r16194 r16203 74 74 DECLINLINE(int) pgmShwSyncPAEPDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPE pGstPdpe, PX86PDPAE *ppPD); 75 75 DECLINLINE(int) pgmShwGetPAEPDPtr(PVM pVM, RTGCPTR GCPtr, PX86PDPT *ppPdpt, PX86PDPAE *ppPD); 76 76 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 77 DECLINLINE(int) pgmShwGetPaePoolPagePD(PPGM pPGM, RTGCPTR GCPtr, PPGMPOOLPAGE *ppShwPde); 78 #endif 77 79 78 80 /* … … 703 705 Assert(!pVM->pgm.s.fMappingsFixed); 704 706 Assert(pVM->pgm.s.GCPhysCR3 == pVM->pgm.s.GCPhysGstCR3Monitored); 707 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 705 708 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, pVM->pgm.s.GCPhysCR3); 709 #endif 706 710 } 707 711 … … 893 897 } 894 898 899 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 900 /** 901 * Gets the pointer to the shadow page directory entry for an address, PAE. 902 * 903 * @returns Pointer to the PDE. 904 * @param pPGM Pointer to the PGM instance data. 905 * @param GCPtr The address. 906 * @param ppShwPde Receives the address of the pgm pool page for the shadow page directory 907 */ 908 DECLINLINE(int) pgmShwGetPaePoolPagePD(PPGM pPGM, RTGCPTR GCPtr, PPGMPOOLPAGE *ppShwPde) 909 { 910 const unsigned iPdPt = (GCPtr >> X86_PDPT_SHIFT) & X86_PDPT_MASK_PAE; 911 PX86PDPT pPdpt = pgmShwGetPaePDPTPtr(pPGM); 912 AssertReturn(pPdpt, VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT); /* can't happen */ 913 if (!pPdpt->a[iPdPt].n.u1Present) 914 return VERR_PAGE_DIRECTORY_PTR_NOT_PRESENT; 915 916 /* Fetch the pgm pool shadow descriptor. */ 917 PPGMPOOLPAGE pShwPde = pgmPoolGetPageByHCPhys(PGM2VM(pPGM), pPdpt->a[iPdPt].u & X86_PDPE_PG_MASK); 918 AssertReturn(pShwPde, VERR_INTERNAL_ERROR); 919 920 *ppShwPde = pShwPde; 921 return VINF_SUCCESS; 922 } 923 #endif 924 895 925 #ifndef IN_RC 896 926 … … 1255 1285 VMMDECL(RTHCPHYS) PGMGetHyperCR3(PVM pVM) 1256 1286 { 1287 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1288 return pVM->pgm.s.HCPhysShwCR3; 1289 #else 1257 1290 PGMMODE enmShadowMode = pVM->pgm.s.enmShadowMode; 1258 1291 switch (enmShadowMode) … … 1279 1312 return ~0; 1280 1313 } 1314 #endif 1281 1315 } 1282 1316 … … 1289 1323 VMMDECL(RTHCPHYS) PGMGetNestedCR3(PVM pVM, PGMMODE enmShadowMode) 1290 1324 { 1325 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1326 return pVM->pgm.s.HCPhysShwCR3; 1327 #else 1291 1328 switch (enmShadowMode) 1292 1329 { … … 1306 1343 return ~0; 1307 1344 } 1345 #endif 1308 1346 } 1309 1347 … … 1327 1365 VMMDECL(RTHCPHYS) PGMGetHyper32BitCR3(PVM pVM) 1328 1366 { 1367 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1368 return pVM->pgm.s.HCPhysShwCR3; 1369 #else 1329 1370 return pVM->pgm.s.HCPhysShw32BitPD; 1371 #endif 1330 1372 } 1331 1373 … … 1338 1380 VMMDECL(RTHCPHYS) PGMGetHyperPaeCR3(PVM pVM) 1339 1381 { 1382 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1383 return pVM->pgm.s.HCPhysShwCR3; 1384 #else 1340 1385 return pVM->pgm.s.HCPhysShwPaePdpt; 1386 #endif 1341 1387 } 1342 1388 … … 1349 1395 VMMDECL(RTHCPHYS) PGMGetHyperAmd64CR3(PVM pVM) 1350 1396 { 1397 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1351 1398 return pVM->pgm.s.HCPhysShwCR3; 1352 } 1353 1399 #else 1400 return pVM->pgm.s.HCPhysShwCR3; 1401 #endif 1402 } 1354 1403 1355 1404 /** … … 1496 1545 { 1497 1546 pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1547 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1498 1548 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, GCPhysCR3); 1549 #endif 1499 1550 } 1500 1551 } … … 1523 1574 pVM->pgm.s.fSyncFlags &= ~PGM_SYNC_MONITOR_CR3; 1524 1575 Assert(!pVM->pgm.s.fMappingsFixed); 1576 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1525 1577 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, GCPhysCR3); 1578 #endif 1526 1579 } 1527 1580 if (fGlobal) … … 1690 1743 Assert(!pVM->pgm.s.fMappingsFixed); 1691 1744 Assert(pVM->pgm.s.GCPhysCR3 == pVM->pgm.s.GCPhysGstCR3Monitored); 1745 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1692 1746 rc = PGM_GST_PFN(MonitorCR3, pVM)(pVM, pVM->pgm.s.GCPhysCR3); 1747 #endif 1693 1748 } 1694 1749 } -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r16177 r16203 893 893 PX86PDE pPdeDst = pgmShwGet32BitPDEPtr(&pVM->pgm.s, GCPtrPage); 894 894 895 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 896 /* Fetch the pgm pool shadow descriptor. */ 897 PPGMPOOLPAGE pShwPde = pVM->pgm.s.CTX_SUFF(pShwPageCR3); 898 Assert(pShwPde); 899 # endif 900 895 901 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 896 902 const unsigned iPdpt = (GCPtrPage >> X86_PDPT_SHIFT); … … 905 911 } 906 912 913 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 914 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK; 915 PPGMPOOLPAGE pShwPde; 916 PX86PDPAE pPDDst; 917 918 /* Fetch the pgm pool shadow descriptor. */ 919 rc = pgmShwGetPaePoolPagePD(&pVM->pgm.s, GCPtrPage, &pShwPde); 920 AssertRCSuccessReturn(rc, rc); 921 Assert(pShwPde); 922 923 pPDDst = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_BY_PGM(&pVM->pgm.s, pShwPde); 924 PX86PDEPAE pPdeDst = &pPDDst->a[iPDDst]; 925 # else 907 926 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) /*& SHW_PD_MASK - pool index only atm! */; 908 927 PX86PDEPAE pPdeDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrPage); 928 # endif 909 929 910 930 # else /* PGM_SHW_TYPE == PGM_TYPE_AMD64 */ … … 1094 1114 # endif /* PGM_GST_TYPE == PGM_TYPE_AMD64 */ 1095 1115 1096 # if PGM_GST_TYPE == PGM_TYPE_PAE 1116 # if PGM_GST_TYPE == PGM_TYPE_PAE && !defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 1097 1117 /* 1098 1118 * Update the shadow PDPE and free all the shadow PD entries if the PDPE is marked not present. … … 1149 1169 LogFlow(("InvalidatePage: Out-of-sync at %RGp PdeSrc=%RX64 PdeDst=%RX64\n", 1150 1170 GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u)); 1151 # if PGM_GST_TYPE == PGM_TYPE_AMD64 1171 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 1152 1172 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1153 1173 # else … … 1165 1185 LogFlow(("InvalidatePage: Out-of-sync (A) at %RGp PdeSrc=%RX64 PdeDst=%RX64\n", 1166 1186 GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u)); 1167 # if PGM_GST_TYPE == PGM_TYPE_AMD64 1187 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 1168 1188 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1169 1189 # else … … 1213 1233 LogFlow(("InvalidatePage: Out-of-sync at %RGp PdeSrc=%RX64 PdeDst=%RX64 ShwGCPhys=%RGp iPDDst=%#x\n", 1214 1234 GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u, pShwPage->GCPhys, iPDDst)); 1215 # if PGM_GST_TYPE == PGM_TYPE_AMD64 1235 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 1216 1236 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1217 1237 # else … … 1259 1279 LogFlow(("InvalidatePage: Out-of-sync PD at %RGp PdeSrc=%RX64 PdeDst=%RX64\n", 1260 1280 GCPtrPage, (uint64_t)PdeSrc.u, (uint64_t)PdeDst.u)); 1261 # if PGM_GST_TYPE == PGM_TYPE_AMD64 1281 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 1262 1282 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1263 1283 # else … … 1276 1296 if (!(PdeDst.u & PGM_PDFLAGS_MAPPING)) 1277 1297 { 1278 # if PGM_GST_TYPE == PGM_TYPE_AMD64 1298 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 1279 1299 pgmPoolFree(pVM, PdeDst.u & SHW_PDE_PG_MASK, pShwPde->idx, iPDDst); 1280 1300 # else … … 1590 1610 PX86PDE pPdeDst = pgmShwGet32BitPDEPtr(&pVM->pgm.s, GCPtrPage); 1591 1611 1612 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1613 /* Fetch the pgm pool shadow descriptor. */ 1614 PPGMPOOLPAGE pShwPde = pVM->pgm.s.CTX_SUFF(pShwPageCR3); 1615 Assert(pShwPde); 1616 # endif 1617 1592 1618 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 1619 1620 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1621 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK; 1622 PPGMPOOLPAGE pShwPde; 1623 PX86PDPAE pPDDst; 1624 1625 /* Fetch the pgm pool shadow descriptor. */ 1626 int rc = pgmShwGetPaePoolPagePD(&pVM->pgm.s, GCPtrPage, &pShwPde); 1627 AssertRCSuccessReturn(rc, rc); 1628 Assert(pShwPde); 1629 1630 pPDDst = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_BY_PGM(&pVM->pgm.s, pShwPde); 1631 PX86PDEPAE pPdeDst = &pPDDst->a[iPDDst]; 1632 # else 1593 1633 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) /*& SHW_PD_MASK - only pool index atm! */; 1594 1634 const unsigned iPdpt = (GCPtrPage >> X86_PDPT_SHIFT); … … 1596 1636 PX86PDEPAE pPdeDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrPage); 1597 1637 AssertReturn(pPdeDst, VERR_INTERNAL_ERROR); 1598 1638 # endif 1599 1639 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64 1600 1640 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK; … … 1827 1867 */ 1828 1868 PPGMPOOL pPool = pVM->pgm.s.CTX_SUFF(pPool); 1829 # if PGM_GST_TYPE == PGM_TYPE_AMD64 1869 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 1830 1870 pgmPoolFreeByPage(pPool, pShwPage, pShwPde->idx, iPDDst); 1831 1871 # else … … 2305 2345 PSHWPDE pPdeDst = pgmShwGet32BitPDEPtr(&pVM->pgm.s, GCPtrPage); 2306 2346 2347 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2348 /* Fetch the pgm pool shadow descriptor. */ 2349 PPGMPOOLPAGE pShwPde = pVM->pgm.s.CTX_SUFF(pShwPageCR3); 2350 Assert(pShwPde); 2351 # endif 2352 2307 2353 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 2354 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2355 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK; 2356 PPGMPOOLPAGE pShwPde; 2357 PX86PDPAE pPDDst; 2358 PSHWPDE pPdeDst; 2359 2360 /* Fetch the pgm pool shadow descriptor. */ 2361 rc = pgmShwGetPaePoolPagePD(&pVM->pgm.s, GCPtrPage, &pShwPde); 2362 AssertRCSuccessReturn(rc, rc); 2363 Assert(pShwPde); 2364 2365 pPDDst = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_BY_PGM(&pVM->pgm.s, pShwPde); 2366 pPdeDst = &pPDDst->a[iPDDst]; 2367 # else 2308 2368 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) /*& SHW_PD_MASK - only pool index atm! */; 2309 2369 const unsigned iPdpt = (GCPtrPage >> X86_PDPT_SHIFT); NOREF(iPdpt); 2310 2370 PX86PDPT pPdptDst = pgmShwGetPaePDPTPtr(&pVM->pgm.s); NOREF(pPdptDst); 2311 2371 PSHWPDE pPdeDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrPage); 2312 2372 # endif 2313 2373 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64 2314 2374 const unsigned iPdpt = (GCPtrPage >> X86_PDPT_SHIFT) & X86_PDPT_MASK_AMD64; … … 2389 2449 GCPhys |= (iPDDst & 1) * (PAGE_SIZE / 2); 2390 2450 # endif 2391 # if PGM_GST_TYPE == PGM_TYPE_AMD64 2451 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 2392 2452 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx, iPDDst, &pShwPage); 2393 2453 # else … … 2402 2462 GCPhys |= GCPtrPage & (1 << X86_PD_PAE_SHIFT); 2403 2463 # endif 2404 # if PGM_GST_TYPE == PGM_TYPE_AMD64 2464 # if PGM_GST_TYPE == PGM_TYPE_AMD64 || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 2405 2465 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_BIG, pShwPde->idx, iPDDst, &pShwPage); 2406 2466 # else … … 2693 2753 PSHWPDE pPdeDst = pgmShwGet32BitPDEPtr(&pVM->pgm.s, GCPtrPage); 2694 2754 2755 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2756 /* Fetch the pgm pool shadow descriptor. */ 2757 PPGMPOOLPAGE pShwPde = pVM->pgm.s.CTX_SUFF(pShwPageCR3); 2758 Assert(pShwPde); 2759 # endif 2760 2695 2761 # elif PGM_SHW_TYPE == PGM_TYPE_PAE 2762 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2763 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) & SHW_PD_MASK; 2764 PPGMPOOLPAGE pShwPde; 2765 PX86PDPAE pPDDst; 2766 PSHWPDE pPdeDst; 2767 2768 /* Fetch the pgm pool shadow descriptor. */ 2769 rc = pgmShwGetPaePoolPagePD(&pVM->pgm.s, GCPtrPage, &pShwPde); 2770 AssertRCSuccessReturn(rc, rc); 2771 Assert(pShwPde); 2772 2773 pPDDst = (PX86PDPAE)PGMPOOL_PAGE_2_PTR_BY_PGM(&pVM->pgm.s, pShwPde); 2774 pPdeDst = &pPDDst->a[iPDDst]; 2775 # else 2696 2776 const unsigned iPDDst = (GCPtrPage >> SHW_PD_SHIFT) /*& SHW_PD_MASK - only pool index atm!*/; 2697 2777 PX86PDEPAE pPdeDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrPage); 2778 # endif 2698 2779 2699 2780 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64 … … 2751 2832 /* Virtual address = physical address */ 2752 2833 GCPhys = GCPtrPage & X86_PAGE_4K_BASE_MASK; 2753 # if PGM_SHW_TYPE == PGM_TYPE_AMD64 || PGM_SHW_TYPE == PGM_TYPE_EPT 2834 # if PGM_SHW_TYPE == PGM_TYPE_AMD64 || PGM_SHW_TYPE == PGM_TYPE_EPT || defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 2754 2835 rc = pgmPoolAlloc(pVM, GCPhys & ~(RT_BIT_64(SHW_PD_SHIFT) - 1), BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx, iPDDst, &pShwPage); 2755 2836 # else -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r15432 r16203 106 106 switch (pPage->idx) 107 107 { 108 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 109 case PGMPOOL_IDX_PD: 110 case PGMPOOL_IDX_PDPT: 111 case PGMPOOL_IDX_AMD64_CR3: 112 return pPGM->pShwRootRC; 113 # else 108 114 case PGMPOOL_IDX_PD: 109 115 return pPGM->pShw32BitPdRC; … … 119 125 case PGMPOOL_IDX_PDPT: 120 126 return pPGM->pShwPaePdptRC; 127 # endif 121 128 default: 122 129 AssertReleaseMsgFailed(("Invalid index %d\n", pPage->idx)); … … 128 135 switch (pPage->idx) 129 136 { 137 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 138 case PGMPOOL_IDX_PD: 139 case PGMPOOL_IDX_PDPT: 140 case PGMPOOL_IDX_AMD64_CR3: 141 HCPhys = pPGM->HCPhysShwCR3; 142 break; 143 144 case PGMPOOL_IDX_NESTED_ROOT: 145 HCPhys = pPGM->HCPhysShwNestedRoot; 146 break; 147 # else 130 148 case PGMPOOL_IDX_PD: 131 149 HCPhys = pPGM->HCPhysShw32BitPD; … … 152 170 AssertReleaseMsgFailed(("PGMPOOL_IDX_PAE_PD is not usable in VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 context\n")); 153 171 return NULL; 172 # endif 154 173 default: 155 174 AssertReleaseMsgFailed(("Invalid index %d\n", pPage->idx)); … … 388 407 } 389 408 409 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 410 case PGMPOOLKIND_32BIT_PD: 411 # else 390 412 case PGMPOOLKIND_ROOT_32BIT_PD: 413 # endif 391 414 { 392 415 uShw.pv = PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pPage); … … 428 451 } 429 452 453 # ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 430 454 case PGMPOOLKIND_ROOT_PAE_PD: 431 455 { … … 474 498 break; 475 499 } 500 # endif /* !VBOX_WITH_PGMPOOL_PAGING_ONLY */ 476 501 477 502 case PGMPOOLKIND_PAE_PD_FOR_PAE_PD: … … 536 561 } 537 562 563 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 564 case PGMPOOLKIND_PAE_PDPT: 565 # else 538 566 case PGMPOOLKIND_ROOT_PDPT: 567 # endif 539 568 { 540 569 /* … … 1304 1333 * These cannot be flushed, and it's common to reuse the PDs as PTs. 1305 1334 */ 1335 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1306 1336 case PGMPOOLKIND_ROOT_32BIT_PD: 1307 1337 case PGMPOOLKIND_ROOT_PAE_PD: 1308 1338 case PGMPOOLKIND_ROOT_PDPT: 1339 #endif 1309 1340 case PGMPOOLKIND_ROOT_NESTED: 1310 1341 return false; … … 1499 1530 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1500 1531 case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4: 1532 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1533 case PGMPOOLKIND_32BIT_PD: 1534 case PGMPOOLKIND_PAE_PDPT: 1535 #else 1501 1536 case PGMPOOLKIND_ROOT_32BIT_PD: 1502 1537 case PGMPOOLKIND_ROOT_PAE_PD: 1503 1538 case PGMPOOLKIND_ROOT_PDPT: 1539 #endif 1504 1540 { 1505 1541 /* find the head */ … … 1563 1599 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1564 1600 case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4: 1601 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1602 case PGMPOOLKIND_32BIT_PD: 1603 case PGMPOOLKIND_PAE_PDPT: 1604 #else 1565 1605 case PGMPOOLKIND_ROOT_PDPT: 1606 #endif 1566 1607 break; 1567 1608 … … 1580 1621 return VINF_SUCCESS; 1581 1622 1623 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1582 1624 case PGMPOOLKIND_ROOT_32BIT_PD: 1583 1625 case PGMPOOLKIND_ROOT_PAE_PD: 1626 #endif 1584 1627 #ifdef PGMPOOL_WITH_MIXED_PT_CR3 1585 1628 break; … … 1651 1694 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 1652 1695 case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4: 1696 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 1697 case PGMPOOLKIND_32BIT_PD: 1698 case PGMPOOLKIND_PAE_PDPT: 1699 #else 1653 1700 case PGMPOOLKIND_ROOT_PDPT: 1701 #endif 1654 1702 break; 1655 1703 … … 1668 1716 return VINF_SUCCESS; 1669 1717 1718 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 1670 1719 case PGMPOOLKIND_ROOT_32BIT_PD: 1671 1720 case PGMPOOLKIND_ROOT_PAE_PD: 1721 #endif 1672 1722 #ifdef PGMPOOL_WITH_MIXED_PT_CR3 1673 1723 break; … … 2377 2427 case PGMPOOLKIND_32BIT_PT_FOR_PHYS: 2378 2428 case PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB: 2429 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2430 case PGMPOOLKIND_32BIT_PD: 2431 #else 2379 2432 case PGMPOOLKIND_ROOT_32BIT_PD: 2433 #endif 2380 2434 return 4; 2381 2435 … … 2390 2444 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 2391 2445 case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4: 2446 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 2392 2447 case PGMPOOLKIND_ROOT_PAE_PD: 2393 2448 case PGMPOOLKIND_ROOT_PDPT: 2449 #endif 2450 case PGMPOOLKIND_PAE_PDPT: 2394 2451 case PGMPOOLKIND_ROOT_NESTED: 2395 2452 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: … … 2421 2478 case PGMPOOLKIND_32BIT_PT_FOR_32BIT_PT: 2422 2479 case PGMPOOLKIND_32BIT_PT_FOR_32BIT_4MB: 2480 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2481 case PGMPOOLKIND_32BIT_PD: 2482 #else 2423 2483 case PGMPOOLKIND_ROOT_32BIT_PD: 2484 #endif 2424 2485 case PGMPOOLKIND_PAE_PT_FOR_32BIT_PT: 2425 2486 case PGMPOOLKIND_PAE_PT_FOR_32BIT_4MB: … … 2433 2494 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 2434 2495 case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4: 2496 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2497 case PGMPOOLKIND_PAE_PDPT: 2498 #else 2435 2499 case PGMPOOLKIND_ROOT_PAE_PD: 2436 2500 case PGMPOOLKIND_ROOT_PDPT: 2501 #endif 2437 2502 return 8; 2438 2503 … … 2776 2841 switch (pUserPage->enmKind) 2777 2842 { 2843 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2844 case PGMPOOLKIND_32BIT_PD: 2845 # else 2778 2846 case PGMPOOLKIND_ROOT_32BIT_PD: 2847 # endif 2779 2848 Assert(iUserTable < X86_PG_ENTRIES); 2780 2849 Assert(!(u.pau32[iUserTable] & PGM_PDFLAGS_MAPPING)); 2781 2850 break; 2782 # if ndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R02851 # if !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) && !defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 2783 2852 case PGMPOOLKIND_ROOT_PAE_PD: 2784 2853 Assert(iUserTable < 2048 && pUser->iUser == PGMPOOL_IDX_PAE_PD); … … 2786 2855 break; 2787 2856 # endif 2857 # ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2858 case PGMPOOLKIND_PAE_PDPT: 2859 # else 2788 2860 case PGMPOOLKIND_ROOT_PDPT: 2861 # endif 2789 2862 Assert(iUserTable < 4); 2790 2863 Assert(!(u.pau64[iUserTable] & PGM_PLXFLAGS_PERMANENT)); … … 2832 2905 { 2833 2906 /* 32-bit entries */ 2907 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2908 case PGMPOOLKIND_32BIT_PD: 2909 #else 2834 2910 case PGMPOOLKIND_ROOT_32BIT_PD: 2911 #endif 2835 2912 u.pau32[iUserTable] = 0; 2836 2913 break; … … 2844 2921 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 2845 2922 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 2846 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R02923 # if !defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0) && !defined(VBOX_WITH_PGMPOOL_PAGING_ONLY) 2847 2924 case PGMPOOLKIND_ROOT_PAE_PD: 2848 2925 #endif 2926 #ifdef VBOX_WITH_PGMPOOL_PAGING_ONLY 2927 case PGMPOOLKIND_PAE_PDPT: 2928 #else 2849 2929 case PGMPOOLKIND_ROOT_PDPT: 2930 #endif 2850 2931 case PGMPOOLKIND_ROOT_NESTED: 2851 2932 case PGMPOOLKIND_EPT_PDPT_FOR_PHYS: … … 3641 3722 switch (pPage->enmKind) 3642 3723 { 3724 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 3643 3725 case PGMPOOLKIND_ROOT_32BIT_PD: 3644 3726 u.pau64 = (uint64_t *)PGMPOOL_PAGE_2_PTR(pPool->CTX_SUFF(pVM), pPage); … … 3658 3740 /* Not root of shadowed pages currently, ignore it. */ 3659 3741 break; 3742 #endif 3660 3743 3661 3744 case PGMPOOLKIND_ROOT_NESTED: -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r16182 r16203 431 431 GEN_CHECK_OFF(PGM, aGCPhysGstPaePDs); 432 432 GEN_CHECK_OFF(PGM, aGCPhysGstPaePDsMonitored); 433 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 433 434 GEN_CHECK_OFF(PGM, pShw32BitPdR3); 434 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE435 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 435 436 GEN_CHECK_OFF(PGM, pShw32BitPdR0); 436 # endif437 # endif 437 438 GEN_CHECK_OFF(PGM, pShw32BitPdRC); 438 439 GEN_CHECK_OFF(PGM, HCPhysShw32BitPD); 439 440 GEN_CHECK_OFF(PGM, apShwPaePDsR3); 440 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE441 # ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 441 442 GEN_CHECK_OFF(PGM, apShwPaePDsR0); 442 # endif443 # endif 443 444 GEN_CHECK_OFF(PGM, apShwPaePDsRC); 444 445 GEN_CHECK_OFF(PGM, aHCPhysPaePDs); … … 447 448 GEN_CHECK_OFF(PGM, pShwPaePdptRC); 448 449 GEN_CHECK_OFF(PGM, HCPhysShwPaePdpt); 450 #endif 449 451 GEN_CHECK_OFF(PGM, pShwRootR3); 450 452 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE … … 463 465 GEN_CHECK_OFF(PGM, pfnR3GstRelocate); 464 466 GEN_CHECK_OFF(PGM, pfnR3GstExit); 467 #ifndef VBOX_WITH_PGMPOOL_PAGING_ONLY 465 468 GEN_CHECK_OFF(PGM, pfnR3GstMonitorCR3); 466 469 GEN_CHECK_OFF(PGM, pfnR3GstUnmonitorCR3); 470 #endif 467 471 GEN_CHECK_OFF(PGM, pfnR3GstMapCR3); 468 472 GEN_CHECK_OFF(PGM, pfnR3GstUnmapCR3);
Note:
See TracChangeset
for help on using the changeset viewer.

