VirtualBox

Changeset 22891 in vbox


Ignore:
Timestamp:
Sep 9, 2009 11:21:06 PM (15 years ago)
Author:
vboxsync
Message:

cpumR3Load: Don't overwrite VM::cCpus. That value *must* be unchanged when restoring.

File:
1 edited

Legend:

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

    r22890 r22891  
    10461046        if (uVersion >= CPUM_SAVED_STATE_VERSION_VER2_1_NOMSR)
    10471047        {
    1048             /** @todo r=bird: cCPUs: Why are we doing this?!? cCpus is a config value that
    1049              *        cannot be changed by a saved state. If the saved one differs we
    1050              *        fail. */
    1051             int rc = SSMR3GetU32(pSSM, &pVM->cCpus);
    1052             AssertRCReturn(rc, rc);
     1048            uint32_t cCpus;
     1049            int rc = SSMR3GetU32(pSSM, &cCpus); AssertRCReturn(rc, rc);
     1050            AssertLogRelMsgReturn(cCpus == pVM->cCpus, ("Mismatching CPU counts: saved: %u; configured: %u \n", cCpus, pVM->cCpus),
     1051                                  VERR_SSM_UNEXPECTED_DATA);
    10531052        }
    1054 
    1055         if (    !pVM->cCpus
    1056             ||  pVM->cCpus > VMM_MAX_CPU_COUNT
    1057             ||  (   uVersion == CPUM_SAVED_STATE_VERSION_VER2_0
    1058                  && pVM->cCpus != 1))
    1059         {
    1060             AssertMsgFailed(("Unexpected number of VMCPUs (%u)\n", pVM->cCpus));
    1061             return VERR_SSM_UNEXPECTED_DATA;
    1062         }
     1053        AssertLogRelMsgReturn(   uVersion != CPUM_SAVED_STATE_VERSION_VER2_0
     1054                              || pVM->cCpus == 1,
     1055                              ("cCpus=%u\n", pVM->cCpus),
     1056                              VERR_SSM_UNEXPECTED_DATA);
    10631057
    10641058        for (VMCPUID i = 0; i < pVM->cCpus; i++)
     
    10721066    }
    10731067
    1074 
     1068    /*
     1069     * Restore the CPUID leaves.
     1070     *
     1071     * Note that we support restoring less than the current amount of standard
     1072     * leaves because we've been allowed more is newer version of VBox.
     1073     */
    10751074    uint32_t cElements;
    10761075    int rc = SSMR3GetU32(pSSM, &cElements); AssertRCReturn(rc, rc);
    1077     /* Support old saved states with a smaller standard cpuid array. */
    10781076    if (cElements > RT_ELEMENTS(pVM->cpum.s.aGuestCpuIdStd))
    10791077        return VERR_SSM_DATA_UNIT_FORMAT_CHANGED;
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