Changeset 32051 in vbox for trunk/src/VBox/VMM/PGMSavedState.cpp
- Timestamp:
- Aug 27, 2010 1:05:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMSavedState.cpp
r31847 r32051 32 32 #include <VBox/param.h> 33 33 #include <VBox/err.h> 34 #include <VBox/ftm.h> 34 35 35 36 #include <iprt/asm.h> … … 398 399 static int pgmR3SaveRomVirginPages(PVM pVM, PSSMHANDLE pSSM, bool fLiveSave) 399 400 { 401 if (FTMIsDeltaLoadSaveActive(pVM)) 402 return VINF_SUCCESS; /* nothing to do as nothing has changed here */ 403 400 404 pgmLock(pVM); 401 405 for (PPGMROMRANGE pRom = pVM->pgm.s.pRomRangesR3; pRom; pRom = pRom->pNextR3) … … 473 477 static int pgmR3SaveShadowedRomPages(PVM pVM, PSSMHANDLE pSSM, bool fLiveSave, bool fFinalPass) 474 478 { 479 if (FTMIsDeltaLoadSaveActive(pVM)) 480 return VINF_SUCCESS; /* nothing to do as we deal with those pages seperately */ 481 475 482 /* 476 483 * The Shadowed ROMs. … … 1513 1520 RTGCPHYS GCPhysCur = 0; 1514 1521 PPGMRAMRANGE pCur; 1522 bool fFTMDeltaSaveActive = FTMIsDeltaLoadSaveActive(pVM); 1523 1515 1524 pgmLock(pVM); 1516 1525 do … … 1538 1547 } 1539 1548 1549 PPGMPAGE pCurPage = &pCur->aPages[iPage]; 1550 1540 1551 /* 1541 1552 * Only save pages that haven't changed since last scan and are dirty. … … 1550 1561 if (paLSPages[iPage].fIgnore) 1551 1562 continue; 1552 if (PGM_PAGE_GET_TYPE( &pCur->aPages[iPage]) != PGMPAGETYPE_RAM) /* in case of recent remappings */1563 if (PGM_PAGE_GET_TYPE(pCurPage) != PGMPAGETYPE_RAM) /* in case of recent remappings */ 1553 1564 continue; 1554 if ( PGM_PAGE_GET_STATE( &pCur->aPages[iPage])1565 if ( PGM_PAGE_GET_STATE(pCurPage) 1555 1566 != ( paLSPages[iPage].fZero 1556 1567 ? PGM_PAGE_STATE_ZERO … … 1569 1580 { 1570 1581 #ifdef PGMLIVESAVERAMPAGE_WITH_CRC32 1571 if (PGM_PAGE_GET_TYPE( &pCur->aPages[iPage]) != PGMPAGETYPE_RAM)1582 if (PGM_PAGE_GET_TYPE(pCurPage) != PGMPAGETYPE_RAM) 1572 1583 pgmR3StateVerifyCrc32ForRamPage(pVM, pCur, paLSPages, iPage, "save#1"); 1573 1584 #endif 1574 1585 continue; 1575 1586 } 1576 if (PGM_PAGE_GET_TYPE( &pCur->aPages[iPage]) != PGMPAGETYPE_RAM)1587 if (PGM_PAGE_GET_TYPE(pCurPage) != PGMPAGETYPE_RAM) 1577 1588 continue; 1578 1589 } … … 1583 1594 int rc; 1584 1595 RTGCPHYS GCPhys = pCur->GCPhys + ((RTGCPHYS)iPage << PAGE_SHIFT); 1585 bool fZero = PGM_PAGE_IS_ZERO( &pCur->aPages[iPage]) || PGM_PAGE_IS_BALLOONED(&pCur->aPages[iPage]);1596 bool fZero = PGM_PAGE_IS_ZERO(pCurPage) || PGM_PAGE_IS_BALLOONED(pCurPage); 1586 1597 1587 1598 if (!fZero) … … 1593 1604 uint8_t abPage[PAGE_SIZE]; 1594 1605 void const *pvPage; 1595 rc = pgmPhysGCPhys2CCPtrInternalReadOnly(pVM, &pCur->aPages[iPage], GCPhys, &pvPage);1606 rc = pgmPhysGCPhys2CCPtrInternalReadOnly(pVM, pCurPage, GCPhys, &pvPage); 1596 1607 if (RT_SUCCESS(rc)) 1597 1608 { … … 1608 1619 if (!ASMMemIsZeroPage(pvPage)) 1609 1620 { 1610 if (GCPhys == GCPhysLast + PAGE_SIZE) 1611 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW); 1621 if (fFTMDeltaSaveActive) 1622 { 1623 if ( PGM_PAGE_IS_WRITTEN_TO(pCurPage) 1624 || PGM_PAGE_IS_FT_DIRTY(pCurPage)) 1625 { 1626 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW | PGM_STATE_REC_FLAG_ADDR); 1627 SSMR3PutGCPhys(pSSM, GCPhys); 1628 rc = SSMR3PutMem(pSSM, abPage, PAGE_SIZE); 1629 } 1630 /* else nothing changed, so skip it. */ 1631 } 1612 1632 else 1613 1633 { 1614 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW | PGM_STATE_REC_FLAG_ADDR); 1615 SSMR3PutGCPhys(pSSM, GCPhys); 1634 if (GCPhys == GCPhysLast + PAGE_SIZE) 1635 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW); 1636 else 1637 { 1638 SSMR3PutU8(pSSM, PGM_STATE_REC_RAM_RAW | PGM_STATE_REC_FLAG_ADDR); 1639 SSMR3PutGCPhys(pSSM, GCPhys); 1640 } 1641 rc = SSMR3PutMem(pSSM, abPage, PAGE_SIZE); 1616 1642 } 1617 rc = SSMR3PutMem(pSSM, abPage, PAGE_SIZE);1618 1643 } 1619 1644 else … … 1675 1700 } /* for each range */ 1676 1701 } while (pCur); 1702 1677 1703 pgmUnlock(pVM); 1678 1704
Note:
See TracChangeset
for help on using the changeset viewer.