Changeset 7629 in vbox for trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
- Timestamp:
- Mar 28, 2008 3:07:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.