- Timestamp:
- Mar 28, 2008 3:07:31 PM (17 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGM.cpp
r7072 r7629 1348 1348 STAM_REG(pVM, &pPGM->StatGCTrap0eUSWrite, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/User/Write", STAMUNIT_OCCURENCES, "Number of user mode write page faults."); 1349 1349 STAM_REG(pVM, &pPGM->StatGCTrap0eUSReserved, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/User/Reserved", STAMUNIT_OCCURENCES, "Number of user mode reserved bit page faults."); 1350 STAM_REG(pVM, &pPGM->StatGCTrap0eUSNXE, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/User/NXE", STAMUNIT_OCCURENCES, "Number of user mode NXE page faults."); 1350 1351 STAM_REG(pVM, &pPGM->StatGCTrap0eUSRead, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/User/Read", STAMUNIT_OCCURENCES, "Number of user mode read page faults."); 1351 1352 … … 1354 1355 STAM_REG(pVM, &pPGM->StatGCTrap0eSVWrite, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/Supervisor/Write", STAMUNIT_OCCURENCES, "Number of supervisor mode write page faults."); 1355 1356 STAM_REG(pVM, &pPGM->StatGCTrap0eSVReserved, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/Supervisor/Reserved", STAMUNIT_OCCURENCES, "Number of supervisor mode reserved bit page faults."); 1357 STAM_REG(pVM, &pPGM->StatGCTrap0eSNXE, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/Supervisor/NXE", STAMUNIT_OCCURENCES, "Number of supervisor mode NXE page faults."); 1356 1358 STAM_REG(pVM, &pPGM->StatGCTrap0eUnhandled, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/GuestPF/Unhandled", STAMUNIT_OCCURENCES, "Number of guest real page faults."); 1357 1359 STAM_REG(pVM, &pPGM->StatGCTrap0eMap, STAMTYPE_COUNTER, "/PGM/GC/Trap0e/GuestPF/Map", STAMUNIT_OCCURENCES, "Number of guest page faults due to map accesses."); … … 2313 2315 * Get page directory addresses. 2314 2316 */ 2315 P VBOXPD pPDSrc = pVM->pgm.s.pGuestPDHC;2317 PX86PD pPDSrc = pVM->pgm.s.pGuestPDHC; 2316 2318 Assert(pPDSrc); 2317 2319 Assert(MMPhysGCPhys2HCVirt(pVM, (RTGCPHYS)(CPUMGetGuestCR3(pVM) & X86_CR3_PAGE_MASK), sizeof(*pPDSrc)) == pPDSrc); … … 2322 2324 for (unsigned iPD = 0; iPD < ELEMENTS(pPDSrc->a); iPD++) 2323 2325 { 2324 VBOXPDE PdeSrc = pPDSrc->a[iPD];2326 X86PDE PdeSrc = pPDSrc->a[iPD]; 2325 2327 if (PdeSrc.n.u1Present) 2326 2328 { -
trunk/src/VBox/VMM/PGMBth.h
r5999 r7629 27 27 PGM_BTH_DECL(int, Trap0eHandler)(PVM pVM, RTGCUINT uErr, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault); 28 28 PGM_BTH_DECL(int, SyncCR3)(PVM pVM, uint32_t cr0, uint32_t cr3, uint32_t cr4, bool fGlobal); 29 PGM_BTH_DECL(int, SyncPage)(PVM pVM, VBOXPDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError);29 PGM_BTH_DECL(int, SyncPage)(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError); 30 30 PGM_BTH_DECL(int, VerifyAccessSyncPage)(PVM pVM, RTGCUINTPTR Addr, unsigned fPage, unsigned uError); 31 31 PGM_BTH_DECL(int, InvalidatePage)(PVM pVM, RTGCPTR GCPtrPage); -
trunk/src/VBox/VMM/PGMInternal.h
r7625 r7629 211 211 */ 212 212 #define PGM_WITH_PAGING(uType) ((uType) >= PGM_TYPE_32BIT) 213 214 /** Macro for checking if the guest supports the NX bit. 215 * @param uType PGM_TYPE_* 216 * @remark ASSUMES certain order of the PGM_TYPE_* values. 217 */ 218 #define PGM_WITH_NX(uType) ((uType) >= PGM_TYPE_PAE) 213 219 214 220 … … 342 348 RTHCPHYS HCPhysPaePT1; 343 349 /** The HC virtual address of the 32-bit page table. */ 344 R3PTRTYPE(P VBOXPT)pPTR3;350 R3PTRTYPE(PX86PT) pPTR3; 345 351 /** The HC virtual address of the two PAE page table. (i.e 1024 entries instead of 512) */ 346 352 R3PTRTYPE(PX86PTPAE) paPaePTsR3; 347 353 /** The GC virtual address of the 32-bit page table. */ 348 GCPTRTYPE(P VBOXPT)pPTGC;354 GCPTRTYPE(PX86PT) pPTGC; 349 355 /** The GC virtual address of the two PAE page table. */ 350 356 GCPTRTYPE(PX86PTPAE) paPaePTsGC; 351 357 /** The GC virtual address of the 32-bit page table. */ 352 R0PTRTYPE(P VBOXPT)pPTR0;358 R0PTRTYPE(PX86PT) pPTR0; 353 359 /** The GC virtual address of the two PAE page table. */ 354 360 R0PTRTYPE(PX86PTPAE) paPaePTsR0; … … 1764 1770 DECLR3CALLBACKMEMBER(int, pfnR3BthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage)); 1765 1771 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncCR3,(PVM pVM, uint32_t cr0, uint32_t cr3, uint32_t cr4, bool fGlobal)); 1766 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncPage,(PVM pVM, VBOXPDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));1772 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError)); 1767 1773 DECLR3CALLBACKMEMBER(int, pfnR3BthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage)); 1768 1774 DECLR3CALLBACKMEMBER(int, pfnR3BthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError)); … … 1774 1780 DECLGCCALLBACKMEMBER(int, pfnGCBthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage)); 1775 1781 DECLGCCALLBACKMEMBER(int, pfnGCBthSyncCR3,(PVM pVM, uint32_t cr0, uint32_t cr3, uint32_t cr4, bool fGlobal)); 1776 DECLGCCALLBACKMEMBER(int, pfnGCBthSyncPage,(PVM pVM, VBOXPDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));1782 DECLGCCALLBACKMEMBER(int, pfnGCBthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError)); 1777 1783 DECLGCCALLBACKMEMBER(int, pfnGCBthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage)); 1778 1784 DECLGCCALLBACKMEMBER(int, pfnGCBthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError)); … … 1784 1790 DECLR0CALLBACKMEMBER(int, pfnR0BthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage)); 1785 1791 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncCR3,(PVM pVM, uint32_t cr0, uint32_t cr3, uint32_t cr4, bool fGlobal)); 1786 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncPage,(PVM pVM, VBOXPDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));1792 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError)); 1787 1793 DECLR0CALLBACKMEMBER(int, pfnR0BthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage)); 1788 1794 DECLR0CALLBACKMEMBER(int, pfnR0BthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError)); … … 1847 1853 * @{ */ 1848 1854 /** The guest's page directory, HC pointer. */ 1849 R3R0PTRTYPE(P VBOXPD)pGuestPDHC;1855 R3R0PTRTYPE(PX86PD) pGuestPDHC; 1850 1856 /** The guest's page directory, static GC mapping. */ 1851 GCPTRTYPE(P VBOXPD)pGuestPDGC;1857 GCPTRTYPE(PX86PD) pGuestPDGC; 1852 1858 /** @} */ 1853 1859 … … 1993 1999 DECLR3CALLBACKMEMBER(int, pfnR3BthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage)); 1994 2000 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncCR3,(PVM pVM, uint32_t cr0, uint32_t cr3, uint32_t cr4, bool fGlobal)); 1995 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncPage,(PVM pVM, VBOXPDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));2001 DECLR3CALLBACKMEMBER(int, pfnR3BthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError)); 1996 2002 DECLR3CALLBACKMEMBER(int, pfnR3BthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage)); 1997 2003 DECLR3CALLBACKMEMBER(int, pfnR3BthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError)); … … 2001 2007 DECLR0CALLBACKMEMBER(int, pfnR0BthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage)); 2002 2008 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncCR3,(PVM pVM, uint32_t cr0, uint32_t cr3, uint32_t cr4, bool fGlobal)); 2003 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncPage,(PVM pVM, VBOXPDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));2009 DECLR0CALLBACKMEMBER(int, pfnR0BthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError)); 2004 2010 DECLR0CALLBACKMEMBER(int, pfnR0BthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage)); 2005 2011 DECLR0CALLBACKMEMBER(int, pfnR0BthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError)); … … 2009 2015 DECLGCCALLBACKMEMBER(int, pfnGCBthInvalidatePage,(PVM pVM, RTGCPTR GCPtrPage)); 2010 2016 DECLGCCALLBACKMEMBER(int, pfnGCBthSyncCR3,(PVM pVM, uint32_t cr0, uint32_t cr3, uint32_t cr4, bool fGlobal)); 2011 DECLGCCALLBACKMEMBER(int, pfnGCBthSyncPage,(PVM pVM, VBOXPDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError));2017 DECLGCCALLBACKMEMBER(int, pfnGCBthSyncPage,(PVM pVM, X86PDE PdeSrc, RTGCUINTPTR GCPtrPage, unsigned cPages, unsigned uError)); 2012 2018 DECLGCCALLBACKMEMBER(int, pfnGCBthPrefetchPage,(PVM pVM, RTGCUINTPTR GCPtrPage)); 2013 2019 DECLGCCALLBACKMEMBER(int, pfnGCBthVerifyAccessSyncPage,(PVM pVM, RTGCUINTPTR GCPtrPage, unsigned fFlags, unsigned uError)); … … 2239 2245 STAMCOUNTER StatGCTrap0eUSWrite; 2240 2246 STAMCOUNTER StatGCTrap0eUSReserved; 2247 STAMCOUNTER StatGCTrap0eUSNXE; 2241 2248 STAMCOUNTER StatGCTrap0eUSRead; 2242 2249 … … 2245 2252 STAMCOUNTER StatGCTrap0eSVWrite; 2246 2253 STAMCOUNTER StatGCTrap0eSVReserved; 2254 STAMCOUNTER StatGCTrap0eSNXE; 2247 2255 2248 2256 STAMCOUNTER StatGCTrap0eUnhandled; … … 2505 2513 int pgmR3ChangeMode(PVM pVM, PGMMODE enmGuestMode); 2506 2514 2507 int pgmR3SyncPTResolveConflict(PVM pVM, PPGMMAPPING pMapping, P VBOXPD pPDSrc, int iPDOld);2515 int pgmR3SyncPTResolveConflict(PVM pVM, PPGMMAPPING pMapping, PX86PD pPDSrc, int iPDOld); 2508 2516 PPGMMAPPING pgmGetMapping(PVM pVM, RTGCPTR GCPtr); 2509 2517 void pgmR3MapRelocate(PVM pVM, PPGMMAPPING pMapping, int iPDOld, int iPDNew); … … 3199 3207 AssertMsgFailed(("Impossible! rc=%d PDPE=%#llx\n", rc, CTXSUFF(pPGM->pGstPaePDPTR)->a[iPdPtr].u)); 3200 3208 } 3201 return 0 ;3209 return 0ULL; 3202 3210 } 3203 3211 -
trunk/src/VBox/VMM/PGMMap.cpp
r6916 r7629 159 159 * 32-bit. 160 160 */ 161 pNew->aPTs[i].pPTR3 = (P VBOXPT)pbPTs;161 pNew->aPTs[i].pPTR3 = (PX86PT)pbPTs; 162 162 pNew->aPTs[i].pPTGC = MMHyperR3ToGC(pVM, pNew->aPTs[i].pPTR3); 163 163 pNew->aPTs[i].pPTR0 = MMHyperR3ToR0(pVM, pNew->aPTs[i].pPTR3); … … 876 876 /** 877 877 * Resolves a conflict between a page table based GC mapping and 878 * the Guest OS page tables. 878 * the Guest OS page tables. (32 bits version) 879 879 * 880 880 * @returns VBox status code. … … 884 884 * @param iPDOld The index to the start of the current mapping. 885 885 */ 886 int pgmR3SyncPTResolveConflict(PVM pVM, PPGMMAPPING pMapping, P VBOXPD pPDSrc, int iPDOld)886 int pgmR3SyncPTResolveConflict(PVM pVM, PPGMMAPPING pMapping, PX86PD pPDSrc, int iPDOld) 887 887 { 888 888 STAM_PROFILE_START(&pVM->pgm.s.StatHCResolveConflict, a); … … 938 938 939 939 940 941 940 /** 942 941 * Checks guest PD for conflicts with VMM GC mappings. … … 959 958 * Resolve the page directory. 960 959 */ 961 P VBOXPD pPD = pVM->pgm.s.pGuestPDHC; /** @todo Fix PAE! */960 PX86PD pPD = pVM->pgm.s.pGuestPDHC; /** @todo Fix PAE! */ 962 961 Assert(pPD); 963 Assert(pPD == (P VBOXPD)MMPhysGCPhys2HCVirt(pVM, cr3 & X86_CR3_PAGE_MASK, sizeof(*pPD)));962 Assert(pPD == (PX86PD)MMPhysGCPhys2HCVirt(pVM, cr3 & X86_CR3_PAGE_MASK, sizeof(*pPD))); 964 963 965 964 /* -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r6906 r7629 63 63 * Internal Functions * 64 64 *******************************************************************************/ 65 /** @def DUMP_PDE_BIG66 * Debug routine for dumping a big PDE.67 */68 #ifdef DEBUG_Sander69 /** Debug routine for dumping a big PDE. */70 static void pgmDumpPDEBig(const char *pszPrefix, int iPD, VBOXPDE Pde)71 {72 Log(("%s: BIG %d u10PageNo=%08X P=%d W=%d U=%d CACHE=%d ACC=%d DIR=%d GBL=%d\n", pszPrefix, iPD, Pde.b.u10PageNo, Pde.b.u1Present, Pde.b.u1Write, Pde.b.u1User, Pde.b.u1CacheDisable, Pde.b.u1Accessed, Pde.b.u1Dirty, Pde.b.u1Global));73 Log(("%s: BIG %d WRT=%d AVAIL=%X RSV=%X PAT=%d\n", pszPrefix, iPD, Pde.b.u1WriteThru, Pde.b.u3Available, Pde.b.u8PageNoHigh, Pde.b.u1PAT));74 }75 #define DUMP_PDE_BIG(a, b, c) pgmDumpPDEBig(a, b, c)76 #else77 #define DUMP_PDE_BIG(a, b, c) do { } while (0)78 #endif79 80 81 65 82 66 #if 1///@todo ndef RT_ARCH_AMD64 … … 274 258 else if (uErr & X86_TRAP_PF_RSVD) 275 259 STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0eUSReserved); 260 else if (uErr & X86_TRAP_PF_ID) 261 STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0eUSNXE); 276 262 else 277 263 STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0eUSRead); 278 264 } 279 265 else 280 { / /supervisor266 { /* Supervisor */ 281 267 if (!(uErr & X86_TRAP_PF_P)) 282 268 { … … 288 274 else if (uErr & X86_TRAP_PF_RW) 289 275 STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0eSVWrite); 276 else if (uErr & X86_TRAP_PF_ID) 277 STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0eSNXE); 290 278 else if (uErr & X86_TRAP_PF_RSVD) 291 279 STAM_COUNTER_INC(&pVM->pgm.s.StatGCTrap0eSVReserved); … … 582 570 PGMDECL(int) PGMInterpretInstruction(PVM pVM, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault) 583 571 { 584 #ifdef IN_RING0585 /** @todo */586 int rc = VINF_EM_RAW_EMULATE_INSTR;587 #else588 572 uint32_t cb; 589 573 int rc = EMInterpretInstruction(pVM, pRegFrame, pvFault, &cb); … … 592 576 if (rc != VINF_SUCCESS) 593 577 Log(("PGMInterpretInstruction: returns %Rrc (pvFault=%VGv)\n", rc, pvFault)); 594 #endif595 578 return rc; 596 579 } -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r7577 r7629 246 246 else 247 247 { 248 P VBOXPT pPTSrc;248 PX86PT pPTSrc; 249 249 # ifdef IN_GC 250 250 rc = PGMGCDynMapGCPage(pVM, PdeSrc.u & GST_PDE_PG_MASK, (void **)&pPTSrc); 251 251 # else 252 pPTSrc = (P VBOXPT)MMPhysGCPhys2HCVirt(pVM, PdeSrc.u & GST_PDE_PG_MASK, sizeof(*pPTSrc));252 pPTSrc = (PX86PT)MMPhysGCPhys2HCVirt(pVM, PdeSrc.u & GST_PDE_PG_MASK, sizeof(*pPTSrc)); 253 253 if (pPTSrc == 0) 254 254 rc = VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS; … … 611 611 } 612 612 } 613 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) */613 # endif /* PGM_WITH_PAGING(PGM_GST_TYPE) && !defined(IN_RING0) */ 614 614 rc = PGM_BTH_NAME(SyncPage)(pVM, PdeSrc, (RTGCUINTPTR)pvFault, PGM_SYNC_NR_PAGES, uErr); 615 615 if (VBOX_SUCCESS(rc)) … … 755 755 PGM_BTH_DECL(int, InvalidatePage)(PVM pVM, RTGCUINTPTR GCPtrPage) 756 756 { 757 #if PGM_GST_TYPE == PGM_TYPE_32BIT 757 #if PGM_GST_TYPE == PGM_TYPE_32BIT \ 758 || PGM_GST_TYPE == PGM_TYPE_PAE 758 759 759 760 LogFlow(("InvalidatePage %x\n", GCPtrPage)); … … 785 786 # else /* PAE */ 786 787 unsigned iPDSrc; 787 PX86PD 788 PX86PDPAE pPDSrc = pgmGstGetPaePDPtr(&pVM->pgm.s, GCPtrPage, &iPDSrc); 788 789 789 790 GSTPDE PdeSrc;; … … 942 943 pPdeDst->u = 0; 943 944 STAM_COUNTER_INC(&pVM->pgm.s.CTXMID(Stat,InvalidatePage4MBPages)); 944 DUMP_PDE_BIG("PGMInvalidatePage", iPDSrc, PdeSrc);945 945 PGM_INVL_BIG_PG(GCPtrPage); 946 946 } … … 971 971 # endif 972 972 return VINF_SUCCESS; 973 974 #elif PGM_GST_TYPE == PGM_TYPE_PAE975 # if PGM_SHW_TYPE == PGM_TYPE_PAE976 //# error not implemented977 return VERR_INTERNAL_ERROR;978 979 # else /* PGM_SHW_TYPE != PGM_TYPE_AMD64 */980 # error "Guest PAE mode, but not the shadow mode ; 32bit - maybe, but amd64 no."981 # endif /* PGM_SHW_TYPE != PGM_TYPE_AMD64 */982 973 983 974 #elif PGM_GST_TYPE == PGM_TYPE_AMD64 … … 1107 1098 * @remark Not used for 2/4MB pages! 1108 1099 */ 1109 DECLINLINE(void) PGM_BTH_NAME(SyncPageWorker)(PVM pVM, PSHWPTE pPteDst, GSTPDE PdeSrc, VBOXPTE PteSrc, PPGMPOOLPAGE pShwPage, unsigned iPTDst)1100 DECLINLINE(void) PGM_BTH_NAME(SyncPageWorker)(PVM pVM, PSHWPTE pPteDst, GSTPDE PdeSrc, GSTPTE PteSrc, PPGMPOOLPAGE pShwPage, unsigned iPTDst) 1110 1101 { 1111 1102 if (PteSrc.n.u1Present) … … 1243 1234 LogFlow(("SyncPage: GCPtrPage=%VGv cPages=%d uErr=%#x\n", GCPtrPage, cPages, uErr)); 1244 1235 1245 #if PGM_GST_TYPE == PGM_TYPE_32BIT 1236 #if PGM_GST_TYPE == PGM_TYPE_32BIT \ 1237 || PGM_GST_TYPE == PGM_TYPE_PAE 1246 1238 1247 1239 # if PGM_SHW_TYPE != PGM_TYPE_32BIT && PGM_SHW_TYPE != PGM_TYPE_PAE … … 1294 1286 && (PdeSrc.n.u1User == PdeDst.n.u1User) 1295 1287 && (PdeSrc.n.u1Write == PdeDst.n.u1Write || !PdeDst.n.u1Write) 1288 # if PGM_GST_TYPE == PGM_TYPE_PAE 1289 && (PdeSrc.n.u1NoExecute == PdeDst.n.u1NoExecute) 1290 # endif 1296 1291 ) 1297 1292 { … … 1311 1306 * 4KB Page - Map the guest page table. 1312 1307 */ 1313 P VBOXPT pPTSrc;1308 PGSTPT pPTSrc; 1314 1309 int rc = PGM_GCPHYS_2_PTR(pVM, PdeSrc.u & GST_PDE_PG_MASK, &pPTSrc); 1315 1310 if (VBOX_SUCCESS(rc)) … … 1341 1336 if (!pPTDst->a[iPTDst].n.u1Present) 1342 1337 { 1343 VBOXPTE PteSrc = pPTSrc->a[offPTSrc + iPTDst];1338 GSTPTE PteSrc = pPTSrc->a[offPTSrc + iPTDst]; 1344 1339 RTGCUINTPTR GCPtrCurPage = ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(GST_PT_MASK << GST_PT_SHIFT)) | ((offPTSrc + iPTDst) << PAGE_SHIFT); 1345 1340 NOREF(GCPtrCurPage); … … 1373 1368 { 1374 1369 const unsigned iPTSrc = (GCPtrPage >> GST_PT_SHIFT) & GST_PT_MASK; 1375 VBOXPTE PteSrc = pPTSrc->a[iPTSrc];1370 GSTPTE PteSrc = pPTSrc->a[iPTSrc]; 1376 1371 const unsigned iPTDst = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK; 1377 1372 PGM_BTH_NAME(SyncPageWorker)(pVM, &pPTDst->a[iPTDst], PdeSrc, PteSrc, pShwPage, iPTDst); … … 1529 1524 if (!pPTDst->a[iPTDst].n.u1Present) 1530 1525 { 1531 VBOXPTE PteSrc;1526 GSTPTE PteSrc; 1532 1527 1533 1528 RTGCUINTPTR GCPtrCurPage = ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(GST_PT_MASK << GST_PT_SHIFT)) | ((offPTSrc + iPTDst) << PAGE_SHIFT); … … 1556 1551 # endif /* PGM_SYNC_N_PAGES */ 1557 1552 { 1558 VBOXPTE PteSrc;1553 GSTPTE PteSrc; 1559 1554 const unsigned iPTDst = (GCPtrPage >> SHW_PT_SHIFT) & SHW_PT_MASK; 1560 1555 RTGCUINTPTR GCPtrCurPage = ((RTGCUINTPTR)GCPtrPage & ~(RTGCUINTPTR)(GST_PT_MASK << GST_PT_SHIFT)) | ((offPTSrc + iPTDst) << PAGE_SHIFT); … … 1611 1606 if ( (uErr & X86_TRAP_PF_RSVD) 1612 1607 || !pPdeSrc->n.u1Present 1613 # if PGM_GST_TYPE == PGM_TYPE_PAE1608 # if PGM_WITH_NX(PGM_GST_TYPE) 1614 1609 || ((uErr & X86_TRAP_PF_ID) && pPdeSrc->n.u1NoExecute) 1615 # endif1610 # endif 1616 1611 || ((uErr & X86_TRAP_PF_RW) && !pPdeSrc->n.u1Write) 1617 1612 || ((uErr & X86_TRAP_PF_US) && !pPdeSrc->n.u1User) ) … … 1701 1696 const GSTPTE PteSrc = *pPteSrc; 1702 1697 if ( !PteSrc.n.u1Present 1703 # if PGM_GST_TYPE == PGM_TYPE_PAE1698 # if PGM_WITH_NX(PGM_GST_TYPE) 1704 1699 || ((uErr & X86_TRAP_PF_ID) && !PteSrc.n.u1NoExecute) 1705 # endif1700 # endif 1706 1701 || ((uErr & X86_TRAP_PF_RW) && !PteSrc.n.u1Write) 1707 1702 || ((uErr & X86_TRAP_PF_US) && !PteSrc.n.u1User) … … 1842 1837 LogFlow(("SyncPT: GCPtrPage=%VGv\n", GCPtrPage)); 1843 1838 1844 #if PGM_GST_TYPE == PGM_TYPE_32BIT 1839 #if PGM_GST_TYPE == PGM_TYPE_32BIT \ 1840 || PGM_GST_TYPE == PGM_TYPE_PAE 1845 1841 1846 1842 # if PGM_SHW_TYPE != PGM_TYPE_32BIT && PGM_SHW_TYPE != PGM_TYPE_PAE … … 1861 1857 SHWPDE PdeDst = *pPdeDst; 1862 1858 1859 # if PGM_GST_TYPE == PGM_TYPE_32BIT 1863 1860 /* 1864 1861 * Check for conflicts. … … 1869 1866 { 1870 1867 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 1871 # ifndef IN_RING31868 # ifndef IN_RING3 1872 1869 Log(("SyncPT: Conflict at %VGv\n", GCPtrPage)); 1873 1870 STAM_PROFILE_STOP(&pVM->pgm.s.CTXMID(Stat,SyncPT), a); 1874 1871 return VERR_ADDRESS_CONFLICT; 1875 # else1872 # else 1876 1873 PPGMMAPPING pMapping = pgmGetMapping(pVM, (RTGCPTR)GCPtrPage); 1877 1874 Assert(pMapping); … … 1883 1880 } 1884 1881 PdeDst = *pPdeDst; 1885 # endif1882 # endif 1886 1883 } 1884 # else /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 1885 /* PAE and AMD64 modes are hardware accelerated only, so there are no mappings. */ 1886 Assert(!pgmMapAreMappingsEnabled(&pVM->pgm.s)); 1887 # endif /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 1887 1888 Assert(!PdeDst.n.u1Present); /* We're only supposed to call SyncPT on PDE!P and conflicts.*/ 1888 1889 … … 2603 2604 && (PdeSrc.n.u1User || fRawR0Enabled)) 2604 2605 { 2606 # if PGM_GST_TYPE == PGM_TYPE_32BIT 2605 2607 /* 2606 2608 * Check for conflicts with GC mappings. … … 2619 2621 } 2620 2622 2621 # ifdef IN_RING32623 # ifdef IN_RING3 2622 2624 int rc = pgmR3SyncPTResolveConflict(pVM, pMapping, pPDSrc, iPD); 2623 2625 if (VBOX_FAILURE(rc)) … … 2631 2633 pMapping = pMapping->pNextR3; 2632 2634 iPdNoMapping = pMapping ? pMapping->GCPtr >> X86_PD_SHIFT : ~0U; 2633 # else2635 # else 2634 2636 LogFlow(("SyncCR3: detected conflict -> VINF_PGM_SYNC_CR3\n")); 2635 2637 return VINF_PGM_SYNC_CR3; 2636 #endif 2637 } 2638 2638 # endif 2639 } 2640 # else /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 2641 /* PAE and AMD64 modes are hardware accelerated only, so there are no mappings. */ 2642 Assert(iPD != iPdNoMapping); 2643 # endif /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 2639 2644 /* 2640 2645 * Sync page directory entry. … … 2742 2747 else 2743 2748 { 2749 # if PGM_GST_TYPE == PGM_TYPE_32BIT 2744 2750 Assert(pgmMapAreMappingsEnabled(&pVM->pgm.s)); 2745 2751 const unsigned cPTs = pMapping->cPTs; … … 2763 2769 && (pPDSrc->a[iPD + iPT].n.u1User || fRawR0Enabled)) 2764 2770 { 2765 # ifdef IN_RING32771 # ifdef IN_RING3 2766 2772 int rc = pgmR3SyncPTResolveConflict(pVM, pMapping, pPDSrc, iPD); 2767 2773 if (VBOX_FAILURE(rc)) … … 2776 2782 iPdNoMapping = pMapping ? pMapping->GCPtr >> X86_PD_SHIFT : ~0U; 2777 2783 break; 2778 # else2784 # else 2779 2785 LogFlow(("SyncCR3: detected conflict -> VINF_PGM_SYNC_CR3\n")); 2780 2786 return VINF_PGM_SYNC_CR3; 2781 # endif2787 # endif 2782 2788 } 2783 2789 } … … 2788 2794 iPdNoMapping = pMapping->GCPtr >> X86_PD_SHIFT; 2789 2795 } 2790 } 2796 # else /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 2797 /* PAE and AMD64 modes are hardware accelerated only, so there are no mappings. */ 2798 AssertFailed(); 2799 # endif /* PGM_GST_TYPE == PGM_TYPE_32BIT */ 2800 } 2801 2791 2802 /* advance. */ 2792 2803 iPD += cPTs - 1; -
trunk/src/VBox/VMM/VMMAll/PGMAllGst.h
r6927 r7629 134 134 || PGM_GST_TYPE == PGM_TYPE_PAE \ 135 135 || PGM_GST_TYPE == PGM_TYPE_AMD64 136 136 137 137 #if PGM_GST_TYPE == PGM_TYPE_AMD64 138 138 /* later */ … … 179 179 */ 180 180 if (pfFlags) 181 { 181 182 *pfFlags = (Pte.u & ~GST_PTE_PG_MASK) 182 183 & ((Pde.u & (X86_PTE_RW | X86_PTE_US)) | ~(uint64_t)(X86_PTE_RW | X86_PTE_US)); 184 # if PGM_WITH_NX(PGM_GST_TYPE) 185 /* The NX bit is determined by a bitwise OR between the PT and PD */ 186 if (Pde.u & X86_PTE_PAE_NX) 187 *pfFlags |= X86_PTE_PAE_NX; 188 # endif 189 } 183 190 if (pGCPhys) 184 191 *pGCPhys = Pte.u & GST_PTE_PG_MASK; … … 791 798 || PGM_GST_TYPE == PGM_TYPE_PAE \ 792 799 || PGM_GST_TYPE == PGM_TYPE_AMD64 800 793 801 #if PGM_GST_TYPE == PGM_TYPE_AMD64 794 802 AssertFailed(); -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r7598 r7629 982 982 else 983 983 { /* (normal page) */ 984 P VBOXPT pPT;984 PX86PT pPT; 985 985 rc = PGM_GCPHYS_2_PTR(pVM, Pde.u & X86_PDE_PG_MASK, &pPT); 986 986 if (VBOX_SUCCESS(rc)) 987 987 { 988 VBOXPTE Pte = pPT->a[((RTGCUINTPTR)GCPtr >> X86_PT_SHIFT) & X86_PT_MASK];988 X86PTE Pte = pPT->a[((RTGCUINTPTR)GCPtr >> X86_PT_SHIFT) & X86_PT_MASK]; 989 989 if (Pte.n.u1Present) 990 990 return PGMPhysGCPhys2HCPtr(pVM, (Pte.u & X86_PTE_PG_MASK) | ((RTGCUINTPTR)GCPtr & PAGE_OFFSET_MASK), 1 /* we always stay within one page */, pHCPtr); -
trunk/src/VBox/VMM/testcase/tstVMStructSize.cpp
r6854 r7629 106 106 CHECK_SIZE(VBOXIDTR, 6); 107 107 CHECK_SIZE(VBOXGDTR, 6); 108 CHECK_SIZE(VBOXPTE, 4);109 CHECK_SIZE(VBOXPDE, 4);110 108 CHECK_SIZE(VBOXTSS, 136); 111 109 CHECK_SIZE(X86FXSTATE, 512);
Note:
See TracChangeset
for help on using the changeset viewer.