VirtualBox

Changeset 20674 in vbox


Ignore:
Timestamp:
Jun 17, 2009 4:04:53 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48773
Message:

Grab the PGM lock in PGMPhysSimpleReadGCPtr

File:
1 edited

Legend:

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

    r20567 r20674  
    22432243        return VINF_SUCCESS;
    22442244
     2245    /* Take the PGM lock here, because many called functions take the lock for a very short period. That's counter-productive
     2246     * when many VCPUs are fighting for the lock.
     2247     */
     2248    pgmLock(pVM);
     2249
    22452250    /* map the 1st page */
    22462251    void const *pvSrc;
     
    22482253    int rc = PGMPhysGCPtr2CCPtrReadOnly(pVCpu, GCPtrSrc, &pvSrc, &Lock);
    22492254    if (RT_FAILURE(rc))
     2255    {
     2256        pgmUnlock(pVM);
    22502257        return rc;
     2258    }
    22512259
    22522260    /* optimize for the case where access is completely within the first page. */
     
    22562264        memcpy(pvDst, pvSrc, cb);
    22572265        PGMPhysReleasePageMappingLock(pVM, &Lock);
     2266        pgmUnlock(pVM);
    22582267        return VINF_SUCCESS;
    22592268    }
     
    22742283        rc = PGMPhysGCPtr2CCPtrReadOnly(pVCpu, GCPtrSrc, &pvSrc, &Lock);
    22752284        if (RT_FAILURE(rc))
     2285        {
     2286            pgmUnlock(pVM);
    22762287            return rc;
     2288        }
    22772289
    22782290        /* last page? */
     
    22812293            memcpy(pvDst, pvSrc, cb);
    22822294            PGMPhysReleasePageMappingLock(pVM, &Lock);
     2295            pgmUnlock(pVM);
    22832296            return VINF_SUCCESS;
    22842297        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette