VirtualBox

Changeset 34318 in vbox for trunk


Ignore:
Timestamp:
Nov 24, 2010 12:57:17 PM (14 years ago)
Author:
vboxsync
Message:

PGM: Fixed assertion trying to free a PXE ROM page when restoring an (older) saved state.

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMPhys.cpp

    r34167 r34318  
    41164116 * Frees the specified RAM page and replaces it with the ZERO page.
    41174117 *
    4118  * This is used by ballooning, remapping MMIO2 and RAM reset.
    4119  *
    4120  * @param   pVM         Pointer to the shared VM structure.
    4121  * @param   pReq        Pointer to the request.
    4122  * @param   pPage       Pointer to the page structure.
    4123  * @param   GCPhys      The guest physical address of the page, if applicable.
     4118 * This is used by ballooning, remapping MMIO2, RAM reset and state loading.
     4119 *
     4120 * @param   pVM             Pointer to the shared VM structure.
     4121 * @param   pReq            Pointer to the request.
     4122 * @param   pcPendingPages  Where the number of pages waiting to be freed are
     4123 *                          kept.  This will normally be incremented.
     4124 * @param   pPage           Pointer to the page structure.
     4125 * @param   GCPhys          The guest physical address of the page, if applicable.
    41244126 *
    41254127 * @remarks The caller must own the PGM lock.
  • trunk/src/VBox/VMM/PGMSavedState.cpp

    r33780 r34318  
    25782578    /*
    25792579     * We batch up pages that should be freed instead of calling GMM for
    2580      * each and every one of them.
     2580     * each and every one of them.  Note that we'll lose the pages in most
     2581     * failure paths - this should probably be addressed one day.
    25812582     */
    25822583    uint32_t            cPendingPages = 0;
     
    26452646                        AssertLogRelMsgReturn(PGM_PAGE_GET_STATE(pPage) == PGM_PAGE_STATE_ALLOCATED, ("GCPhys=%RGp %R[pgmpage]\n", GCPhys, pPage), VERR_INTERNAL_ERROR_5);
    26462647
    2647                         /* Free it only if it's not part of a previously allocated large page. */
    2648                         if (PGM_PAGE_GET_PDE_TYPE(pPage) != PGM_PAGE_PDE_TYPE_PDE)
     2648                        /* If this is a ROM page, we must clear it and not try
     2649                           free it... */
     2650                        if (   PGM_PAGE_GET_TYPE(pPage) == PGMPAGETYPE_ROM
     2651                            || PGM_PAGE_GET_TYPE(pPage) == PGMPAGETYPE_ROM_SHADOW)
    26492652                        {
    2650                             /* Allocated before (prealloc), so free it now. */
     2653                            void *pvDstPage;
     2654                            rc = pgmPhysGCPhys2CCPtrInternal(pVM, pPage, GCPhys, &pvDstPage);
     2655                            AssertLogRelMsgRCReturn(rc, ("GCPhys=%RGp %R[pgmpage] rc=%Rrc\n", GCPhys, pPage, rc), rc);
     2656                            ASMMemZeroPage(pvDstPage);
     2657                        }
     2658                        /* Free it only if it's not part of a previously
     2659                           allocated large page (no need to clear the page). */
     2660                        else if (PGM_PAGE_GET_PDE_TYPE(pPage) != PGM_PAGE_PDE_TYPE_PDE)
     2661                        {
    26512662                            rc = pgmPhysFreePage(pVM, pReq, &cPendingPages, pPage, GCPhys);
    2652                             AssertRC(rc);
     2663                            AssertRCReturn(rc, rc);
    26532664                        }
    26542665                        break;
     
    29933004    {
    29943005        rc = GMMR3BalloonedPages(pVM, GMMBALLOONACTION_INFLATE, pVM->pgm.s.cBalloonedPages);
    2995         AssertRC(rc);
     3006        AssertRCReturn(rc, rc);
    29963007    }
    29973008    return rc;
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