VirtualBox

Changeset 106274 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Oct 10, 2024 8:07:33 AM (5 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165069
Message:

DevBusLogic: CritSectIntr also needs to protect uMailboxIncomingPositionCurrent (see bugref:10740).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r106061 r106274  
    420420    RTGCPHYS                        GCPhysAddrMailboxIncomingBase;
    421421
    422     /** Critical section protecting access to the interrupt status register. */
     422    /** Critical section protecting access to the interrupt status register and uMailboxIncomingPositionCurrent. */
    423423    PDMCRITSECT                     CritSectIntr;
    424424
     
    13911391    MbxIn.u.in.uCompletionCode     = uMailboxCompletionCode;
    13921392
     1393    int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSectIntr, VINF_SUCCESS);
     1394    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->CritSectIntr, rc);
     1395
    13931396    RTGCPHYS GCPhysAddrMailboxIncoming = pThis->GCPhysAddrMailboxIncomingBase
    13941397                                       + (   pThis->uMailboxIncomingPositionCurrent
    13951398                                          * (pThis->fMbxIs24Bit ? sizeof(Mailbox24) : sizeof(Mailbox32)) );
    13961399
     1400    /* Advance to next mailbox position. */
     1401    pThis->uMailboxIncomingPositionCurrent++;
     1402    if (pThis->uMailboxIncomingPositionCurrent >= pThis->cMailbox)
     1403        pThis->uMailboxIncomingPositionCurrent = 0;
     1404
     1405    PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSectIntr);
     1406
    13971407    if (uMailboxCompletionCode != BUSLOGIC_MAILBOX_INCOMING_COMPLETION_ABORTED_NOT_FOUND)
    13981408    {
    1399         LogFlowFunc(("Completing CCB %RGp hstat=%u, dstat=%u, outgoing mailbox at %RGp\n", GCPhysAddrCCB,
     1409        LogFlowFunc(("Completing CCB %RGp hstat=%u, dstat=%u, incoming mailbox at %RGp\n", GCPhysAddrCCB,
    14001410                     uHostAdapterStatus, uDeviceStatus, GCPhysAddrMailboxIncoming));
    14011411
     
    14301440    }
    14311441
    1432     int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSectIntr, VINF_SUCCESS);
     1442    rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSectIntr, VINF_SUCCESS);
    14331443    PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->CritSectIntr, rc);
    1434 
    1435     /* Advance to next mailbox position. */
    1436     pThis->uMailboxIncomingPositionCurrent++;
    1437     if (pThis->uMailboxIncomingPositionCurrent >= pThis->cMailbox)
    1438         pThis->uMailboxIncomingPositionCurrent = 0;
    14391444
    14401445# ifdef LOG_ENABLED
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