Changeset 10032 in vbox
- Timestamp:
- Jun 30, 2008 5:03:54 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r10026 r10032 1291 1291 /** AMD64 CR3 level index.*/ 1292 1292 #define PGMPOOL_IDX_AMD64_CR3 8 1293 /** Nested paging root.*/ 1294 #define PGMPOOL_IDX_NESTED_ROOT 9 1293 1295 /** The first normal index. */ 1294 #define PGMPOOL_IDX_FIRST 91296 #define PGMPOOL_IDX_FIRST 10 1295 1297 /** The last valid index. (inclusive, 14 bits) */ 1296 1298 #define PGMPOOL_IDX_LAST 0x3fff … … 1387 1389 /** Shw: Root PAE page directory pointer table (legacy, 4 entries). */ 1388 1390 PGMPOOLKIND_ROOT_PDPT, 1391 /** Shw: Root Nested paging table. */ 1392 PGMPOOLKIND_ROOT_NESTED, 1389 1393 1390 1394 /** The last valid entry. */ 1391 PGMPOOLKIND_LAST = PGMPOOLKIND_ROOT_ PDPT1395 PGMPOOLKIND_LAST = PGMPOOLKIND_ROOT_NESTED 1392 1396 } PGMPOOLKIND; 1393 1397 -
trunk/src/VBox/VMM/PGMPool.cpp
r9899 r10032 273 273 pPool->aPages[PGMPOOL_IDX_AMD64_CR3].enmKind = PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4; 274 274 pPool->aPages[PGMPOOL_IDX_AMD64_CR3].idx = PGMPOOL_IDX_AMD64_CR3; 275 276 /* The Shadow AMD64 CR3. */ 277 pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].Core.Key = NIL_RTHCPHYS; 278 pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].GCPhys = NIL_RTGCPHYS; 279 pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].pvPageHC = pVM->pgm.s.pHCNestedRoot; 280 pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].enmKind = PGMPOOLKIND_ROOT_NESTED; 281 pPool->aPages[PGMPOOL_IDX_NESTED_ROOT].idx = PGMPOOL_IDX_NESTED_ROOT; 275 282 276 283 /* -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r10026 r10032 824 824 int rc; 825 825 PGMPOOLKIND enmPdpt, enmPd; 826 827 AssertReturn(pVM->pgm.s.pHCPaePML4 && pVM->pgm.s.pHCShwAmd64CR3, VERR_INTERNAL_ERROR); 828 826 unsigned idxTopLevel; 827 828 AssertReturn(pVM->pgm.s.pHCPaePML4, VERR_INTERNAL_ERROR); 829 829 if (HWACCMIsNestedPagingActive(pVM)) 830 830 { 831 enmPdpt = PGMPOOLKIND_64BIT_PDPT_FOR_PHYS; 832 enmPd = PGMPOOLKIND_64BIT_PD_FOR_PHYS; 831 enmPdpt = PGMPOOLKIND_64BIT_PDPT_FOR_PHYS; 832 enmPd = PGMPOOLKIND_64BIT_PD_FOR_PHYS; 833 idxTopLevel = PGMPOOL_IDX_NESTED_ROOT; 833 834 } 834 835 else 835 836 { 836 enmPdpt = PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT; 837 enmPd = PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD; 837 AssertReturn(pVM->pgm.s.pHCShwAmd64CR3, VERR_INTERNAL_ERROR); 838 839 enmPdpt = PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT; 840 enmPd = PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD; 841 idxTopLevel = pVM->pgm.s.pHCShwAmd64CR3->idx; 838 842 } 839 843 … … 847 851 848 852 Assert(!(pPml4e->u & X86_PML4E_PG_MASK)); 849 rc = pgmPoolAlloc(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, enmPdpt, pVM->pgm.s.pHCShwAmd64CR3->idx, iPml4e, &pShwPage);853 rc = pgmPoolAlloc(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, enmPdpt, idxTopLevel, iPml4e, &pShwPage); 850 854 if (rc == VERR_PGM_POOL_FLUSHED) 851 855 return VINF_PGM_SYNC_CR3; -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r10027 r10032 1117 1117 case PGMPOOLKIND_ROOT_PAE_PD: 1118 1118 case PGMPOOLKIND_ROOT_PDPT: 1119 case PGMPOOLKIND_ROOT_NESTED: 1119 1120 return false; 1120 1121 … … 1330 1331 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1331 1332 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS: 1333 case PGMPOOLKIND_ROOT_NESTED: 1332 1334 break; 1333 1335 default: … … 1379 1381 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1380 1382 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS: 1383 case PGMPOOLKIND_ROOT_NESTED: 1381 1384 /* Nothing to monitor here. */ 1382 1385 return VINF_SUCCESS; … … 1464 1467 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1465 1468 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS: 1469 case PGMPOOLKIND_ROOT_NESTED: 1466 1470 /* Nothing to monitor here. */ 1467 1471 return VINF_SUCCESS; … … 2152 2156 case PGMPOOLKIND_ROOT_PAE_PD: 2153 2157 case PGMPOOLKIND_ROOT_PDPT: 2158 case PGMPOOLKIND_ROOT_NESTED: 2154 2159 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 2155 2160 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: … … 2199 2204 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 2200 2205 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS: 2206 case PGMPOOLKIND_ROOT_NESTED: 2201 2207 /** @todo can we return 0? (nobody is calling this...) */ 2202 2208 AssertFailed(); … … 2520 2526 /* GCPhys >> PAGE_SHIFT is the index here */ 2521 2527 break; 2528 case PGMPOOLKIND_ROOT_NESTED: 2529 Assert(pUser->iUserTable < X86_PG_PAE_ENTRIES); 2530 break; 2531 2522 2532 default: 2523 2533 AssertMsgFailed(("enmKind=%d\n", pUserPage->enmKind)); … … 2544 2554 case PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT: 2545 2555 case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4: 2556 case PGMPOOLKIND_ROOT_NESTED: 2546 2557 u.pau64[pUser->iUserTable] = 0; 2547 2558 break; … … 3260 3271 /* Not root of shadowed pages currently, ignore it. */ 3261 3272 break; 3273 3274 case PGMPOOLKIND_ROOT_NESTED: 3275 ASMMemZero32(u.pau64, PAGE_SIZE); 3276 break; 3262 3277 } 3263 3278 }
Note:
See TracChangeset
for help on using the changeset viewer.