VirtualBox

Changeset 90445 in vbox


Ignore:
Timestamp:
Jul 30, 2021 10:18:24 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146049
Message:

Dev*: Check PDMDevHlpCritSectEnter return status better. bugref:6695

Location:
trunk/src/VBox/Devices
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Bus/DevIommuAmd.cpp

    r90436 r90445  
    173173
    174174/** Acquires the cache lock. */
    175 #ifdef IN_RING3
    176 # define IOMMU_CACHE_LOCK(a_pDevIns, a_pThis)       PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSectCache, VERR_IGNORED)
    177 #else
    178 # define IOMMU_CACHE_LOCK(a_pDevIns, a_pThis) \
     175# ifdef IN_RING3
     176#  define IOMMU_CACHE_LOCK(a_pDevIns, a_pThis)      PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSectCache, VERR_IGNORED)
     177# else
     178#  define IOMMU_CACHE_LOCK(a_pDevIns, a_pThis) \
    179179    do { \
    180180        int const rcLock = PDMDevHlpCritSectEnter((a_pDevIns), &(a_pThis)->CritSectCache, VINF_SUCCESS); \
    181         AssertRC(rcLock); \
     181        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV((a_pDevIns), &(a_pThis)->CritSectCache, rcLock); \
    182182    } while (0)
    183 #endif
     183# endif
    184184
    185185/** Releases the cache lock.  */
  • trunk/src/VBox/Devices/PC/DevRTC.cpp

    r89735 r90445  
    924924    pHlp->pfnSSMGetS64(pSSM, &pThis->next_second_time);
    925925    PDMDevHlpTimerLoad(pDevIns, pThis->hSecondTimer, pSSM);
    926     PDMDevHlpTimerLoad(pDevIns, pThis->hSecondTimer2, pSSM);
     926    rc = PDMDevHlpTimerLoad(pDevIns, pThis->hSecondTimer2, pSSM);
     927    AssertRCReturn(rc, rc);
    927928
    928929    if (uVersion > RTC_SAVED_STATE_VERSION_VBOX_31)
    929          pHlp->pfnSSMGetBool(pSSM, &pThis->fDisabledByHpet);
     930    {
     931        rc = pHlp->pfnSSMGetBool(pSSM, &pThis->fDisabledByHpet);
     932        AssertRCReturn(rc, rc);
     933    }
    930934
    931935    if (uVersion > RTC_SAVED_STATE_VERSION_VBOX_32PRE)
     
    933937        /* Second CMOS bank. */
    934938        pHlp->pfnSSMGetMem(pSSM, &pThis->cmos_data[CMOS_BANK_SIZE], CMOS_BANK_SIZE);
    935         pHlp->pfnSSMGetU8(pSSM, &pThis->cmos_index[1]);
     939        rc = pHlp->pfnSSMGetU8(pSSM, &pThis->cmos_index[1]);
     940        AssertRCReturn(rc, rc);
    936941    }
    937942
     
    944949        int period = 1 << (period_code - 1);
    945950        LogRel(("RTC: period=%#x (%d) %u Hz (restore)\n", period, period, _32K / period));
    946         PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VINF_SUCCESS);
     951        rc = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VINF_SUCCESS);
     952        AssertRCReturn(rc, rc);
    947953        PDMDevHlpTimerSetFrequencyHint(pDevIns, pThis->hPeriodicTimer, _32K / period);
    948954        PDMDevHlpCritSectLeave(pDevIns, pDevIns->pCritSectRoR3);
  • trunk/src/VBox/Devices/Parallel/DevParallel.cpp

    r90332 r90445  
    304304    PPARALLELPORT   pThis   = PDMDEVINS_2_DATA(pDevIns, PPARALLELPORT);
    305305
    306     PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VINF_SUCCESS);
     306    int rc = PDMDevHlpCritSectEnter(pDevIns, pDevIns->pCritSectRoR3, VINF_SUCCESS);
     307    AssertRCReturn(rc, rc);
     308
    307309    parallelR3IrqSet(pDevIns, pThis);
     310
    308311    PDMDevHlpCritSectLeave(pDevIns, pDevIns->pCritSectRoR3);
    309312
  • trunk/src/VBox/Devices/Serial/UartCore.cpp

    r90332 r90445  
    877877            PDMDevHlpTimerSetRelative(pDevIns, pThis->hTimerTxUnconnected, pThis->cSymbolXferTicks, NULL);
    878878
    879         PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VINF_SUCCESS);
     879        rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VINF_SUCCESS);
    880880    }
    881881#endif
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r90209 r90445  
    897897{
    898898    int rc = PDMDevHlpCritSectEnter(pDevIns, &pCtl->AsyncIORequestLock, VINF_SUCCESS);
    899     AssertRC(rc);
     899    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->AsyncIORequestLock, rc);
    900900
    901901    pCtl->AsyncIOReqHead = 0;
     
    910910{
    911911    int rc = PDMDevHlpCritSectEnter(pDevIns, &pCtl->AsyncIORequestLock, VINF_SUCCESS);
    912     AssertRC(rc);
     912    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->AsyncIORequestLock, rc);
    913913
    914914    uint8_t const iAsyncIORequest = pCtl->AsyncIOReqHead % RT_ELEMENTS(pCtl->aAsyncIORequests);
     
    935935
    936936    int rc = PDMDevHlpCritSectEnter(pDevIns, &pCtl->AsyncIORequestLock, VINF_SUCCESS);
    937     AssertRC(rc);
     937    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->AsyncIORequestLock, rc);
    938938
    939939    if (pCtl->AsyncIOReqHead != pCtl->AsyncIOReqTail)
     
    960960{
    961961    int rc = PDMDevHlpCritSectEnter(pDevIns, &pCtl->AsyncIORequestLock, VINF_SUCCESS);
    962     AssertRC(rc);
     962    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->AsyncIORequestLock, rc);
    963963
    964964    if (pCtl->AsyncIOReqHead != pCtl->AsyncIOReqTail && pCtl->aAsyncIORequests[pCtl->AsyncIOReqTail].ReqType == ReqType)
     
    984984{
    985985    int rc = PDMDevHlpCritSectEnter(pDevIns, &pCtl->AsyncIORequestLock, VINF_SUCCESS);
    986     AssertRC(rc);
     986    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->AsyncIORequestLock, rc);
    987987
    988988    LogRel(("PIIX3 ATA: Ctl#%d: request queue dump (topmost is current):\n", pCtl->iCtl));
     
    10381038{
    10391039    int rc = PDMDevHlpCritSectEnter(pDevIns, &pCtl->AsyncIORequestLock, VINF_SUCCESS);
    1040     AssertRC(rc);
     1040    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->AsyncIORequestLock, rc);
    10411041
    10421042    bool fIdle = pCtl->fRedoIdle;
     
    12681268{
    12691269    STAM_PROFILE_START(&pCtl->StatLockWait, a);
    1270     PDMDevHlpCritSectEnter(pDevIns, &pCtl->lock, VINF_SUCCESS);
     1270    int const rcLock = PDMDevHlpCritSectEnter(pDevIns, &pCtl->lock, VINF_SUCCESS);
     1271    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->lock, rcLock);
    12711272    STAM_PROFILE_STOP(&pCtl->StatLockWait, a);
    12721273}
     
    57665767     */
    57675768    int rc = PDMDevHlpCritSectEnter(pDevIns, &pCtl->AsyncIORequestLock, VINF_SUCCESS);
    5768     AssertRC(rc);
     5769    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pCtl->AsyncIORequestLock, rc);
    57695770
    57705771    if (    pCtlR3->fSignalIdle
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r89266 r90445  
    13751375
    13761376    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSectIntr, VINF_SUCCESS);
    1377     AssertRC(rc);
     1377    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->CritSectIntr, rc);
    13781378
    13791379    RTGCPHYS GCPhysAddrMailboxIncoming = pThis->GCPhysAddrMailboxIncomingBase
  • trunk/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp

    r89196 r90445  
    729729static void lsilogicR3FinishContextReply(PPDMDEVINS pDevIns, PLSILOGICSCSI pThis, uint32_t u32MessageContext)
    730730{
    731     int rc;
    732 
    733731    LogFlowFunc(("pThis=%#p u32MessageContext=%#x\n", pThis, u32MessageContext));
    734732
     
    736734
    737735    /* Write message context ID into reply post queue. */
    738     rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->ReplyPostQueueCritSect, VINF_SUCCESS);
    739     AssertRC(rc);
     736    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->ReplyPostQueueCritSect, VINF_SUCCESS);
     737    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->ReplyPostQueueCritSect, rc);
    740738
    741739    /* Check for a entry in the queue. */
     
    792790         */
    793791# ifdef IN_RING3
    794         int rc;
    795792        /* Grab a free reply message from the queue. */
    796         rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->ReplyFreeQueueCritSect, VINF_SUCCESS);
    797         AssertRC(rc);
     793        int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->ReplyFreeQueueCritSect, VINF_SUCCESS);
     794        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->ReplyFreeQueueCritSect, rc);
    798795
    799796        /* Check for a free reply frame. */
     
    822819        /* Write low 32bits of reply frame into post reply queue. */
    823820        rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->ReplyPostQueueCritSect, VINF_SUCCESS);
    824         AssertRC(rc);
     821        PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->ReplyPostQueueCritSect, rc);
    825822
    826823        /* Check for a entry in the queue. */
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