Changeset 10063 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 1, 2008 9:57:49 AM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r10032 r10063 1380 1380 /** Shw: 64-bit PML4; Gst: 64-bit PML4. */ 1381 1381 PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4, 1382 /** Shw: 64-bit PML4; Gst: no paging */1383 PGMPOOLKIND_64BIT_PML4_FOR_PHYS,1384 1382 1385 1383 /** Shw: Root 32-bit page directory. */ … … 3360 3358 const unsigned iPml4e = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; 3361 3359 3360 Assert(pPGM->pGstPaePML4HC); 3362 3361 *ppPml4e = &pPGM->pGstPaePML4HC->a[iPml4e]; 3363 3362 if ((*ppPml4e)->n.u1Present) … … 3390 3389 const unsigned iPml4e = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; 3391 3390 3391 Assert(pPGM->pGstPaePML4HC); 3392 3392 *ppPml4e = &pPGM->pGstPaePML4HC->a[iPml4e]; 3393 3393 if ((*ppPml4e)->n.u1Present) … … 3432 3432 const unsigned iPml4e = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; 3433 3433 3434 Assert(pPGM->pGstPaePML4HC); 3434 3435 if (pPGM->pGstPaePML4HC->a[iPml4e].n.u1Present) 3435 3436 { … … 3472 3473 const unsigned iPml4e = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; 3473 3474 3475 Assert(pPGM->pGstPaePML4HC); 3474 3476 if (pPGM->pGstPaePML4HC->a[iPml4e].n.u1Present) 3475 3477 { … … 3516 3518 const unsigned iPml4e = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; 3517 3519 3520 Assert(pPGM->pGstPaePML4HC); 3518 3521 *ppPml4e = &pPGM->pGstPaePML4HC->a[iPml4e]; 3519 3522 if ((*ppPml4e)->n.u1Present) … … 3561 3564 const unsigned iPml4e = (GCPtr >> X86_PML4_SHIFT) & X86_PML4_MASK; 3562 3565 3566 Assert(pPGM->pGstPaePML4HC); 3563 3567 pPml4e = &pPGM->pGstPaePML4HC->a[iPml4e]; 3564 3568 if (pPml4e->n.u1Present) -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r10032 r10063 823 823 PPGMPOOLPAGE pShwPage; 824 824 int rc; 825 PGMPOOLKIND enmPdpt, enmPd; 826 unsigned idxTopLevel; 827 828 AssertReturn(pVM->pgm.s.pHCPaePML4, VERR_INTERNAL_ERROR); 829 if (HWACCMIsNestedPagingActive(pVM)) 830 { 831 enmPdpt = PGMPOOLKIND_64BIT_PDPT_FOR_PHYS; 832 enmPd = PGMPOOLKIND_64BIT_PD_FOR_PHYS; 833 idxTopLevel = PGMPOOL_IDX_NESTED_ROOT; 834 } 835 else 836 { 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; 842 } 825 bool fNestedPaging = HWACCMIsNestedPagingActive(pVM); 843 826 844 827 Assert(pVM->pgm.s.pHCPaePML4); 828 845 829 /* Allocate page directory pointer table if not present. */ 846 830 pPml4e = &pPGM->pHCPaePML4->a[iPml4e]; … … 848 832 && !(pPml4e->u & X86_PML4E_PG_MASK)) 849 833 { 850 PX86PML4E pPml4eGst = &pPGM->pGstPaePML4HC->a[iPml4e];851 852 834 Assert(!(pPml4e->u & X86_PML4E_PG_MASK)); 853 rc = pgmPoolAlloc(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, enmPdpt, idxTopLevel, iPml4e, &pShwPage); 835 836 if (!fNestedPaging) 837 { 838 Assert(pVM->pgm.s.pHCShwAmd64CR3); 839 Assert(pPGM->pGstPaePML4HC); 840 841 PX86PML4E pPml4eGst = &pPGM->pGstPaePML4HC->a[iPml4e]; 842 843 rc = pgmPoolAlloc(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, PGMPOOLKIND_64BIT_PDPT_FOR_64BIT_PDPT, pVM->pgm.s.pHCShwAmd64CR3->idx, iPml4e, &pShwPage); 844 } 845 else 846 rc = pgmPoolAlloc(pVM, GCPtr + RT_BIT_64(63) /* hack: make the address unique */, PGMPOOLKIND_64BIT_PDPT_FOR_PHYS, PGMPOOL_IDX_NESTED_ROOT, iPml4e, &pShwPage); 847 854 848 if (rc == VERR_PGM_POOL_FLUSHED) 855 849 return VINF_PGM_SYNC_CR3; … … 874 868 && !(pPdpe->u & X86_PDPE_PG_MASK)) 875 869 { 876 PX86PML4E pPml4eGst = &pPGM->pGstPaePML4HC->a[iPml4e]; 877 PX86PDPT pPdptGst; 878 rc = PGM_GCPHYS_2_PTR(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, &pPdptGst); 879 AssertRCReturn(rc, rc); 880 881 Assert(!(pPdpe->u & X86_PDPE_PG_MASK)); 882 /* Create a reference back to the PDPT by using the index in its shadow page. */ 883 rc = pgmPoolAlloc(pVM, pPdptGst->a[iPdPt].u & X86_PDPE_PG_MASK, enmPd, pShwPage->idx, iPdPt, &pShwPage); 870 if (!fNestedPaging) 871 { 872 Assert(pPGM->pGstPaePML4HC); 873 874 PX86PML4E pPml4eGst = &pPGM->pGstPaePML4HC->a[iPml4e]; 875 PX86PDPT pPdptGst; 876 rc = PGM_GCPHYS_2_PTR(pVM, pPml4eGst->u & X86_PML4E_PG_MASK, &pPdptGst); 877 AssertRCReturn(rc, rc); 878 879 Assert(!(pPdpe->u & X86_PDPE_PG_MASK)); 880 /* Create a reference back to the PDPT by using the index in its shadow page. */ 881 rc = pgmPoolAlloc(pVM, pPdptGst->a[iPdPt].u & X86_PDPE_PG_MASK, PGMPOOLKIND_64BIT_PD_FOR_64BIT_PD, pShwPage->idx, iPdPt, &pShwPage); 882 } 883 else 884 rc = pgmPoolAlloc(pVM, GCPtr + RT_BIT_64(62) /* hack: make the address unique */, PGMPOOLKIND_64BIT_PD_FOR_PHYS, pShwPage->idx, iPdPt, &pShwPage); 885 884 886 if (rc == VERR_PGM_POOL_FLUSHED) 885 887 return VINF_PGM_SYNC_CR3; -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r10013 r10063 2657 2657 2658 2658 /* Virtual address = physical address */ 2659 GCPhys = GCPtrPage & X86_PAGE_4K_BASE_MASK _32;2659 GCPhys = GCPtrPage & X86_PAGE_4K_BASE_MASK; 2660 2660 # if PGM_SHW_TYPE == PGM_TYPE_AMD64 2661 2661 rc = pgmPoolAlloc(pVM, GCPhys, BTH_PGMPOOLKIND_PT_FOR_PT, pShwPde->idx, iPDDst, &pShwPage); -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r10032 r10063 1056 1056 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 1057 1057 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1058 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:1059 1058 return true; 1060 1059 … … 1079 1078 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 1080 1079 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1081 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:1082 1080 return true; 1083 1081 default: … … 1105 1103 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 1106 1104 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1107 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:1108 1105 return true; 1109 1106 default: … … 1330 1327 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 1331 1328 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1332 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:1333 1329 case PGMPOOLKIND_ROOT_NESTED: 1334 1330 break; … … 1380 1376 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 1381 1377 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1382 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:1383 1378 case PGMPOOLKIND_ROOT_NESTED: 1384 1379 /* Nothing to monitor here. */ … … 1466 1461 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 1467 1462 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 1468 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:1469 1463 case PGMPOOLKIND_ROOT_NESTED: 1470 1464 /* Nothing to monitor here. */ … … 2159 2153 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 2160 2154 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 2161 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:2162 2155 return 8; 2163 2156 … … 2203 2196 case PGMPOOLKIND_64BIT_PDPT_FOR_PHYS: 2204 2197 case PGMPOOLKIND_64BIT_PD_FOR_PHYS: 2205 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:2206 2198 case PGMPOOLKIND_ROOT_NESTED: 2207 2199 /** @todo can we return 0? (nobody is calling this...) */ … … 3210 3202 3211 3203 case PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4: 3212 case PGMPOOLKIND_64BIT_PML4_FOR_PHYS:3213 3204 pgmPoolTrackDerefPML464Bit(pPool, pPage, (PX86PML4)pvShw); 3214 3205 break; … … 3483 3474 * Quietly reject any attempts at flushing the currently active shadow CR3 mapping 3484 3475 */ 3485 if ( ( pPage->enmKind == PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4 3486 || pPage->enmKind == PGMPOOLKIND_64BIT_PML4_FOR_PHYS) 3476 if ( pPage->enmKind == PGMPOOLKIND_64BIT_PML4_FOR_64BIT_PML4 3487 3477 && PGMGetHyperCR3(CTXSUFF(pPool->pVM)) == pPage->Core.Key) 3488 3478 {
Note:
See TracChangeset
for help on using the changeset viewer.