VirtualBox

Changeset 53369 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 21, 2014 12:08:21 PM (10 years ago)
Author:
vboxsync
Message:

HostDrivers/Support: minimize interrupt disabled time while measuring TSC deltas, thanks to Windows watchdog.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPDrv.c

    r53288 r53369  
    66126612                idxNewGipMaster = supdrvGipCpuIndexFromCpuId(pGip, idNewGipMaster);
    66136613                iTSCDelta       = pGip->aCPUs[idxNewGipMaster].i64TSCDelta;
    6614                 Assert(iTSCDelta != UINT64_MAX);
     6614                Assert(iTSCDelta != INT64_MAX);
    66156615                for (i = 0; i < pGip->cCpus; i++)
    66166616                {
     
    67506750    while (cTriesLeft-- > 0)
    67516751    {
    6752         unsigned    i;
    6753         uint64_t    uMinCmpReadTime = UINT64_MAX;
     6752        unsigned i;
     6753        uint64_t uMinCmpReadTime = UINT64_MAX;
    67546754        for (i = 0; i < GIP_TSC_DELTA_LOOPS; i++)
    67556755        {
    6756             RTCCUINTREG uFlags = ASMIntDisableFlags();   /* Disable interrupts per-iteration, see @bugref{6710} comment #38. */
    67576756            if (idCpu == idMaster)
    67586757            {
     
    67606759                 * The master.
    67616760                 */
     6761                RTCCUINTREG uFlags;
    67626762                Assert(pGipCpuMaster->u64TSCSample == GIP_TSC_DELTA_RSVD);
    67636763                ASMAtomicWriteU32(&g_pTscDeltaSync->u, GIP_TSC_DELTA_SYNC_START);
     6764
     6765                /* Disable interrupts only in the master for as short a period
     6766                   as possible, thanks again to Windows. See @bugref{6710} comment #73. */
     6767                uFlags = ASMIntDisableFlags();
     6768
    67646769                while (ASMAtomicReadU32(&g_pTscDeltaSync->u) == GIP_TSC_DELTA_SYNC_START)
    67656770                    ;
     
    67706775                    ASMAtomicWriteU64(&pGipCpuMaster->u64TSCSample, ASMReadTSC());
    67716776                } while (pGipCpuMaster->u64TSCSample == GIP_TSC_DELTA_RSVD);
     6777
     6778                ASMSetFlags(uFlags);
    67726779
    67736780                while (ASMAtomicReadU32(&g_pTscDeltaSync->u) != GIP_TSC_DELTA_SYNC_WORKER_DONE)
     
    68396846                    ASMNopPause();
    68406847            }
    6841 
    6842             ASMSetFlags(uFlags);
    68436848        }
    68446849
Note: See TracChangeset for help on using the changeset viewer.

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