Changeset 30613 in vbox
- Timestamp:
- Jul 5, 2010 12:56:59 PM (15 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/PGMInternal.h
r30493 r30613 3371 3371 VMMDECL(int) pgmPhysHandlerRedirectToHC(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser); 3372 3372 VMMDECL(int) pgmPhysRomWriteHandler(PVM pVM, RTGCUINT uErrorCode, PCPUMCTXCORE pRegFrame, RTGCPTR pvFault, RTGCPHYS GCPhysFault, void *pvUser); 3373 int pgmPhysFreePage(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t *pcPendingPages, PPGMPAGE pPage, RTGCPHYS GCPhys); 3374 3373 3375 #ifdef IN_RING3 3374 3376 void pgmR3PhysRelinkRamRanges(PVM pVM); -
trunk/src/VBox/VMM/PGMPhys.cpp
r30438 r30613 52 52 *******************************************************************************/ 53 53 static DECLCALLBACK(int) pgmR3PhysRomWriteHandler(PVM pVM, RTGCPHYS GCPhys, void *pvPhys, void *pvBuf, size_t cbBuf, PGMACCESSTYPE enmAccessType, void *pvUser); 54 static int pgmPhysFreePage(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t *pcPendingPages, PPGMPAGE pPage, RTGCPHYS GCPhys);55 54 56 55 … … 3710 3709 * @remarks The caller must own the PGM lock. 3711 3710 */ 3712 staticint pgmPhysFreePage(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t *pcPendingPages, PPGMPAGE pPage, RTGCPHYS GCPhys)3711 int pgmPhysFreePage(PVM pVM, PGMMFREEPAGESREQ pReq, uint32_t *pcPendingPages, PPGMPAGE pPage, RTGCPHYS GCPhys) 3713 3712 { 3714 3713 /* -
trunk/src/VBox/VMM/PGMSavedState.cpp
r30398 r30613 2524 2524 PPGMROMRANGE pRom = NULL; 2525 2525 PPGMMMIO2RANGE pMmio2 = NULL; 2526 2527 /* 2528 * We batch up pages that should be freed instead of calling GMM for 2529 * each and every one of them. 2530 */ 2531 uint32_t cPendingPages = 0; 2532 PGMMFREEPAGESREQ pReq; 2533 int rc = GMMR3FreePagesPrepare(pVM, &pReq, 128 /* batch size */, GMMACCOUNT_BASE); 2534 AssertLogRelRCReturn(rc, rc); 2535 2526 2536 for (;;) 2527 2537 { … … 2530 2540 */ 2531 2541 uint8_t u8; 2532 intrc = SSMR3GetU8(pSSM, &u8);2542 rc = SSMR3GetU8(pSSM, &u8); 2533 2543 if (RT_FAILURE(rc)) 2534 2544 return rc; 2535 2545 if (u8 == PGM_STATE_REC_END) 2546 { 2547 /* 2548 * Finish off any pages pending freeing. 2549 */ 2550 if (cPendingPages) 2551 { 2552 rc = GMMR3FreePagesPerform(pVM, pReq, cPendingPages); 2553 AssertLogRelRCReturn(rc, rc); 2554 } 2555 GMMR3FreePagesCleanup(pReq); 2536 2556 return VINF_SUCCESS; 2557 } 2537 2558 AssertLogRelMsgReturn((u8 & ~PGM_STATE_REC_FLAG_ADDR) <= PGM_STATE_REC_LAST, ("%#x\n", u8), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 2538 2559 switch (u8 & ~PGM_STATE_REC_FLAG_ADDR) … … 2571 2592 || PGM_PAGE_IS_BALLOONED(pPage)) 2572 2593 break; 2573 /** @todo implement zero page replacing. */ 2574 AssertLogRelMsgReturn(PGM_PAGE_GET_STATE(pPage) == PGM_PAGE_STATE_ALLOCATED, ("GCPhys=%RGp %R[pgmpage]\n", GCPhys, pPage), VERR_INTERNAL_ERROR_5); 2575 void *pvDstPage; 2576 rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, GCPhys, &pvDstPage); 2577 AssertLogRelMsgRCReturn(rc, ("GCPhys=%RGp %R[pgmpage] rc=%Rrc\n", GCPhys, pPage, rc), rc); 2578 ASMMemZeroPage(pvDstPage); 2594 /* Allocated before (prealloc), so free it now. */ 2595 rc = pgmPhysFreePage(pVM, pReq, &cPendingPages, pPage, GCPhys); 2596 AssertRC(rc); 2579 2597 break; 2580 2598 }
Note:
See TracChangeset
for help on using the changeset viewer.