Changeset 52871 in vbox
- Timestamp:
- Sep 26, 2014 3:12:49 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 96295
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r52818 r52871 6356 6356 6357 6357 /* 6358 * Pick the first CPU online as the master TSC and make it the new GIP master. 6358 * Pick the first CPU online as the master TSC and make it the new GIP master based 6359 * on the APIC ID. 6359 6360 * 6360 6361 * Technically we can simply use "idGipMaster" but doing this gives us master as CPU 0 … … 6363 6364 */ 6364 6365 supdrvClearTscSamples(pGip, true /* fClearDeltas */); 6365 for (iCpu = 0; iCpu < pGip->cCpus; iCpu++) 6366 { 6367 PSUPGIPCPU pGipCpu = &pGip->aCPUs[iCpu]; 6368 if (RTCpuSetIsMember(&pGip->OnlineCpuSet, pGipCpu->idCpu)) 6369 { 6370 idxMaster = iCpu; 6371 pGipCpu->i64TSCDelta = 0; 6372 break; 6366 for (iCpu = 0; iCpu < RT_ELEMENTS(pGip->aiCpuFromApicId); iCpu++) 6367 { 6368 uint16_t idxCpu = pGip->aiCpuFromApicId[iCpu]; 6369 if (idxCpu != UINT16_MAX) 6370 { 6371 PSUPGIPCPU pGipCpu = &pGip->aCPUs[idxCpu]; 6372 if (RTCpuSetIsMember(&pGip->OnlineCpuSet, pGipCpu->idCpu)) 6373 { 6374 idxMaster = idxCpu; 6375 pGipCpu->i64TSCDelta = 0; 6376 break; 6377 } 6373 6378 } 6374 6379 } … … 6646 6651 pGip->idCpuMax = RTMpGetMaxCpuId(); 6647 6652 for (i = 0; i < RT_ELEMENTS(pGip->aiCpuFromApicId); i++) 6648 pGip->aiCpuFromApicId[i] = 0;6653 pGip->aiCpuFromApicId[i] = UINT16_MAX; 6649 6654 for (i = 0; i < RT_ELEMENTS(pGip->aiCpuFromCpuSetIdx); i++) 6650 6655 pGip->aiCpuFromCpuSetIdx[i] = UINT16_MAX; -
trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
r52718 r52871 162 162 /* Display TSC deltas. */ 163 163 RTPrintf("tstGIP-2: TSC deltas:\n"); 164 for (unsigned iCpu = 0; iCpu < g_pSUPGlobalInfoPage->cCpus; iCpu++) 165 RTPrintf("tstGIP-2: %6d: %lld\n", iCpu, g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta); 164 RTPrintf("tstGIP-2: idApic: i64TSCDelta\n"); 165 for (unsigned i = 0; i < RT_ELEMENTS(g_pSUPGlobalInfoPage->aiCpuFromApicId); i++) 166 { 167 uint16_t iCpu = g_pSUPGlobalInfoPage->aiCpuFromApicId[i]; 168 if (iCpu != UINT16_MAX) 169 { 170 RTPrintf("tstGIP-2: %6d: %lld\n", g_pSUPGlobalInfoPage->aCPUs[iCpu].idApic, 171 g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta); 172 } 173 } 166 174 } 167 175 else
Note:
See TracChangeset
for help on using the changeset viewer.