VirtualBox

Changeset 30066 in vbox


Ignore:
Timestamp:
Jun 7, 2010 12:37:52 PM (15 years ago)
Author:
vboxsync
Message:

PGMAllPhyc.cpp: Must grab the pgm lock before accessing the page array in PGMPhysGCPhys2CCPtr and PGMPhysGCPhys2CCPtrReadOnly, esp. in the former as it may have to make the page writable.

File:
1 edited

Legend:

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

    r29250 r30066  
    12451245VMMDECL(int) PGMPhysGCPhys2CCPtr(PVM pVM, RTGCPHYS GCPhys, void **ppv, PPGMPAGEMAPLOCK pLock)
    12461246{
     1247    int rc = pgmLock(pVM);
     1248    AssertRCReturn(rc, rc);
     1249
    12471250#if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    1248 
    12491251    /*
    12501252     * Find the page and make sure it's writable.
    12511253     */
    12521254    PPGMPAGE pPage;
    1253     int rc = pgmPhysGetPageEx(&pVM->pgm.s, GCPhys, &pPage);
     1255    rc = pgmPhysGetPageEx(&pVM->pgm.s, GCPhys, &pPage);
    12541256    if (RT_SUCCESS(rc))
    12551257    {
     
    12711273
    12721274#else  /* IN_RING3 || IN_RING0 */
    1273     int rc = pgmLock(pVM);
    1274     AssertRCReturn(rc, rc);
    1275 
    12761275    /*
    12771276     * Query the Physical TLB entry for the page (may fail).
     
    13251324    }
    13261325
     1326#endif /* IN_RING3 || IN_RING0 */
    13271327    pgmUnlock(pVM);
    1328 #endif /* IN_RING3 || IN_RING0 */
    13291328    return rc;
    13301329}
     
    13571356VMMDECL(int) PGMPhysGCPhys2CCPtrReadOnly(PVM pVM, RTGCPHYS GCPhys, void const **ppv, PPGMPAGEMAPLOCK pLock)
    13581357{
     1358    int rc = pgmLock(pVM);
     1359    AssertRCReturn(rc, rc);
     1360
    13591361#if defined(IN_RC) || defined(VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0)
    1360 
    13611362    /*
    13621363     * Find the page and make sure it's readable.
    13631364     */
    13641365    PPGMPAGE pPage;
    1365     int rc = pgmPhysGetPageEx(&pVM->pgm.s, GCPhys, &pPage);
     1366    rc = pgmPhysGetPageEx(&pVM->pgm.s, GCPhys, &pPage);
    13661367    if (RT_SUCCESS(rc))
    13671368    {
     
    13831384
    13841385#else  /* IN_RING3 || IN_RING0 */
    1385     int rc = pgmLock(pVM);
    1386     AssertRCReturn(rc, rc);
    1387 
    13881386    /*
    13891387     * Query the Physical TLB entry for the page (may fail).
     
    14271425    }
    14281426
     1427#endif /* IN_RING3 || IN_RING0 */
    14291428    pgmUnlock(pVM);
    1430 #endif /* IN_RING3 || IN_RING0 */
    14311429    return rc;
    14321430}
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