VirtualBox

Changeset 92872 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Dec 11, 2021 12:29:18 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
148819
Message:

IPRT/timer-r0drv-nt.cpp: Corrected the CPU parameter for rtMpNtSetTargetProcessorDpc in the fSpecificCpu case, we were passing the idCpu instead of the set index. Skip setting uNtStartTime and uNtDueTime when starting a one-shot timer. Skip dequeuing DPCs when stopping high-res timers that aren't targetting a specific CPU or are omni timers, as we don't be using any DPCs then.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp

    r92869 r92872  
    114114    uint64_t volatile       iMasterTick;
    115115#ifdef RTR0TIMER_NT_MANUAL_RE_ARM
    116     /** The desired NT time of the first tick. */
     116    /** The desired NT time of the first tick.
     117     *  This is not set for one-shot timers, only periodic ones. */
    117118    uint64_t volatile       uNtStartTime;
    118     /** The current due time (absolute interrupt time). */
     119    /** The current due time (absolute interrupt time).
     120     *  This is not set for one-shot timers, only periodic ones.  */
    119121    uint64_t volatile       uNtDueTime;
    120122#endif
     
    611613    /* Update timer state: */
    612614#ifdef RTR0TIMER_NT_MANUAL_RE_ARM
    613 # ifdef RTR0TIMER_NT_HIGH_RES
    614     uint64_t const uNtNow = pTimer->pHighResTimer ? rtTimerNtQueryInterruptTimeHighRes() : rtTimerNtQueryInterruptTime();
     615    if (pTimer->u64NanoInterval > 0)
     616    {
     617#ifdef RTR0TIMER_NT_HIGH_RES
     618        uint64_t const uNtNow = pTimer->pHighResTimer ? rtTimerNtQueryInterruptTimeHighRes() : rtTimerNtQueryInterruptTime();
    615619# else
    616     uint64_t const uNtNow = rtTimerNtQueryInterruptTime();
     620        uint64_t const uNtNow = rtTimerNtQueryInterruptTime();
    617621# endif
    618     pTimer->uNtStartTime = uNtNow + -DueTime.QuadPart;
    619 #endif
    620     ASMAtomicWriteS32(&pTimer->cOmniSuspendCountDown, 0);
     622        pTimer->uNtStartTime  = uNtNow + -DueTime.QuadPart;
     623        pTimer->uNtDueTime    = pTimer->uNtStartTime;
     624    }
     625#endif
     626    pTimer->cOmniSuspendCountDown = 0;
    621627    ASMAtomicWriteBool(&pTimer->fSuspended, false);
    622628
     
    678684#ifdef RTR0TIMER_NT_HIGH_RES
    679685        if (pTimer->pHighResTimer)
     686        {
    680687            g_pfnrtExCancelTimer(pTimer->pHighResTimer, NULL);
     688
     689            /* We can skip the DPC stuff, unless this is an omni timer or for a specific CPU. */
     690            if (!pTimer->fSpecificCpu && !pTimer->fOmniTimer)
     691                return VINF_SUCCESS;
     692        }
    681693        else
    682694#endif
     
    941953                g_pfnrtKeSetImportanceDpc(&pTimer->aSubTimers[0].NtDpc, HighImportance);
    942954            if (pTimer->fSpecificCpu)
    943                 rc = rtMpNtSetTargetProcessorDpc(&pTimer->aSubTimers[0].NtDpc, (int)pTimer->idCpu);
     955                rc = rtMpNtSetTargetProcessorDpc(&pTimer->aSubTimers[0].NtDpc, fFlags & RTTIMER_FLAGS_CPU_MASK);
    944956        }
    945957        if (RT_SUCCESS(rc))
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