- Timestamp:
- Aug 20, 2010 9:15:56 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 65001
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/FTM.cpp
r31790 r31807 28 28 #include <VBox/ssm.h> 29 29 #include <VBox/log.h> 30 #include <VBox/pgm.h> 30 31 31 32 #include <iprt/assert.h> … … 295 296 if (!pVM->ftm.s.fCheckpointingActive) 296 297 { 297 int rc2= PDMCritSectEnter(&pVM->ftm.s.CritSect, VERR_SEM_BUSY);298 AssertMsg(rc 2== VINF_SUCCESS, ("%Rrc\n", rc));298 rc = PDMCritSectEnter(&pVM->ftm.s.CritSect, VERR_SEM_BUSY); 299 AssertMsg(rc == VINF_SUCCESS, ("%Rrc\n", rc)); 299 300 300 301 /* sync the changed memory with the standby node. */ 301 302 302 303 PDMCritSectLeave(&pVM->ftm.s.CritSect); 303 304 304 } 305 305 rc = RTSemEventWait(pVM->ftm.s.master.hShutdownEvent, pVM->ftm.s.uInterval); … … 448 448 449 449 pVM->fFaultTolerantMaster = true; 450 if (PGMIsUsingLargePages(pVM)) 451 { 452 /* Must disable large page usage as 2 MB pages are too big to write monitor. */ 453 LogRel(("FTSync: disabling large page usage.\n")); 454 PGMSetLargePageUsage(pVM, false); 455 } 456 /** @todo might need to disable page fusion as well */ 457 450 458 return VMR3PowerOn(pVM); 451 459 } -
trunk/src/VBox/VMM/PGM.cpp
r31784 r31807 631 631 static DECLCALLBACK(int) pgmR3CmdAssertCR3(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 632 632 # endif 633 # ifdef DEBUG_sandervl634 static DECLCALLBACK(int) pgmR3CmdCountPhysWrites(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult);635 static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser);636 # endif637 633 static DECLCALLBACK(int) pgmR3CmdPhysToFile(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult); 638 634 #endif … … 680 676 { "pgmsharedmodules", 0, 0, NULL, 0, NULL, 0, pgmR3CmdShowSharedModules, "", "Print shared modules info." }, 681 677 # endif 682 # endif683 # ifdef DEBUG_sandervl684 { "pgmcountphyswrites", 2, 2, &g_aPgmCountPhysWritesArgs[0], 2, NULL, 0, pgmR3CmdCountPhysWrites, "", "Count physical page writes."},685 678 # endif 686 679 { "pgmsyncalways", 0, 0, NULL, 0, NULL, 0, pgmR3CmdSyncAlways, "", "Toggle permanent CR3 syncing." }, … … 1672 1665 rc = STAMR3RegisterF(pVM, a, STAMTYPE_PROFILE, STAMVISIBILITY_ALWAYS, STAMUNIT_TICKS_PER_CALL, c, b); \ 1673 1666 AssertRC(rc); 1674 1675 # ifdef DEBUG_sandervl1676 PGM_REG_COUNTER(&pPGM->StatRZFTPhysPageWrite, "/PGM/FT/RZ/PageWrite", "The number of times a physical page was written to (FT stats).");1677 PGM_REG_COUNTER(&pPGM->StatR3FTPhysPageWrite, "/PGM/FT/R3/PageWrite", "The number of times a physical page was written to (FT stats).");1678 # endif1679 1667 1680 1668 PGMSTATS *pStats = pVM->pgm.s.pStatsR3; … … 2143 2131 if (pVM->pgm.s.fRamPreAlloc) 2144 2132 rc = pgmR3PhysRamPreAllocate(pVM); 2145 2146 #ifdef DEBUG_sandervl2147 rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, pgmR3PhysWriteCountTMCallback, NULL, "Physical page write counting timer", &pVM->pgm.s.pPhysWritesCountTimer);2148 AssertRC(rc);2149 #endif2150 2133 2151 2134 LogRel(("PGMR3InitFinalize: 4 MB PSE mask %RGp\n", pVM->pgm.s.GCPhys4MBPSEMask)); … … 4313 4296 return VINF_SUCCESS; 4314 4297 } 4315 4316 # ifdef DEBUG_sandervl4317 /**4318 * Internal timer callback function.4319 *4320 * @param pVM The VM.4321 * @param pTimer The timer handle.4322 * @param pvUser User argument specified upon timer creation.4323 */4324 static DECLCALLBACK(void) pgmR3PhysWriteCountTMCallback(PVM pVM, PTMTIMER pTimer, void *pvUser)4325 {4326 if (pVM->pgm.s.fCountingPhysWrites)4327 {4328 pgmR3PoolClearAll(pVM, true/* fFlushRemTlb */);4329 4330 /* Program next invocation. */4331 int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, pVM->pgm.s.u32PhysWriteCountTimerInterval);4332 AssertRC(rc);4333 }4334 }4335 4336 /**4337 * The '.pgmcountphyswrites' command.4338 *4339 * @returns VBox status.4340 * @param pCmd Pointer to the command descriptor (as registered).4341 * @param pCmdHlp Pointer to command helper functions.4342 * @param pVM Pointer to the current VM (if any).4343 * @param paArgs Pointer to (readonly) array of arguments.4344 * @param cArgs Number of arguments in the array.4345 */4346 static DECLCALLBACK(int) pgmR3CmdCountPhysWrites(PCDBGCCMD pCmd, PDBGCCMDHLP pCmdHlp, PVM pVM, PCDBGCVAR paArgs, unsigned cArgs, PDBGCVAR pResult)4347 {4348 /*4349 * Validate input.4350 */4351 if (!pVM)4352 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: The command requires a VM to be selected.\n");4353 if ( cArgs != 24354 || paArgs[0].enmType != DBGCVAR_TYPE_STRING4355 || paArgs[1].enmType != DBGCVAR_TYPE_NUMBER)4356 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: parser error, invalid arguments.\n");4357 4358 if (!strcmp(paArgs[0].u.pszString, "off"))4359 {4360 if (!pVM->pgm.s.fCountingPhysWrites)4361 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: not enabled!\n");4362 4363 TMTimerStop(pVM->pgm.s.pPhysWritesCountTimer);4364 pVM->pgm.s.fCountingPhysWrites = false;4365 return VINF_SUCCESS;4366 }4367 else4368 if (strcmp(paArgs[0].u.pszString, "on"))4369 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 1st argument '%s', must be 'on' or 'off'.\n", paArgs[0].u.pszString);4370 4371 if ( paArgs[1].u.u64Number < 104372 || paArgs[1].u.u64Number > 1000)4373 return pCmdHlp->pfnPrintf(pCmdHlp, NULL, "error: Invalid 2nd argument '%d', must be between 10 and 1000 ms.\n", paArgs[1].u.u64Number);4374 4375 pVM->pgm.s.u32PhysWriteCountTimerInterval = paArgs[1].u.u64Number;4376 pVM->pgm.s.fCountingPhysWrites = true;4377 int rc = TMTimerSetMillies(pVM->pgm.s.pPhysWritesCountTimer, paArgs[1].u.u64Number);4378 AssertRC(rc);4379 return VINF_SUCCESS;4380 }4381 # endif /* DEBUG_sandervl */4382 4383 4298 #endif /* VBOX_STRICT */ 4384 4299 -
trunk/src/VBox/VMM/PGMInternal.h
r31784 r31807 3224 3224 /** @} */ 3225 3225 3226 #ifdef DEBUG_sandervl3227 PTMTIMERR3 pPhysWritesCountTimer;3228 uint32_t u32PhysWriteCountTimerInterval;3229 bool fCountingPhysWrites;3230 uint8_t u8Alignment[3];3231 3232 STAMCOUNTER StatR3FTPhysPageWrite; /**< R3: The number of times a physical page was written to (FT stats) */3233 STAMCOUNTER StatRZFTPhysPageWrite; /**< RC/R0: The number of times a physical page was written to (FT stats) */3234 #endif3235 3236 3226 #ifdef VBOX_WITH_STATISTICS 3237 3227 /** @name Statistics on the heap. -
trunk/src/VBox/VMM/VMMAll/PGMAllBth.h
r31784 r31807 2177 2177 2178 2178 PGM_BTH_NAME(SyncPageWorker)(pVCpu, &pPTDst->a[iPTDst], PdeSrc, PteSrc, pShwPage, iPTDst); 2179 #ifdef DEBUG_sandervl2180 if (pVM->pgm.s.fCountingPhysWrites)2181 pPTDst->a[iPTDst].n.u1Write = 0;2182 #endif2183 2184 2179 Log2(("SyncPage: 4K+ %RGv PteSrc:{P=%d RW=%d U=%d raw=%08llx} PteDst=%08llx%s\n", 2185 2180 GCPtrCurPage, PteSrc.n.u1Present, … … 2203 2198 RTGCPTR GCPtrCurPage = (GCPtrPage & ~(RTGCPTR)(SHW_PT_MASK << SHW_PT_SHIFT)) | (iPTDst << PAGE_SHIFT); 2204 2199 GSTPTE PteSrc; 2205 2206 #ifdef DEBUG_sandervl2207 if ( pVM->pgm.s.fCountingPhysWrites2208 && ((uErr & (X86_TRAP_PF_RW|X86_TRAP_PF_P)) == (X86_TRAP_PF_RW|X86_TRAP_PF_P)))2209 {2210 STAM_COUNTER_INC(&pVM->pgm.s.CTX_MID_Z(Stat, FTPhysPageWrite));2211 }2212 #endif2213 2200 2214 2201 /* Fake the page table entry */
Note:
See TracChangeset
for help on using the changeset viewer.