VirtualBox

Changeset 38707 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Sep 9, 2011 2:10:18 PM (13 years ago)
Author:
vboxsync
Message:

VMM/VT-x: Fix for PAE guests running on 32-bit hosts or 64-bit hosts where VBoxInternal/PGM/MaxRing3Chunks is used.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PGM.cpp

    r37803 r38707  
    12441244            pPGM->apGstPaePDsRC[i]             = NIL_RTRCPTR;
    12451245            pPGM->aGCPhysGstPaePDs[i]          = NIL_RTGCPHYS;
     1246            pPGM->aGstPaePdpeRegs[i].u         = UINT64_MAX;
    12461247            pPGM->aGCPhysGstPaePDsMonitored[i] = NIL_RTGCPHYS;
    12471248        }
  • trunk/src/VBox/VMM/VMMR3/PGMSavedState.cpp

    r37354 r38707  
    4646*   Defined Constants And Macros                                               *
    4747*******************************************************************************/
    48 /** Saved state data unit version.
    49  * @todo remove the guest mappings from the saved state at next version change! */
    50 #define PGM_SAVED_STATE_VERSION                 13
     48/** Saved state data unit version.  */
     49#define PGM_SAVED_STATE_VERSION                 14
     50/** Saved state data unit version before the PAE PDPE registers. */
     51#define PGM_SAVED_STATE_VERSION_PRE_PAE         13
    5152/** Saved state data unit version after this includes ballooned page flags in
    5253 *  the state (see #5515). */
     
    151152
    152153static const SSMFIELD s_aPGMCpuFields[] =
     154{
     155    SSMFIELD_ENTRY(         PGMCPU, fA20Enabled),
     156    SSMFIELD_ENTRY_GCPHYS(  PGMCPU, GCPhysA20Mask),
     157    SSMFIELD_ENTRY(         PGMCPU, enmGuestMode),
     158    SSMFIELD_ENTRY(         PGMCPU, aGCPhysGstPaePDs[0]),
     159    SSMFIELD_ENTRY(         PGMCPU, aGCPhysGstPaePDs[1]),
     160    SSMFIELD_ENTRY(         PGMCPU, aGCPhysGstPaePDs[2]),
     161    SSMFIELD_ENTRY(         PGMCPU, aGCPhysGstPaePDs[3]),
     162    SSMFIELD_ENTRY_TERM()
     163};
     164
     165static const SSMFIELD s_aPGMCpuFieldsPrePae[] =
    153166{
    154167    SSMFIELD_ENTRY(         PGMCPU, fA20Enabled),
     
    20312044static DECLCALLBACK(int) pgmR3SaveExec(PVM pVM, PSSMHANDLE pSSM)
    20322045{
    2033     int         rc;
    2034     unsigned    i;
    2035     PPGM        pPGM = &pVM->pgm.s;
     2046    int     rc   = VINF_SUCCESS;
     2047    PPGM    pPGM = &pVM->pgm.s;
    20362048
    20372049    /*
     
    20502062
    20512063    for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++)
    2052         SSMR3PutStruct(pSSM, &pVM->aCpus[idCpu].pgm.s, &s_aPGMCpuFields[0]);
    2053 
    2054     /*
    2055      * The guest mappings.
    2056      */
    2057     i = 0;
    2058     for (PPGMMAPPING pMapping = pPGM->pMappingsR3; pMapping; pMapping = pMapping->pNextR3, i++)
    2059     {
    2060         SSMR3PutU32(      pSSM, i);
    2061         SSMR3PutStrZ(     pSSM, pMapping->pszDesc); /* This is the best unique id we have... */
    2062         SSMR3PutGCPtr(    pSSM, pMapping->GCPtr);
    2063         SSMR3PutGCUIntPtr(pSSM, pMapping->cPTs);
    2064     }
    2065     rc = SSMR3PutU32(pSSM, ~0); /* terminator. */
     2064        rc = SSMR3PutStruct(pSSM, &pVM->aCpus[idCpu].pgm.s, &s_aPGMCpuFields[0]);
    20662065
    20672066    /*
     
    29492948        for (VMCPUID i = 0; i < pVM->cCpus; i++)
    29502949        {
    2951             rc = SSMR3GetStruct(pSSM, &pVM->aCpus[i].pgm.s, &s_aPGMCpuFields[0]);
     2950            if (uVersion <= PGM_SAVED_STATE_VERSION_PRE_PAE)
     2951                rc = SSMR3GetStruct(pSSM, &pVM->aCpus[i].pgm.s, &s_aPGMCpuFieldsPrePae[0]);
     2952            else
     2953                rc = SSMR3GetStruct(pSSM, &pVM->aCpus[i].pgm.s, &s_aPGMCpuFields[0]);
    29522954            AssertLogRelRCReturn(rc, rc);
    29532955        }
     
    30053007     * The guest mappings - skipped now, see re-fixation in the caller.
    30063008     */
    3007     uint32_t i = 0;
    3008     for (;; i++)
    3009     {
    3010         rc = SSMR3GetU32(pSSM, &u32Sep);        /* sequence number */
    3011         if (RT_FAILURE(rc))
    3012             return rc;
    3013         if (u32Sep == ~0U)
    3014             break;
    3015         AssertMsgReturn(u32Sep == i, ("u32Sep=%#x i=%#x\n", u32Sep, i), VERR_SSM_DATA_UNIT_FORMAT_CHANGED);
    3016 
    3017         char szDesc[256];
    3018         rc = SSMR3GetStrZ(pSSM, szDesc, sizeof(szDesc));
    3019         if (RT_FAILURE(rc))
    3020             return rc;
    3021         RTGCPTR GCPtrIgnore;
    3022         SSMR3GetGCPtr(pSSM, &GCPtrIgnore);      /* GCPtr */
    3023         rc = SSMR3GetGCPtr(pSSM, &GCPtrIgnore); /* cPTs  */
    3024         if (RT_FAILURE(rc))
    3025             return rc;
     3009    if (uVersion <= PGM_SAVED_STATE_VERSION_PRE_PAE)
     3010    {
     3011        for (uint32_t i = 0; ; i++)
     3012        {
     3013            rc = SSMR3GetU32(pSSM, &u32Sep);        /* sequence number */
     3014            if (RT_FAILURE(rc))
     3015                return rc;
     3016            if (u32Sep == ~0U)
     3017                break;
     3018            AssertMsgReturn(u32Sep == i, ("u32Sep=%#x i=%#x\n", u32Sep, i), VERR_SSM_DATA_UNIT_FORMAT_CHANGED);
     3019
     3020            char szDesc[256];
     3021            rc = SSMR3GetStrZ(pSSM, szDesc, sizeof(szDesc));
     3022            if (RT_FAILURE(rc))
     3023                return rc;
     3024            RTGCPTR GCPtrIgnore;
     3025            SSMR3GetGCPtr(pSSM, &GCPtrIgnore);      /* GCPtr */
     3026            rc = SSMR3GetGCPtr(pSSM, &GCPtrIgnore); /* cPTs  */
     3027            if (RT_FAILURE(rc))
     3028                return rc;
     3029        }
    30263030    }
    30273031
     
    30823086    if (   (   uPass != SSM_PASS_FINAL
    30833087            && uVersion != PGM_SAVED_STATE_VERSION
     3088            && uVersion != PGM_SAVED_STATE_VERSION_PRE_PAE
    30843089            && uVersion != PGM_SAVED_STATE_VERSION_BALLOON_BROKEN
    30853090            && uVersion != PGM_SAVED_STATE_VERSION_PRE_BALLOON
    30863091            && uVersion != PGM_SAVED_STATE_VERSION_NO_RAM_CFG)
    30873092        || (   uVersion != PGM_SAVED_STATE_VERSION
     3093            && uVersion != PGM_SAVED_STATE_VERSION_PRE_PAE
    30883094            && uVersion != PGM_SAVED_STATE_VERSION_BALLOON_BROKEN
    30893095            && uVersion != PGM_SAVED_STATE_VERSION_PRE_BALLOON
     
    31413147                VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
    31423148                pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL;
     3149                /** @todo For guest PAE, we might get the wrong
     3150                 *        aGCPhysGstPaePDs values now. We should used the
     3151                 *        saved ones... Postponing this since it nothing new
     3152                 *        and PAE/PDPTR needs some general readjusting, see
     3153                 *        @bugref{#5880}. */
    31433154            }
    31443155
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