Changeset 14133 in vbox for trunk/src/VBox
- Timestamp:
- Nov 12, 2008 4:37:47 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r14038 r14133 1413 1413 */ 1414 1414 pVM->pgm.s.pHC32BitPD = (PX86PD)MMR3PageAllocLow(pVM); 1415 pVM->pgm.s.apHCPaePDs[0] = (PX86PDPAE)MMR3PageAlloc(pVM); 1416 pVM->pgm.s.apHCPaePDs[1] = (PX86PDPAE)MMR3PageAlloc(pVM); 1417 AssertRelease((uintptr_t)pVM->pgm.s.apHCPaePDs[0] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apHCPaePDs[1]); 1418 pVM->pgm.s.apHCPaePDs[2] = (PX86PDPAE)MMR3PageAlloc(pVM); 1419 AssertRelease((uintptr_t)pVM->pgm.s.apHCPaePDs[1] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apHCPaePDs[2]); 1420 pVM->pgm.s.apHCPaePDs[3] = (PX86PDPAE)MMR3PageAlloc(pVM); 1421 AssertRelease((uintptr_t)pVM->pgm.s.apHCPaePDs[2] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apHCPaePDs[3]); 1415 pVM->pgm.s.apShwPaePDsR3[0] = (PX86PDPAE)MMR3PageAlloc(pVM); 1416 pVM->pgm.s.apShwPaePDsR3[1] = (PX86PDPAE)MMR3PageAlloc(pVM); 1417 AssertRelease((uintptr_t)pVM->pgm.s.apShwPaePDsR3[0] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apShwPaePDsR3[1]); 1418 pVM->pgm.s.apShwPaePDsR3[2] = (PX86PDPAE)MMR3PageAlloc(pVM); 1419 AssertRelease((uintptr_t)pVM->pgm.s.apShwPaePDsR3[1] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apShwPaePDsR3[2]); 1420 pVM->pgm.s.apShwPaePDsR3[3] = (PX86PDPAE)MMR3PageAlloc(pVM); 1421 AssertRelease((uintptr_t)pVM->pgm.s.apShwPaePDsR3[2] + PAGE_SIZE == (uintptr_t)pVM->pgm.s.apShwPaePDsR3[3]); 1422 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 1423 pVM->pgm.s.apShwPaePDsR0[0] = (uintptr_t)pVM->pgm.s.apShwPaePDsR3[0]; 1424 pVM->pgm.s.apShwPaePDsR0[1] = (uintptr_t)pVM->pgm.s.apShwPaePDsR3[1]; 1425 pVM->pgm.s.apShwPaePDsR0[2] = (uintptr_t)pVM->pgm.s.apShwPaePDsR3[2]; 1426 pVM->pgm.s.apShwPaePDsR0[3] = (uintptr_t)pVM->pgm.s.apShwPaePDsR3[3]; 1427 #endif 1422 1428 pVM->pgm.s.pShwPaePdptR3 = (PX86PDPT)MMR3PageAllocLow(pVM); 1423 1429 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE … … 1430 1436 1431 1437 if ( !pVM->pgm.s.pHC32BitPD 1432 || !pVM->pgm.s.ap HCPaePDs[0]1433 || !pVM->pgm.s.ap HCPaePDs[1]1434 || !pVM->pgm.s.ap HCPaePDs[2]1435 || !pVM->pgm.s.ap HCPaePDs[3]1438 || !pVM->pgm.s.apShwPaePDsR3[0] 1439 || !pVM->pgm.s.apShwPaePDsR3[1] 1440 || !pVM->pgm.s.apShwPaePDsR3[2] 1441 || !pVM->pgm.s.apShwPaePDsR3[3] 1436 1442 || !pVM->pgm.s.pShwPaePdptR3 1437 1443 || !pVM->pgm.s.pShwNestedRootR3) … … 1444 1450 pVM->pgm.s.HCPhys32BitPD = MMPage2Phys(pVM, pVM->pgm.s.pHC32BitPD); 1445 1451 Assert(MMPagePhys2Page(pVM, pVM->pgm.s.HCPhys32BitPD) == pVM->pgm.s.pHC32BitPD); 1446 pVM->pgm.s.aHCPhysPaePDs[0] = MMPage2Phys(pVM, pVM->pgm.s.ap HCPaePDs[0]);1447 pVM->pgm.s.aHCPhysPaePDs[1] = MMPage2Phys(pVM, pVM->pgm.s.ap HCPaePDs[1]);1448 pVM->pgm.s.aHCPhysPaePDs[2] = MMPage2Phys(pVM, pVM->pgm.s.ap HCPaePDs[2]);1449 pVM->pgm.s.aHCPhysPaePDs[3] = MMPage2Phys(pVM, pVM->pgm.s.ap HCPaePDs[3]);1452 pVM->pgm.s.aHCPhysPaePDs[0] = MMPage2Phys(pVM, pVM->pgm.s.apShwPaePDsR3[0]); 1453 pVM->pgm.s.aHCPhysPaePDs[1] = MMPage2Phys(pVM, pVM->pgm.s.apShwPaePDsR3[1]); 1454 pVM->pgm.s.aHCPhysPaePDs[2] = MMPage2Phys(pVM, pVM->pgm.s.apShwPaePDsR3[2]); 1455 pVM->pgm.s.aHCPhysPaePDs[3] = MMPage2Phys(pVM, pVM->pgm.s.apShwPaePDsR3[3]); 1450 1456 pVM->pgm.s.HCPhysPaePDPT = MMPage2Phys(pVM, pVM->pgm.s.pShwPaePdptR3); 1451 1457 pVM->pgm.s.HCPhysNestedRoot = MMPage2Phys(pVM, pVM->pgm.s.pShwNestedRootR3); … … 1457 1463 ASMMemZero32(pVM->pgm.s.pShwPaePdptR3, PAGE_SIZE); 1458 1464 ASMMemZero32(pVM->pgm.s.pShwNestedRootR3, PAGE_SIZE); 1459 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.ap HCPaePDs); i++)1460 { 1461 ASMMemZero32(pVM->pgm.s.ap HCPaePDs[i], PAGE_SIZE);1465 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apShwPaePDsR3); i++) 1466 { 1467 ASMMemZero32(pVM->pgm.s.apShwPaePDsR3[i], PAGE_SIZE); 1462 1468 pVM->pgm.s.pShwPaePdptR3->a[i].u = X86_PDPE_P | PGM_PLXFLAGS_PERMANENT | pVM->pgm.s.aHCPhysPaePDs[i]; 1463 1469 /* The flags will be corrected when entering and leaving long mode. */ … … 1765 1771 * Reserve space for mapping the paging pages into guest context. 1766 1772 */ 1767 int rc = MMR3HyperReserve(pVM, PAGE_SIZE * (2 + RT_ELEMENTS(pVM->pgm.s.ap HCPaePDs) + 1 + 2 + 2), "Paging", &GCPtr);1773 int rc = MMR3HyperReserve(pVM, PAGE_SIZE * (2 + RT_ELEMENTS(pVM->pgm.s.apShwPaePDsR3) + 1 + 2 + 2), "Paging", &GCPtr); 1768 1774 AssertRCReturn(rc, rc); 1769 1775 pVM->pgm.s.pGC32BitPD = GCPtr; … … 1813 1819 GCPtr += PAGE_SIZE; /* reserved page */ 1814 1820 1815 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.ap HCPaePDs); i++)1821 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apShwPaePDsR3); i++) 1816 1822 { 1817 1823 rc = PGMMap(pVM, GCPtr, pVM->pgm.s.aHCPhysPaePDs[i], PAGE_SIZE, 0); 1818 1824 AssertRCReturn(rc, rc); 1819 pVM->pgm.s.ap GCPaePDs[i] = GCPtr;1825 pVM->pgm.s.apShwPaePDsRC[i] = GCPtr; 1820 1826 GCPtr += PAGE_SIZE; 1821 1827 } 1822 1828 /* A bit of paranoia is justified. */ 1823 AssertRelease(pVM->pgm.s.ap GCPaePDs[0] + PAGE_SIZE == pVM->pgm.s.apGCPaePDs[1]);1824 AssertRelease(pVM->pgm.s.ap GCPaePDs[1] + PAGE_SIZE == pVM->pgm.s.apGCPaePDs[2]);1825 AssertRelease(pVM->pgm.s.ap GCPaePDs[2] + PAGE_SIZE == pVM->pgm.s.apGCPaePDs[3]);1829 AssertRelease(pVM->pgm.s.apShwPaePDsRC[0] + PAGE_SIZE == pVM->pgm.s.apShwPaePDsRC[1]); 1830 AssertRelease(pVM->pgm.s.apShwPaePDsRC[1] + PAGE_SIZE == pVM->pgm.s.apShwPaePDsRC[2]); 1831 AssertRelease(pVM->pgm.s.apShwPaePDsRC[2] + PAGE_SIZE == pVM->pgm.s.apShwPaePDsRC[3]); 1826 1832 GCPtr += PAGE_SIZE; /* reserved page */ 1827 1833 … … 1897 1903 pVM->pgm.s.pGC32BitPD += offDelta; 1898 1904 pVM->pgm.s.pGuestPDRC += offDelta; 1899 AssertCompile(RT_ELEMENTS(pVM->pgm.s.ap GCPaePDs) == RT_ELEMENTS(pVM->pgm.s.apGstPaePDsRC));1900 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.ap GCPaePDs); i++)1901 { 1902 pVM->pgm.s.ap GCPaePDs[i]+= offDelta;1905 AssertCompile(RT_ELEMENTS(pVM->pgm.s.apShwPaePDsRC) == RT_ELEMENTS(pVM->pgm.s.apGstPaePDsRC)); 1906 for (unsigned i = 0; i < RT_ELEMENTS(pVM->pgm.s.apShwPaePDsRC); i++) 1907 { 1908 pVM->pgm.s.apShwPaePDsRC[i] += offDelta; 1903 1909 pVM->pgm.s.apGstPaePDsRC[i] += offDelta; 1904 1910 } -
trunk/src/VBox/VMM/PGMInternal.h
r14093 r14133 2059 2059 /** @name PAE Shadow Paging 2060 2060 * @{ */ 2061 /** The four PDs for the low 4GB - HCPtr.2061 /** The four PDs for the low 4GB - R3 Ptr. 2062 2062 * Even though these are 4 pointers, what they point at is a single table. 2063 2063 * Thus, it's possible to walk the 2048 entries starting where apHCPaePDs[0] points. */ 2064 #if 0///@todo def VBOX_WITH_2X_4GB_ADDR_SPACE 2065 R3PTRTYPE(PX86PDPAE) apHCPaePDs[4]; 2066 #else 2067 R3R0PTRTYPE(PX86PDPAE) apHCPaePDs[4]; 2068 #endif 2069 /** The four PDs for the low 4GB - GC Ptr. 2064 R3PTRTYPE(PX86PDPAE) apShwPaePDsR3[4]; 2065 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 2066 /** The four PDs for the low 4GB - R0 Ptr. 2070 2067 * Same kind of mapping as apHCPaePDs. */ 2071 RCPTRTYPE(PX86PDPAE) apGCPaePDs[4]; 2068 R0PTRTYPE(PX86PDPAE) apShwPaePDsR0[4]; 2069 #endif 2070 /** The four PDs for the low 4GB - RC Ptr. 2071 * Same kind of mapping as apHCPaePDs. */ 2072 RCPTRTYPE(PX86PDPAE) apShwPaePDsRC[4]; 2072 2073 /** The Physical Address (HC) of the four PDs for the low 4GB. 2073 2074 * These are *NOT* 4 contiguous pages. */ … … 3824 3825 return pPD; 3825 3826 #else 3826 //PX86PDPAE pPD = pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]; 3827 PX86PDPAE pPD = pPGM->CTXMID(ap,PaePDs)[iPdpt]; 3827 PX86PDPAE pPD = pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]; 3828 3828 Assert(pPD); 3829 3829 return pPD; … … 3849 3849 return pPD->a[iPd].u; 3850 3850 #else 3851 //return pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]->a[iPd].u; 3852 return pPGM->CTXMID(ap,PaePDs)[iPdpt]->a[iPd].u; 3851 return pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]->a[iPd].u; 3853 3852 #endif 3854 3853 } … … 3872 3871 return &pPD->a[iPd]; 3873 3872 #else 3874 //Assert(pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]); 3875 //return &pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]->a[iPd]; 3876 return &pPGM->CTXMID(ap,PaePDs)[iPdpt]->a[iPd]; 3873 Assert(pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]); 3874 return &pPGM->CTX_SUFF(apShwPaePDs)[iPdpt]->a[iPd]; 3877 3875 #endif 3878 3876 } -
trunk/src/VBox/VMM/PGMMap.cpp
r14131 r14133 731 731 unsigned iPDE = iOldPDE * 2 % 512; 732 732 pPGM->apInterPaePDs[iPD]->a[iPDE].u = 0; 733 pPGM->ap HCPaePDs[iPD]->a[iPDE].u= 0;733 pPGM->apShwPaePDsR3[iPD]->a[iPDE].u = 0; 734 734 iPDE++; 735 735 pPGM->apInterPaePDs[iPD]->a[iPDE].u = 0; 736 pPGM->ap HCPaePDs[iPD]->a[iPDE].u= 0;736 pPGM->apShwPaePDsR3[iPD]->a[iPDE].u = 0; 737 737 738 738 /* Clear the PGM_PDFLAGS_MAPPING flag for the page directory pointer entry. (legacy PAE guest mode) */ … … 784 784 const unsigned iPD = iNewPDE / 256; 785 785 unsigned iPDE = iNewPDE * 2 % 512; 786 if (pPGM->ap HCPaePDs[iPD]->a[iPDE].n.u1Present)787 pgmPoolFree(pVM, pPGM->ap HCPaePDs[iPD]->a[iPDE].u & X86_PDE_PAE_PG_MASK, PGMPOOL_IDX_PAE_PD, iNewPDE * 2);786 if (pPGM->apShwPaePDsR3[iPD]->a[iPDE].n.u1Present) 787 pgmPoolFree(pVM, pPGM->apShwPaePDsR3[iPD]->a[iPDE].u & X86_PDE_PAE_PG_MASK, PGMPOOL_IDX_PAE_PD, iNewPDE * 2); 788 788 X86PDEPAE PdePae0; 789 789 PdePae0.u = PGM_PDFLAGS_MAPPING | X86_PDE_P | X86_PDE_A | X86_PDE_RW | X86_PDE_US | pMap->aPTs[i].HCPhysPaePT0; 790 790 pPGM->apInterPaePDs[iPD]->a[iPDE] = PdePae0; 791 pPGM->ap HCPaePDs[iPD]->a[iPDE]= PdePae0;791 pPGM->apShwPaePDsR3[iPD]->a[iPDE] = PdePae0; 792 792 793 793 iPDE++; 794 if (pPGM->ap HCPaePDs[iPD]->a[iPDE].n.u1Present)795 pgmPoolFree(pVM, pPGM->ap HCPaePDs[iPD]->a[iPDE].u & X86_PDE_PAE_PG_MASK, PGMPOOL_IDX_PAE_PD, iNewPDE * 2 + 1);794 if (pPGM->apShwPaePDsR3[iPD]->a[iPDE].n.u1Present) 795 pgmPoolFree(pVM, pPGM->apShwPaePDsR3[iPD]->a[iPDE].u & X86_PDE_PAE_PG_MASK, PGMPOOL_IDX_PAE_PD, iNewPDE * 2 + 1); 796 796 X86PDEPAE PdePae1; 797 797 PdePae1.u = PGM_PDFLAGS_MAPPING | X86_PDE_P | X86_PDE_A | X86_PDE_RW | X86_PDE_US | pMap->aPTs[i].HCPhysPaePT1; 798 798 pPGM->apInterPaePDs[iPD]->a[iPDE] = PdePae1; 799 pPGM->ap HCPaePDs[iPD]->a[iPDE]= PdePae1;799 pPGM->apShwPaePDsR3[iPD]->a[iPDE] = PdePae1; 800 800 801 801 /* Set the PGM_PDFLAGS_MAPPING flag in the page directory pointer entry. (legacy PAE guest mode) */ -
trunk/src/VBox/VMM/PGMPool.cpp
r14038 r14133 262 262 pPool->aPages[PGMPOOL_IDX_PAE_PD].Core.Key = NIL_RTHCPHYS; 263 263 pPool->aPages[PGMPOOL_IDX_PAE_PD].GCPhys = NIL_RTGCPHYS; 264 pPool->aPages[PGMPOOL_IDX_PAE_PD].pvPageR3 = pVM->pgm.s.ap HCPaePDs[0];264 pPool->aPages[PGMPOOL_IDX_PAE_PD].pvPageR3 = pVM->pgm.s.apShwPaePDsR3[0]; 265 265 pPool->aPages[PGMPOOL_IDX_PAE_PD].enmKind = PGMPOOLKIND_ROOT_PAE_PD; 266 266 pPool->aPages[PGMPOOL_IDX_PAE_PD].idx = PGMPOOL_IDX_PAE_PD; … … 271 271 pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].Core.Key = NIL_RTHCPHYS; 272 272 pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].GCPhys = NIL_RTGCPHYS; 273 pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].pvPageR3 = pVM->pgm.s.ap HCPaePDs[i];273 pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].pvPageR3 = pVM->pgm.s.apShwPaePDsR3[i]; 274 274 pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].enmKind = PGMPOOLKIND_PAE_PD_FOR_PAE_PD; 275 275 pPool->aPages[PGMPOOL_IDX_PAE_PD_0 + i].idx = PGMPOOL_IDX_PAE_PD_0 + i; -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r14131 r14133 2324 2324 const unsigned iPdpt = (GCPtrPage >> X86_PDPT_SHIFT); NOREF(iPdpt); 2325 2325 PX86PDPT pPdptDst = pgmShwGetPaePDPTPtr(&pVM->pgm.s); NOREF(pPdptDst); 2326 PSHWPDE pPdeDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrPage);2326 PSHWPDE pPdeDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, GCPtrPage); 2327 2327 2328 2328 # elif PGM_SHW_TYPE == PGM_TYPE_AMD64 … … 3214 3214 X86PDPE PdpeSrc; 3215 3215 PGSTPD pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, iPdpt << X86_PDPT_SHIFT, &iPDSrc, &PdpeSrc); 3216 PX86PDPAE pPDPAE = pVM->pgm.s.CTXMID(ap,PaePDs)[0];3217 3216 PX86PDEPAE pPDEDst = pgmShwGetPaePDEPtr(&pVM->pgm.s, iPdpt << X86_PDPT_SHIFT); 3218 3217 PX86PDPT pPdptDst = pgmShwGetPaePDPTPtr(&pVM->pgm.s); -
trunk/src/VBox/VMM/VMMAll/PGMAllPool.cpp
r14038 r14133 115 115 case PGMPOOL_IDX_PAE_PD: 116 116 case PGMPOOL_IDX_PAE_PD_0: 117 return pVM->pgm.s.ap GCPaePDs[0];117 return pVM->pgm.s.apShwPaePDsRC[0]; 118 118 case PGMPOOL_IDX_PAE_PD_1: 119 return pVM->pgm.s.ap GCPaePDs[1];119 return pVM->pgm.s.apShwPaePDsRC[1]; 120 120 case PGMPOOL_IDX_PAE_PD_2: 121 return pVM->pgm.s.ap GCPaePDs[2];121 return pVM->pgm.s.apShwPaePDsRC[2]; 122 122 case PGMPOOL_IDX_PAE_PD_3: 123 return pVM->pgm.s.ap GCPaePDs[3];123 return pVM->pgm.s.apShwPaePDsRC[3]; 124 124 case PGMPOOL_IDX_PDPT: 125 125 return pVM->pgm.s.pShwPaePdptRC; -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r14038 r14133 416 416 GEN_CHECK_OFF(PGM, pGC32BitPD); 417 417 GEN_CHECK_OFF(PGM, HCPhys32BitPD); 418 GEN_CHECK_OFF(PGM, apHCPaePDs); 419 GEN_CHECK_OFF(PGM, apGCPaePDs); 418 GEN_CHECK_OFF(PGM, apShwPaePDsR3); 419 #ifndef VBOX_WITH_2X_4GB_ADDR_SPACE 420 GEN_CHECK_OFF(PGM, apShwPaePDsR0); 421 #endif 422 GEN_CHECK_OFF(PGM, apShwPaePDsRC); 420 423 GEN_CHECK_OFF(PGM, aHCPhysPaePDs); 421 424 GEN_CHECK_OFF(PGM, pShwPaePdptR3);
Note:
See TracChangeset
for help on using the changeset viewer.