VirtualBox

Changeset 87796 in vbox


Ignore:
Timestamp:
Feb 18, 2021 7:44:31 PM (4 years ago)
Author:
vboxsync
Message:

VMM/TM: The caller of TMR0TimerQueueGrow must own the queue critsect exclusively. bugref:9943

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/TMR0.cpp

    r87795 r87796  
    7676
    7777
     78/**
     79 * Grows the timer array for @a idxQueue to at least @a cMinTimers entries.
     80 *
     81 * @returns VBox status code.
     82 * @param   pGVM            The ring-0 VM structure.
     83 * @param   idxQueue        The index of the queue to grow.
     84 * @param   cMinTimers      The minimum growth target.
     85 * @thread  EMT
     86 * @note    Caller must own the queue lock exclusively.
     87 */
    7888VMMR0_INT_DECL(int) TMR0TimerQueueGrow(PGVM pGVM, uint32_t idxQueue, uint32_t cMinTimers)
    7989{
     
    8797    PTMTIMERQUEUER0 pQueueR0     = &pGVM->tmr0.s.aTimerQueues[idxQueue];
    8898    PTMTIMERQUEUE   pQueueShared = &pGVM->tm.s.aTimerQueues[idxQueue];
     99    AssertMsgReturn(PDMCritSectRwIsWriteOwner(&pQueueShared->AllocLock),
     100                    ("queue=%s %.*Rhxs\n", pQueueShared->szName, sizeof(pQueueShared->AllocLock), &pQueueShared->AllocLock),
     101                    VERR_NOT_OWNER);
    89102
    90103    uint32_t cNewTimers = cMinTimers;
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r87794 r87796  
    11291129        if (s_aExtra[i].cExtra > pQueue->cTimersFree)
    11301130        {
     1131            PDMCritSectRwEnterExcl(&pQueue->AllocLock, VERR_IGNORED);
    11311132            uint32_t cTimersAlloc = pQueue->cTimersAlloc + s_aExtra[i].cExtra - pQueue->cTimersFree;
    11321133            rc = VMMR3CallR0Emt(pVM, VMMGetCpu(pVM), VMMR0_DO_TM_GROW_TIMER_QUEUE,
    11331134                                RT_MAKE_U64(cTimersAlloc, s_aExtra[i].idxQueue), NULL);
    11341135            AssertLogRelMsgReturn(RT_SUCCESS(rc), ("rc=%Rrc cTimersAlloc=%u %s\n", rc, cTimersAlloc, pQueue->szName), rc);
     1136            PDMCritSectRwLeaveExcl(&pQueue->AllocLock);
    11351137        }
    11361138    }
     
    15671569 *
    15681570 * @param   pVM         The cross context VM structure.
    1569  * @param   pTimer      The timer to register statistics for.
     1571 * @param   pQueue      The queue to register statistics for.
    15701572 * @param   cTimers     Number of timers to consider (in growth scenario).
    15711573 */
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