VirtualBox

Changeset 35756 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jan 28, 2011 12:29:38 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69717
Message:

BusLogic: Fix SMP race which results in a guest hang

File:
1 edited

Legend:

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

    r35631 r35756  
    23452345{
    23462346    PBUSLOGIC  pBusLogic = PDMINS_2_DATA(pDevIns, PBUSLOGIC);
    2347 
    2348     AssertMsg(pBusLogic->cMailboxesReady > 0, ("Got notification without any mailboxes ready\n"));
     2347    uint32_t cMailboxesReady = 0;
    23492348
    23502349    /* Reset notification send flag now. */
     2350    Assert(pBusLogic->fNotificationSend);
    23512351    ASMAtomicXchgBool(&pBusLogic->fNotificationSend, false);
     2352
     2353    /*
     2354     * It is possible that there is a notification send but that there is no mailbox ready
     2355     * in the SMP case. Just do nothing.
     2356     */
     2357    cMailboxesReady = ASMAtomicXchgU32(&pBusLogic->cMailboxesReady, 0);
     2358    if (!cMailboxesReady)
     2359        return true;
    23522360
    23532361    /* Process mailboxes. */
     
    23582366        rc = buslogicProcessMailboxNext(pBusLogic);
    23592367        AssertMsgRC(rc, ("Processing mailbox failed rc=%Rrc\n", rc));
    2360     } while (ASMAtomicDecU32(&pBusLogic->cMailboxesReady) > 0);
     2368    } while (--cMailboxesReady > 0);
    23612369
    23622370    return true;
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