- Timestamp:
- Feb 16, 2015 11:08:27 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 98278
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r54201 r54214 332 332 * CPUs. */ 333 333 bool fOsTscDeltasInSync; 334 uint8_t au8Padding0[3]; 334 /** Whether the TSC deltas are small enough to not bother applying. */ 335 bool fTscDeltasRoughlyInSync; 336 uint8_t au8Padding0[2]; 335 337 336 338 /** Padding / reserved space for future data. */ -
trunk/include/VBox/sup.mac
r53800 r54214 68 68 .idCpuMax resd 1 69 69 .fOsTscDeltasInSync resb 1 70 .au8Padding0 resb 3 70 .fTscDeltasRoughlyInSync resb 1 71 .au8Padding0 resb 2 71 72 .au32Padding1 resd 26 72 73 .aiCpuFromApicId resw 256 -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r54205 r54214 124 124 /** The TSC-refinement interval in seconds. */ 125 125 #define GIP_TSC_REFINE_INTERVAL 5 126 /** The TSC-delta threshold (in ticks) for whether it's worth applying them or 127 * not for performance reasons, see @bugref{6710} comment #124. */ 128 #define GIP_TSC_DELTA_APPLY_THRESHOLD 384 126 129 127 130 AssertCompile(GIP_TSC_DELTA_PRIMER_LOOPS < GIP_TSC_DELTA_READ_TIME_LOOPS); … … 7265 7268 if (RT_UNLIKELY(pGipCpuWorker->i64TSCDelta == INT64_MAX)) 7266 7269 rc = VERR_SUPDRV_TSC_DELTA_MEASUREMENT_FAILED; 7270 else if ( pGipCpuWorker->i64TSCDelta > GIP_TSC_DELTA_APPLY_THRESHOLD 7271 || pGipCpuWorker->i64TSCDelta < -GIP_TSC_DELTA_APPLY_THRESHOLD) 7272 { 7273 pGip->fTscDeltasRoughlyInSync = false; 7274 } 7267 7275 } 7268 7276 } … … 7595 7603 7596 7604 /* 7605 * Initialize the structure. 7606 */ 7607 memset(pGip, 0, cbGip); 7608 7609 /* 7597 7610 * Record whether the host OS has already normalized inter-CPU deltas for the hardware TSC. 7598 7611 * We only bother with TSC-deltas on invariant CPUs for now. … … 7600 7613 pGip->fOsTscDeltasInSync = supdrvIsInvariantTsc() && supdrvOSAreTscDeltasInSync(); 7601 7614 7602 /* 7603 * Initialize the structure. 7604 */ 7605 memset(pGip, 0, cbGip); 7606 pGip->u32Magic = SUPGLOBALINFOPAGE_MAGIC; 7607 pGip->u32Version = SUPGLOBALINFOPAGE_VERSION; 7608 pGip->u32Mode = supdrvGipDetermineTscMode(pDevExt); 7609 pGip->cCpus = (uint16_t)cCpus; 7610 pGip->cPages = (uint16_t)(cbGip / PAGE_SIZE); 7611 pGip->u32UpdateHz = uUpdateHz; 7612 pGip->u32UpdateIntervalNS = uUpdateIntervalNS; 7615 pGip->fTscDeltasRoughlyInSync = true; 7616 pGip->u32Magic = SUPGLOBALINFOPAGE_MAGIC; 7617 pGip->u32Version = SUPGLOBALINFOPAGE_VERSION; 7618 pGip->u32Mode = supdrvGipDetermineTscMode(pDevExt); 7619 pGip->cCpus = (uint16_t)cCpus; 7620 pGip->cPages = (uint16_t)(cbGip / PAGE_SIZE); 7621 pGip->u32UpdateHz = uUpdateHz; 7622 pGip->u32UpdateIntervalNS = uUpdateIntervalNS; 7613 7623 RTCpuSetEmpty(&pGip->OnlineCpuSet); 7614 7624 RTCpuSetEmpty(&pGip->PresentCpuSet); 7615 7625 RTMpGetSet(&pGip->PossibleCpuSet); 7616 pGip->cOnlineCpus = RTMpGetOnlineCount();7617 pGip->cPresentCpus = RTMpGetPresentCount();7618 pGip->cPossibleCpus = RTMpGetCount();7619 pGip->idCpuMax = RTMpGetMaxCpuId();7626 pGip->cOnlineCpus = RTMpGetOnlineCount(); 7627 pGip->cPresentCpus = RTMpGetPresentCount(); 7628 pGip->cPossibleCpus = RTMpGetCount(); 7629 pGip->idCpuMax = RTMpGetMaxCpuId(); 7620 7630 for (i = 0; i < RT_ELEMENTS(pGip->aiCpuFromApicId); i++) 7621 7631 pGip->aiCpuFromApicId[i] = UINT16_MAX; -
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r53455 r54214 251 251 RTPrintf("tstGIP-2: offline: %lld\n", g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta); 252 252 253 RTPrintf("fTscDeltasRoughlyInSync: %RTbool\n", g_pSUPGlobalInfoPage->fTscDeltasRoughlyInSync); 253 254 RTPrintf("CPUID.Invariant-TSC : %RTbool\n", tstIsInvariantTsc()); 254 255 if ( uCpuHzRef -
trunk/src/VBox/VMM/VMMR3/TM.cpp
r54206 r54214 619 619 * Dump the GIPCPU TSC-deltas, iterate using the Apic Id to get master at the beginning in most cases. 620 620 */ 621 LogRel(("TM: GIP - fTscDeltasRoughlyInSync=%RTbool\n", g_pSUPGlobalInfoPage->fTscDeltasRoughlyInSync)); 621 622 unsigned cGipCpus = RT_ELEMENTS(g_pSUPGlobalInfoPage->aiCpuFromApicId); 622 623 for (unsigned i = 0; i < cGipCpus; i++)
Note:
See TracChangeset
for help on using the changeset viewer.