Changeset 19324 in vbox
- Timestamp:
- May 4, 2009 12:51:27 PM (16 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/EM.cpp
r19322 r19324 3602 3602 * Start the virtual time. 3603 3603 */ 3604 rc = TMVirtualResume(pVM); 3605 Assert(rc == VINF_SUCCESS); 3604 if (pVCpu->idCpu == 0) 3605 { 3606 rc = TMVirtualResume(pVM); 3607 Assert(rc == VINF_SUCCESS); 3608 } 3606 3609 rc = TMCpuTickResume(pVCpu); 3607 3610 Assert(rc == VINF_SUCCESS); -
trunk/src/VBox/VMM/TM.cpp
r19217 r19324 997 997 Assert(!pVCpu->tm.s.fTSCTicking); 998 998 } 999 Assert(!pVM->tm.s. fVirtualTicking);999 Assert(!pVM->tm.s.cVirtualTicking); 1000 1000 Assert(!pVM->tm.s.fVirtualSyncTicking); 1001 1001 #endif … … 1048 1048 Assert(!pVCpu->tm.s.fTSCTicking); 1049 1049 } 1050 Assert(!pVM->tm.s. fVirtualTicking);1050 Assert(!pVM->tm.s.cVirtualTicking); 1051 1051 Assert(!pVM->tm.s.fVirtualSyncTicking); 1052 1052 #endif … … 1064 1064 * Load the virtual clock. 1065 1065 */ 1066 pVM->tm.s. fVirtualTicking = false;1066 pVM->tm.s.cVirtualTicking = 0; 1067 1067 /* the virtual clock. */ 1068 1068 uint64_t u64Hz; … … 1646 1646 if (RT_UNLIKELY(!pNext)) 1647 1647 { 1648 Assert(pVM->tm.s.fVirtualSyncTicking || !pVM->tm.s. fVirtualTicking);1648 Assert(pVM->tm.s.fVirtualSyncTicking || !pVM->tm.s.cVirtualTicking); 1649 1649 return; 1650 1650 } … … 1782 1782 */ 1783 1783 if ( !pVM->tm.s.fVirtualSyncTicking 1784 && pVM->tm.s. fVirtualTicking)1784 && pVM->tm.s.cVirtualTicking) 1785 1785 { 1786 1786 STAM_COUNTER_INC(&pVM->tm.s.StatVirtualSyncRunRestart); … … 2150 2150 " Virtual: %18RU64 (%#016RX64) %RU64Hz %s", 2151 2151 u64Virtual, u64Virtual, TMVirtualGetFreq(pVM), 2152 pVM->tm.s. fVirtualTicking ? "ticking" : "paused");2152 pVM->tm.s.cVirtualTicking ? "ticking" : "paused"); 2153 2153 if (pVM->tm.s.fVirtualWarpDrive) 2154 2154 pHlp->pfnPrintf(pHlp, " WarpDrive %RU32 %%", pVM->tm.s.u32VirtualWarpDrivePercentage); -
trunk/src/VBox/VMM/TMInternal.h
r19032 r19324 310 310 uint64_t cTSCTicksPerSecond; 311 311 312 /** Virtual time ticking enabled indicator ( bool). (TMCLOCK_VIRTUAL) */313 bool fVirtualTicking;312 /** Virtual time ticking enabled indicator (counter for each VCPU). (TMCLOCK_VIRTUAL) */ 313 uint32_t cVirtualTicking; 314 314 /** Virtual time is not running at 100%. */ 315 315 bool fVirtualWarpDrive; … … 318 318 /** Virtual timer synchronous time catch-up active. */ 319 319 bool volatile fVirtualSyncCatchUp; 320 bool afAlignment[5]; /**< alignment padding */ 320 321 /** WarpDrive percentage. 321 322 * 100% is normal (fVirtualSyncNormal == true). When other than 100% we apply -
trunk/src/VBox/VMM/VMMAll/TMAllVirtual.cpp
r19300 r19324 327 327 { 328 328 uint64_t u64; 329 if (RT_LIKELY(pVM->tm.s. fVirtualTicking))329 if (RT_LIKELY(pVM->tm.s.cVirtualTicking)) 330 330 { 331 331 STAM_COUNTER_INC(&pVM->tm.s.StatVirtualGet); … … 413 413 * Query the virtual clock and do the usual expired timer check. 414 414 */ 415 Assert(pVM->tm.s. fVirtualTicking);415 Assert(pVM->tm.s.cVirtualTicking); 416 416 u64 = tmVirtualGetRaw(pVM); 417 417 if ( fCheckTimers … … 517 517 */ 518 518 if ( fCheckTimers 519 && pVM->tm.s. fVirtualTicking519 && pVM->tm.s.cVirtualTicking 520 520 && !VM_FF_ISSET(pVM, VM_FF_TIMER)) 521 521 { … … 597 597 VMMDECL(int) TMVirtualResume(PVM pVM) 598 598 { 599 if (!pVM->tm.s.fVirtualTicking) 599 /** @note this is done only in specific cases (vcpu 0 init, termination, debug, out of memory conditions; 600 * there is at least a race for fVirtualSyncTicking. 601 */ 602 if (ASMAtomicIncU32(&pVM->tm.s.cVirtualTicking) == 1) 600 603 { 601 604 STAM_COUNTER_INC(&pVM->tm.s.StatVirtualResume); 602 pVM->tm.s.u64VirtualRawPrev = 0; 603 pVM->tm.s.u64VirtualWarpDriveStart = tmVirtualGetRawNanoTS(pVM); 604 pVM->tm.s.u64VirtualOffset = pVM->tm.s.u64VirtualWarpDriveStart - pVM->tm.s.u64Virtual; 605 pVM->tm.s.fVirtualTicking = true; 606 pVM->tm.s.fVirtualSyncTicking = true; 605 pVM->tm.s.u64VirtualRawPrev = 0; 606 pVM->tm.s.u64VirtualWarpDriveStart = tmVirtualGetRawNanoTS(pVM); 607 pVM->tm.s.u64VirtualOffset = pVM->tm.s.u64VirtualWarpDriveStart - pVM->tm.s.u64Virtual; 608 pVM->tm.s.fVirtualSyncTicking = true; 607 609 return VINF_SUCCESS; 608 610 } 609 610 AssertFailed(); 611 return VERR_INTERNAL_ERROR; 611 AssertReturn(pVM->tm.s.cVirtualTicking < pVM->cCPUs, VERR_INTERNAL_ERROR); 612 return VINF_SUCCESS; 612 613 } 613 614 … … 622 623 VMMDECL(int) TMVirtualPause(PVM pVM) 623 624 { 624 if (pVM->tm.s.fVirtualTicking) 625 /** @note this is done only in specific cases (vcpu 0 init, termination, debug, out of memory conditions; 626 * there is at least a race for fVirtualSyncTicking. 627 */ 628 if (ASMAtomicDecU32(&pVM->tm.s.cVirtualTicking) == 0) 625 629 { 626 630 STAM_COUNTER_INC(&pVM->tm.s.StatVirtualPause); 627 pVM->tm.s.u64Virtual = tmVirtualGetRaw(pVM); 628 pVM->tm.s.fVirtualSyncTicking = false; 629 pVM->tm.s.fVirtualTicking = false; 631 pVM->tm.s.u64Virtual = tmVirtualGetRaw(pVM); 632 pVM->tm.s.fVirtualSyncTicking = false; 630 633 return VINF_SUCCESS; 631 634 } 632 633 AssertFailed(); 634 return VERR_INTERNAL_ERROR; 635 AssertReturn(pVM->tm.s.cVirtualTicking < pVM->cCPUs, VERR_INTERNAL_ERROR); 636 return VINF_SUCCESS; 635 637 } 636 638 … … 696 698 * the warp drive settings. 697 699 */ 698 bool fPaused = pVM->tm.s.fVirtualTicking;700 bool fPaused = !!pVM->tm.s.cVirtualTicking; 699 701 if (fPaused) 700 702 { -
trunk/src/VBox/VMM/testcase/tstVMStructGC.cpp
r19286 r19324 769 769 GEN_CHECK_OFF(TMCPU, u64TSC); 770 770 GEN_CHECK_OFF(TM, cTSCTicksPerSecond); 771 GEN_CHECK_OFF(TM, fVirtualTicking);771 GEN_CHECK_OFF(TM, cVirtualTicking); 772 772 GEN_CHECK_OFF(TM, fVirtualWarpDrive); 773 773 GEN_CHECK_OFF(TM, fVirtualSyncTicking);
Note:
See TracChangeset
for help on using the changeset viewer.