VirtualBox

Changeset 19480 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
May 7, 2009 12:05:40 PM (16 years ago)
Author:
vboxsync
Message:

Release the PGM lock when calling physical handlers (PGMPhysRead/Write). Deadlock prevent with IOM lock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r19180 r19480  
    14201420        Log5(("pgmPhysReadHandler: GCPhys=%RGp cb=%#x pPage=%R[pgmpage] phys %s\n", GCPhys, cb, pPage, R3STRING(pPhys->pszDesc) ));
    14211421        STAM_PROFILE_START(&pPhys->Stat, h);
     1422        Assert(PGMIsLockOwner(pVM));
     1423        /* Release the PGM lock as MMIO handlers take the IOM lock. (deadlock prevention) */
     1424        pgmUnlock(pVM);
    14221425        rc = pPhys->CTX_SUFF(pfnHandler)(pVM, GCPhys, (void *)pvSrc, pvBuf, cb, PGMACCESSTYPE_READ, pPhys->CTX_SUFF(pvUser));
     1426        pgmLock(pVM);
    14231427        STAM_PROFILE_STOP(&pPhys->Stat, h);
    14241428        AssertLogRelMsg(rc == VINF_SUCCESS || rc == VINF_PGM_HANDLER_DO_DEFAULT, ("rc=%Rrc GCPhys=%RGp\n", rc, GCPhys));
     
    16461650            {
    16471651                STAM_PROFILE_START(&pCur->Stat, h);
     1652                Assert(PGMIsLockOwner(pVM));
     1653                /* Release the PGM lock as MMIO handlers take the IOM lock. (deadlock prevention) */
     1654                pgmUnlock(pVM);
    16481655                rc = pCur->CTX_SUFF(pfnHandler)(pVM, GCPhys, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE, pCur->CTX_SUFF(pvUser));
     1656                pgmLock(pVM);
    16491657                STAM_PROFILE_STOP(&pCur->Stat, h);
    16501658                if (rc == VINF_PGM_HANDLER_DO_DEFAULT)
     
    18451853            Log5(("pgmPhysWriteHandler: GCPhys=%RGp cbRange=%#x pPage=%R[pgmpage] phys %s\n", GCPhys, cbRange, pPage, R3STRING(pPhys->pszDesc) ));
    18461854            STAM_PROFILE_START(&pPhys->Stat, h);
     1855            Assert(PGMIsLockOwner(pVM));
     1856            /* Release the PGM lock as MMIO handlers take the IOM lock. (deadlock prevention) */
     1857            pgmUnlock(pVM);
    18471858            rc = pPhys->CTX_SUFF(pfnHandler)(pVM, GCPhys, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE, pPhys->CTX_SUFF(pvUser));
     1859            pgmLock(pVM);
    18481860            STAM_PROFILE_STOP(&pPhys->Stat, h);
    18491861            AssertLogRelMsg(rc == VINF_SUCCESS || rc == VINF_PGM_HANDLER_DO_DEFAULT, ("rc=%Rrc GCPhys=%RGp pPage=%R[pgmpage] %s\n", rc, GCPhys, pPage, pPhys->pszDesc));
     
    19021914
    19031915            STAM_PROFILE_START(&pPhys->Stat, h);
     1916            Assert(PGMIsLockOwner(pVM));
     1917            /* Release the PGM lock as MMIO handlers take the IOM lock. (deadlock prevention) */
     1918            pgmUnlock(pVM);
    19041919            rc = pPhys->CTX_SUFF(pfnHandler)(pVM, GCPhys, pvDst, (void *)pvBuf, cbRange, PGMACCESSTYPE_WRITE, pPhys->CTX_SUFF(pvUser));
     1920            pgmLock(pVM);
    19051921            STAM_PROFILE_STOP(&pPhys->Stat, h);
    19061922            AssertLogRelMsg(rc == VINF_SUCCESS || rc == VINF_PGM_HANDLER_DO_DEFAULT, ("rc=%Rrc GCPhys=%RGp pPage=%R[pgmpage] %s\n", rc, GCPhys, pPage, pPhys->pszDesc));
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