VirtualBox

Changeset 51959 in vbox


Ignore:
Timestamp:
Jul 9, 2014 3:18:00 PM (10 years ago)
Author:
vboxsync
Message:

TM: Set pVM->tm.s.u64LastPausedTSC to the highest pVCpu->tm.s.u64TSC value on saved state restore. Cleanups.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/TMAllCpu.cpp

    r51852 r51959  
    8080}
    8181
     82
    8283/**
    8384 * Resumes the CPU timestamp counter ticking.
     
    144145}
    145146
     147
    146148/**
    147149 * Pauses the CPU timestamp counter ticking.
     
    172174    return VERR_TM_TSC_ALREADY_PAUSED;
    173175}
     176
    174177
    175178/**
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r51867 r51959  
    12241224     */
    12251225    pVM->tm.s.cVirtualTicking = 0;
    1226     pVM->tm.s.cTSCsTicking    = 0;
    12271226    /* the virtual clock. */
    12281227    uint64_t u64Hz;
     
    12661265
    12671266    /* the cpu tick clock. */
     1267    pVM->tm.s.cTSCsTicking = 0;
     1268    pVM->tm.s.offTSCPause = 0;
     1269    pVM->tm.s.u64LastPausedTSC = 0;
    12681270    for (VMCPUID i = 0; i < pVM->cCpus; i++)
    12691271    {
     
    12721274        pVCpu->tm.s.fTSCTicking = false;
    12731275        SSMR3GetU64(pSSM, &pVCpu->tm.s.u64TSC);
     1276        if (pVM->tm.s.u64LastPausedTSC < pVCpu->tm.s.u64TSC)
     1277            pVM->tm.s.u64LastPausedTSC = pVCpu->tm.s.u64TSC;
    12741278
    12751279        if (pVM->tm.s.fTSCUseRealTSC)
  • trunk/src/VBox/VMM/include/TMInternal.h

    r51853 r51959  
    354354    /** The ID of the virtual CPU that normally runs the timers. */
    355355    VMCPUID                     idTimerCpu;
     356
    356357    /** The number of CPU clock ticks per second (TMCLOCK_TSC).
    357358     * Config variable: TSCTicksPerSecond (64-bit unsigned int)
    358359     * The config variable implies fTSCVirtualized = true and fTSCUseRealTSC = false. */
    359360    uint64_t                    cTSCTicksPerSecond;
     361    /** The TSC difference introduced by pausing the VM. */
     362    uint64_t                    offTSCPause;
     363    /** The TSC value when the last TSC was paused. */
     364    uint64_t                    u64LastPausedTSC;
     365    /** CPU TSCs ticking indicator (one for each VCPU). */
     366    uint32_t volatile           cTSCsTicking;
    360367
    361368    /** Virtual time ticking enabled indicator (counter for each VCPU). (TMCLOCK_VIRTUAL) */
     
    373380     * i.e. since u64VirtualWarpDriveStart. */
    374381    uint32_t                    u32VirtualWarpDrivePercentage;
    375 
    376     /** CPU TSCs ticking indicator (one for each VCPU). */
    377     uint32_t volatile           cTSCsTicking;
    378 
    379     /** The TSC difference introduced by pausing the VM. */
    380     uint64_t                    offTSCPause;
    381 
    382     /** The TSC value when the last TSC was paused. */
    383     uint64_t                    u64LastPausedTSC;
    384382
    385383    /** The offset of the virtual clock relative to it's timesource.
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