Changeset 14757 in vbox
- Timestamp:
- Nov 28, 2008 3:24:01 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40072
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp
r14679 r14757 1894 1894 } 1895 1895 #endif 1896 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 1897 PGMDynMapReleaseAutoSet(pVCpu); 1898 #endif 1896 1899 1897 1900 /* … … 2048 2051 AssertRC(rc); 2049 2052 } 2053 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 2054 PGMDynMapStartAutoSet(pVCpu); 2055 #endif 2050 2056 2051 2057 /* Some cases don't need a complete resync of the guest CPU state; handle them here. */ -
trunk/src/VBox/VMM/VMMR0/PGMR0DynMap.cpp
r14752 r14757 1468 1468 * since the PGMDynMapStartAutoSet call. 1469 1469 * 1470 * If the set is already closed, nothing will be done. 1471 * 1470 1472 * @param pVCpu The shared data for the current virtual CPU. 1471 1473 */ … … 1474 1476 PPGMMAPSET pSet = &pVCpu->pgm.s.AutoSet; 1475 1477 1476 /* close the set */ 1478 /* 1479 * Is the set open? 1480 * 1481 * We might be closed before VM execution and not reopened again before 1482 * we leave for ring-3 or something. 1483 */ 1477 1484 uint32_t i = pSet->cEntries; 1478 AssertMsg(i <= RT_ELEMENTS(pSet->aEntries), ("%#x (%u)\n", i, i)); 1479 pSet->cEntries = PGMMAPSET_CLOSED; 1480 1481 /* release any pages we're referencing. */ 1482 if (i != 0 && RT_LIKELY(i <= RT_ELEMENTS(pSet->aEntries))) 1483 { 1484 PPGMR0DYNMAP pThis = g_pPGMR0DynMap; 1485 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1486 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 1487 1488 while (i-- > 0) 1489 { 1490 uint32_t iPage = pSet->aEntries[i].iPage; 1491 Assert(iPage < pThis->cPages); 1492 int32_t cRefs = pSet->aEntries[i].cRefs; 1493 Assert(cRefs > 0); 1494 pgmR0DynMapReleasePageLocked(pThis, iPage, cRefs); 1495 1496 pSet->aEntries[i].iPage = UINT16_MAX; 1497 pSet->aEntries[i].cRefs = 0; 1498 } 1499 1500 Assert(pThis->cLoad <= pThis->cPages - pThis->cGuardPages); 1501 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 1485 if (i != PGMMAPSET_CLOSED) 1486 { 1487 /* 1488 * Close the set 1489 */ 1490 AssertMsg(i <= RT_ELEMENTS(pSet->aEntries), ("%#x (%u)\n", i, i)); 1491 pSet->cEntries = PGMMAPSET_CLOSED; 1492 1493 /* 1494 * Release any pages it's referencing. 1495 */ 1496 if (i != 0 && RT_LIKELY(i <= RT_ELEMENTS(pSet->aEntries))) 1497 { 1498 PPGMR0DYNMAP pThis = g_pPGMR0DynMap; 1499 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1500 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 1501 1502 while (i-- > 0) 1503 { 1504 uint32_t iPage = pSet->aEntries[i].iPage; 1505 Assert(iPage < pThis->cPages); 1506 int32_t cRefs = pSet->aEntries[i].cRefs; 1507 Assert(cRefs > 0); 1508 pgmR0DynMapReleasePageLocked(pThis, iPage, cRefs); 1509 1510 pSet->aEntries[i].iPage = UINT16_MAX; 1511 pSet->aEntries[i].cRefs = 0; 1512 } 1513 1514 Assert(pThis->cLoad <= pThis->cPages - pThis->cGuardPages); 1515 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 1516 } 1502 1517 } 1503 1518 }
Note:
See TracChangeset
for help on using the changeset viewer.