Changeset 9026 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 21, 2008 3:33:04 PM (17 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/HWACCM.cpp
r9021 r9026 215 215 /* Disable the switcher */ 216 216 VMMR3DisableSwitcher(pVM); 217 218 if (pVM->hwaccm.s.fNestedPaging) 219 { 220 /* Reinit the paging mode to force the new shadow mode. */ 221 PGMR3ChangeMode(pVM, PGMMODE_REAL); 222 } 217 223 } 218 224 -
trunk/src/VBox/VMM/PGM.cpp
r9021 r9026 621 621 static int pgmR3ModeDataInit(PVM pVM, bool fResolveGCAndR0); 622 622 static void pgmR3ModeDataSwitch(PVM pVM, PGMMODE enmShw, PGMMODE enmGst); 623 static PGMMODE pgmR3CalcShadowMode(P GMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, VMMSWITCHER *penmSwitcher);623 static PGMMODE pgmR3CalcShadowMode(PVM pVM, PGMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, VMMSWITCHER *penmSwitcher); 624 624 625 625 #ifdef VBOX_WITH_STATISTICS … … 1340 1340 rc = pgmR3ModeDataInit(pVM, false /* don't resolve GC and R0 syms yet */); 1341 1341 if (VBOX_SUCCESS(rc)) 1342 rc = pgmR3ChangeMode(pVM, PGMMODE_REAL);1342 rc = PGMR3ChangeMode(pVM, PGMMODE_REAL); 1343 1343 if (VBOX_SUCCESS(rc)) 1344 1344 { … … 1905 1905 * Switch mode back to real mode. 1906 1906 */ 1907 rc = pgmR3ChangeMode(pVM, PGMMODE_REAL);1907 rc = PGMR3ChangeMode(pVM, PGMMODE_REAL); 1908 1908 STAM_REL_COUNTER_RESET(&pVM->pgm.s.cGuestModeChanges); 1909 1909 } … … 2279 2279 * Change the paging mode. 2280 2280 */ 2281 return pgmR3ChangeMode(pVM, pPGM->enmGuestMode);2281 return PGMR3ChangeMode(pVM, pPGM->enmGuestMode); 2282 2282 } 2283 2283 … … 2725 2725 * 2726 2726 * @returns The shadow paging mode. 2727 * @param pVM VM handle. 2727 2728 * @param enmGuestMode The guest mode. 2728 2729 * @param enmHostMode The host mode. … … 2731 2732 * VMMSWITCHER_INVALID means no change. 2732 2733 */ 2733 static PGMMODE pgmR3CalcShadowMode(P GMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, VMMSWITCHER *penmSwitcher)2734 static PGMMODE pgmR3CalcShadowMode(PVM pVM, PGMMODE enmGuestMode, SUPPAGINGMODE enmHostMode, PGMMODE enmShadowMode, VMMSWITCHER *penmSwitcher) 2734 2735 { 2735 2736 VMMSWITCHER enmSwitcher = VMMSWITCHER_INVALID; … … 2884 2885 return PGMMODE_INVALID; 2885 2886 } 2887 /* Override the shadow mode is nested paging is active. */ 2888 if (HWACCMIsNestedPagingActive(pVM)) 2889 enmShadowMode = PGMMODE_NESTED; 2886 2890 2887 2891 *penmSwitcher = enmSwitcher; … … 2899 2903 * the current mode. 2900 2904 */ 2901 int pgmR3ChangeMode(PVM pVM, PGMMODE enmGuestMode)2902 { 2903 LogFlow((" pgmR3ChangeMode: Guest mode: %d -> %d\n", pVM->pgm.s.enmGuestMode, enmGuestMode));2905 PGMR3DECL(int) PGMR3ChangeMode(PVM pVM, PGMMODE enmGuestMode) 2906 { 2907 LogFlow(("PGMR3ChangeMode: Guest mode: %d -> %d\n", pVM->pgm.s.enmGuestMode, enmGuestMode)); 2904 2908 STAM_REL_COUNTER_INC(&pVM->pgm.s.cGuestModeChanges); 2905 2909 … … 2908 2912 */ 2909 2913 VMMSWITCHER enmSwitcher; 2910 PGMMODE enmShadowMode = pgmR3CalcShadowMode( enmGuestMode, pVM->pgm.s.enmHostMode, pVM->pgm.s.enmShadowMode, &enmSwitcher);2914 PGMMODE enmShadowMode = pgmR3CalcShadowMode(pVM, enmGuestMode, pVM->pgm.s.enmHostMode, pVM->pgm.s.enmShadowMode, &enmSwitcher); 2911 2915 if (enmSwitcher != VMMSWITCHER_INVALID) 2912 2916 { … … 2928 2932 if (enmShadowMode != pVM->pgm.s.enmShadowMode) 2929 2933 { 2930 LogFlow((" pgmR3ChangeMode: Shadow mode: %d -> %d\n", pVM->pgm.s.enmShadowMode, enmShadowMode));2934 LogFlow(("PGMR3ChangeMode: Shadow mode: %d -> %d\n", pVM->pgm.s.enmShadowMode, enmShadowMode)); 2931 2935 if (PGM_SHW_PFN(Exit, pVM)) 2932 2936 { -
trunk/src/VBox/VMM/PGMInternal.h
r9021 r9026 2579 2579 PGMGCDECL(int) pgmGCGuestPDWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, void *pvFault, RTGCPHYS GCPhysFault, void *pvUser); 2580 2580 PGMDECL(int) pgmPhysRomWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, void *pvFault, RTGCPHYS GCPhysFault, void *pvUser); 2581 int pgmR3ChangeMode(PVM pVM, PGMMODE enmGuestMode);2582 2581 2583 2582 int pgmR3SyncPTResolveConflict(PVM pVM, PPGMMAPPING pMapping, PX86PD pPDSrc, RTGCPTR GCPtrOldMapping); -
trunk/src/VBox/VMM/VMMAll/PGMAll.cpp
r9024 r9026 908 908 PGMDECL(uint32_t) PGMGetHyperCR3(PVM pVM) 909 909 { 910 switch (pVM->pgm.s.enmShadowMode) 910 PGMMODE enmShadowMode = pVM->pgm.s.enmShadowMode; 911 switch (enmShadowMode) 911 912 { 912 913 case PGMMODE_32_BIT: … … 922 923 923 924 default: 924 AssertMsgFailed(("enmShadowMode=%d\n", pVM->pgm.s.enmShadowMode)); 925 AssertMsgFailed(("enmShadowMode=%d\n", enmShadowMode)); 926 return ~0; 927 } 928 } 929 930 /** 931 * Gets the current CR3 register value for the nested memory context. 932 * @returns CR3 value. 933 * @param pVM The VM handle. 934 */ 935 PGMDECL(uint32_t) PGMGetNestedCR3(PVM pVM, PGMMODE enmShadowMode) 936 { 937 switch (enmShadowMode) 938 { 939 case PGMMODE_32_BIT: 940 return pVM->pgm.s.HCPhys32BitPD; 941 942 case PGMMODE_PAE: 943 case PGMMODE_PAE_NX: 944 return pVM->pgm.s.HCPhysPaePDPT; 945 946 case PGMMODE_AMD64: 947 case PGMMODE_AMD64_NX: 948 return pVM->pgm.s.HCPhysPaePML4; 949 950 default: 951 AssertMsgFailed(("enmShadowMode=%d\n", enmShadowMode)); 925 952 return ~0; 926 953 } … … 1245 1272 return VINF_SUCCESS; 1246 1273 #ifdef IN_RING3 1247 return pgmR3ChangeMode(pVM, enmGuestMode);1274 return PGMR3ChangeMode(pVM, enmGuestMode); 1248 1275 #else 1249 1276 Log(("PGMChangeMode: returns VINF_PGM_CHANGE_MODE.\n")); -
trunk/src/VBox/VMM/VMMR0/HWSVMR0.cpp
r9021 r9026 610 610 if (pVM->hwaccm.s.fNestedPaging) 611 611 { 612 pVMCB->ctrl.u64NestedPagingCR3 = PGMGet HyperCR3(pVM);612 pVMCB->ctrl.u64NestedPagingCR3 = PGMGetNestedCR3(pVM, PGMGetHostMode(pVM)); 613 613 pVMCB->guest.u64CR3 = pCtx->cr3; 614 614 } … … 1292 1292 1293 1293 /* Handle the pagefault trap for the nested shadow table. */ 1294 rc = PGMR0Trap0eHandlerNestedPaging(pVM, PGMGet ShadowMode(pVM), errCode, CPUMCTX2CORE(pCtx), uFaultAddress);1294 rc = PGMR0Trap0eHandlerNestedPaging(pVM, PGMGetHostMode(pVM), errCode, CPUMCTX2CORE(pCtx), uFaultAddress); 1295 1295 Log2(("PGMR0Trap0eHandlerNestedPaging %VGv returned %Vrc\n", pCtx->eip, rc)); 1296 1296 if (rc == VINF_SUCCESS)
Note:
See TracChangeset
for help on using the changeset viewer.