Changeset 54214 in vbox for trunk/src/VBox/HostDrivers/Support/SUPDrv.c
- Timestamp:
- Feb 16, 2015 11:08:27 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 98278
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.