VirtualBox

Changeset 57075 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 24, 2015 4:27:27 PM (9 years ago)
Author:
vboxsync
Message:

VMM/TM: Code to handle loading saved-states with different host TSC frequency, disabled for now.

File:
1 edited

Legend:

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

    r55537 r57075  
    13491349    if (pVM->tm.s.enmTSCMode != TMTSCMODE_REAL_TSC_OFFSET)
    13501350        pVM->tm.s.cTSCTicksPerSecond = u64Hz;
    1351     /** @todo Compare with real TSC rate even when restoring with real-tsc-offset
    1352      *        mode. */
    13531351
    13541352    LogRel(("TM: cTSCTicksPerSecond=%#RX64 (%'RU64) enmTSCMode=%d (%s) (state load)\n",
    13551353            pVM->tm.s.cTSCTicksPerSecond, pVM->tm.s.cTSCTicksPerSecond, pVM->tm.s.enmTSCMode, tmR3GetTSCModeName(pVM)));
     1354
     1355    /* Disabled as this isn't tested, also should this apply only if GIM is enabled etc. */
     1356#if 0
     1357    /*
     1358     * If the current host TSC frequency is incompatible with what is in the
     1359     * saved state of the VM, fall back to emulating TSC and disallow TSC mode
     1360     * switches during VM runtime (e.g. by GIM).
     1361     */
     1362    uint64_t uGipCpuHz;
     1363    bool fRelax  = SUPIsHostVirtualized();
     1364    bool fCompat = SUPIsTscFreqCompatible(pVM->tm.s.cTSCTicksPerSecond, &uGipCpuHz, fRelax);
     1365    if (!fCompat)
     1366    {
     1367        pVM->tm.s.enmTSCMode = TMTSCMODE_VIRT_TSC_EMULATED;
     1368        pVM->tm.s.fTSCModeSwitchAllowed = false;
     1369        if (g_pSUPGlobalInfoPage->u32Mode != SUPGIPMODE_ASYNC_TSC)
     1370        {
     1371            LogRel(("TM: TSC frequency incompatible! uGipCpuHz=%#RX64 (%'RU64) enmTSCMode=%d (%s) fTSCModeSwitchAllowed=%RTbool (state load)\n",
     1372                    uGipCpuHz, uGipCpuHz, pVM->tm.s.enmTSCMode, tmR3GetTSCModeName(pVM), pVM->tm.s.fTSCModeSwitchAllowed));
     1373        }
     1374        else
     1375        {
     1376            LogRel(("TM: GIP is async, enmTSCMode=%d (%s) fTSCModeSwitchAllowed=%RTbool (state load)\n",
     1377                    uGipCpuHz, uGipCpuHz, pVM->tm.s.enmTSCMode, tmR3GetTSCModeName(pVM), pVM->tm.s.fTSCModeSwitchAllowed));
     1378        }
     1379    }
     1380#endif
    13561381
    13571382    /*
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