VirtualBox

Changeset 54214 in vbox for trunk


Ignore:
Timestamp:
Feb 16, 2015 11:08:27 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
98278
Message:

HostDrivers/Support, testcase, TM: Add fTscDeltasRoughlyInSync.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/sup.h

    r54201 r54214  
    332332     *  CPUs. */
    333333    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];
    335337
    336338    /** Padding / reserved space for future data. */
  • trunk/include/VBox/sup.mac

    r53800 r54214  
    6868    .idCpuMax                   resd 1
    6969    .fOsTscDeltasInSync         resb 1
    70     .au8Padding0                resb 3
     70    .fTscDeltasRoughlyInSync    resb 1
     71    .au8Padding0                resb 2
    7172    .au32Padding1               resd 26
    7273    .aiCpuFromApicId            resw 256
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r54205 r54214  
    124124/** The TSC-refinement interval in seconds. */
    125125#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
    126129
    127130AssertCompile(GIP_TSC_DELTA_PRIMER_LOOPS < GIP_TSC_DELTA_READ_TIME_LOOPS);
     
    72657268            if (RT_UNLIKELY(pGipCpuWorker->i64TSCDelta == INT64_MAX))
    72667269                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            }
    72677275        }
    72687276    }
     
    75957603
    75967604    /*
     7605     * Initialize the structure.
     7606     */
     7607    memset(pGip, 0, cbGip);
     7608
     7609    /*
    75977610     * Record whether the host OS has already normalized inter-CPU deltas for the hardware TSC.
    75987611     * We only bother with TSC-deltas on invariant CPUs for now.
     
    76007613    pGip->fOsTscDeltasInSync = supdrvIsInvariantTsc() && supdrvOSAreTscDeltasInSync();
    76017614
    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;
    76137623    RTCpuSetEmpty(&pGip->OnlineCpuSet);
    76147624    RTCpuSetEmpty(&pGip->PresentCpuSet);
    76157625    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();
    76207630    for (i = 0; i < RT_ELEMENTS(pGip->aiCpuFromApicId); i++)
    76217631        pGip->aiCpuFromApicId[i]    = UINT16_MAX;
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp

    r53455 r54214  
    251251                    RTPrintf("tstGIP-2: offline: %lld\n", g_pSUPGlobalInfoPage->aCPUs[iCpu].i64TSCDelta);
    252252
     253            RTPrintf("fTscDeltasRoughlyInSync: %RTbool\n", g_pSUPGlobalInfoPage->fTscDeltasRoughlyInSync);
    253254            RTPrintf("CPUID.Invariant-TSC    : %RTbool\n", tstIsInvariantTsc());
    254255            if (   uCpuHzRef
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r54206 r54214  
    619619     * Dump the GIPCPU TSC-deltas, iterate using the Apic Id to get master at the beginning in most cases.
    620620     */
     621    LogRel(("TM: GIP - fTscDeltasRoughlyInSync=%RTbool\n", g_pSUPGlobalInfoPage->fTscDeltasRoughlyInSync));
    621622    unsigned cGipCpus = RT_ELEMENTS(g_pSUPGlobalInfoPage->aiCpuFromApicId);
    622623    for (unsigned i = 0; i < cGipCpus; i++)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette