Changeset 58779 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Nov 19, 2015 10:01:22 PM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PGM.cpp
r58397 r58779 1312 1312 pVM->pgm.s.GCPhys4MBPSEMask = RT_BIT_64(32) - 1; /* default; checked later */ 1313 1313 pVM->pgm.s.GCPtrPrevRamRangeMapping = MM_HYPER_AREA_ADDRESS; 1314 pVM->pgm.s.fRestoreVirginRomPagesDuringReset = false; 1314 1315 1315 1316 rc = CFGMR3QueryBoolDef(CFGMR3GetRoot(pVM), "RamPreAlloc", &pVM->pgm.s.fRamPreAlloc, -
trunk/src/VBox/VMM/VMMR3/PGMPhys.cpp
r58170 r58779 3573 3573 } 3574 3574 3575 #ifdef VBOX_STRICT3576 3575 /* 3577 * Verify that the virgin page is unchanged if possible. 3576 * Restore virgin ROM pages after a saved state load or check that the 3577 * virgin pages are unchanged if possible. 3578 3578 */ 3579 3579 if (pRom->pvOriginal) … … 3581 3581 size_t cbSrcLeft = pRom->cbOriginal; 3582 3582 uint8_t const *pbSrcPage = (uint8_t const *)pRom->pvOriginal; 3583 bool fChanged = false; 3583 3584 for (uint32_t iPage = 0; iPage < cPages && cbSrcLeft > 0; iPage++, pbSrcPage += PAGE_SIZE) 3584 3585 { … … 3591 3592 if (memcmp(pvDstPage, pbSrcPage, RT_MIN(cbSrcLeft, PAGE_SIZE))) 3592 3593 { 3593 # ifdef DEBUG_bird /* This is darn handy for EFI debugging w/ snapshots, should be made default later. */ 3594 void *pvDstPageW; 3595 rc = pgmPhysPageMap(pVM, &pRom->aPages[iPage].Virgin, GCPhys, &pvDstPageW); 3596 AssertRCReturn(rc, rc); 3597 memcpy(pvDstPageW, pbSrcPage, RT_MIN(cbSrcLeft, PAGE_SIZE)); 3598 # else 3599 LogRel(("pgmR3PhysRomReset: %RGp rom page changed (%s) - loaded saved state?\n", 3600 GCPhys, pRom->pszDesc)); 3601 # endif 3594 if (pVM->pgm.s.fRestoreVirginRomPagesDuringReset) 3595 { 3596 void *pvDstPageW; 3597 rc = pgmPhysPageMap(pVM, &pRom->aPages[iPage].Virgin, GCPhys, &pvDstPageW); 3598 AssertLogRelRCReturn(rc, rc); 3599 memcpy(pvDstPageW, pbSrcPage, RT_MIN(cbSrcLeft, PAGE_SIZE)); 3600 fChanged = true; 3601 } 3602 else 3603 { 3604 #ifdef VBOX_STRICT 3605 LogRel(("pgmR3PhysRomReset: %RGp rom page changed (%s)?\n", GCPhys, pRom->pszDesc)); 3606 #endif 3607 } 3602 3608 } 3603 3609 cbSrcLeft -= RT_MIN(cbSrcLeft, PAGE_SIZE); 3604 3610 } 3605 } 3606 #endif 3607 } 3608 3611 if (fChanged) 3612 LogRel(("PGM: ROM \"%s\" changed - restored original\n", pRom->pszDesc)); 3613 } 3614 } 3615 3616 pVM->pgm.s.fRestoreVirginRomPagesDuringReset = false; 3609 3617 return VINF_SUCCESS; 3610 3618 } -
trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp
r58126 r58779 336 336 ("The \"%s\" ROM was not found in the saved state. Probably due to some misconfiguration\n", 337 337 pRom->pszDesc)); 338 339 pVM->pgm.s.fRestoreVirginRomPagesDuringReset = true; 338 340 return VINF_SUCCESS; /* the end */ 339 341 } -
trunk/src/VBox/VMM/include/PGMInternal.h
r58123 r58779 3245 3245 /** The number of MMIO2 regions (serves as the next MMIO2 ID). */ 3246 3246 uint8_t cMmio2Regions; 3247 /** Alignment padding that makes the next member start on a 8 byte boundary. */ 3248 bool afAlignment1[1]; 3247 /** Flag indicating that ROM pages should be restored to their original 3248 * during reset. Primary use is for getting firmware updates when the 3249 * VM is reset after a saved state was loaded. */ 3250 bool fRestoreVirginRomPagesDuringReset; 3249 3251 3250 3252 /** Indicates that PGMR3FinalizeMappings has been called and that further -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r57429 r58779 674 674 GEN_CHECK_OFF(PGM, paDynPageMapPaePTEsGC); 675 675 GEN_CHECK_OFF(PGM, enmHostMode); 676 GEN_CHECK_OFF(PGM, fRestoreVirginRomPagesDuringReset); 676 677 GEN_CHECK_OFF(PGM, GCPhys4MBPSEMask); 677 678 GEN_CHECK_OFF(PGM, pRamRangesXR3);
Note:
See TracChangeset
for help on using the changeset viewer.