VirtualBox

Changeset 20675 in vbox


Ignore:
Timestamp:
Jun 18, 2009 8:49:43 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
48777
Message:

VMM: Reimplemented TMCpuTickSet.

File:
1 edited

Legend:

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

    r19747 r20675  
    6464        if (pVM->tm.s.fTSCVirtualized)
    6565        {
     66            /** @todo Test that pausing and resuming doesn't cause lag! (I.e. that we're
     67             *        unpaused before the virtual time and stopped after it. */
    6668            if (pVM->tm.s.fTSCUseRealTSC)
    6769                pVCpu->tm.s.u64TSCOffset = ASMReadTSC() - pVCpu->tm.s.u64TSC;
     
    9597    AssertFailed();
    9698    return VERR_INTERNAL_ERROR;
    97 }
    98 
    99 
    100 /**
    101  * Pauses the CPU timestamp counter ticking.
    102  *
    103  * @returns VBox status code.
    104  * @param   pVCpu       The VMCPU to operate on.
    105  * @todo replace this with TMNotifySuspend
    106  */
    107 VMMDECL(int) TMCpuTickPause(PVMCPU pVCpu)
    108 {
    109     PVM pVM = pVCpu->CTX_SUFF(pVM);
    110 
    111     if (!pVM->tm.s.fTSCTiedToExecution)
    112         return tmCpuTickPause(pVM, pVCpu);
    113     /* ignored */
    114     return VINF_SUCCESS;
    11599}
    116100
     
    266250VMMDECL(int) TMCpuTickSet(PVMCPU pVCpu, uint64_t u64Tick)
    267251{
    268     Assert(!pVCpu->tm.s.fTSCTicking);
     252    /*
     253     * This is easier to do when the TSC is paused since resume will
     254     * do all the calcuations for us.
     255     */
     256    PVM     pVM         = pVCpu->CTX_SUFF(pVM);
     257    bool    fTSCTicking = pVCpu->tm.s.fTSCTicking;
     258    if (fTSCTicking)
     259        tmCpuTickPause(pVM, pVCpu);
    269260    pVCpu->tm.s.u64TSC = u64Tick;
     261
     262    if (fTSCTicking)
     263        tmCpuTickResume(pVM, pVCpu);
     264    /** @todo Try help synchronizing it better among the virtual CPUs? */
    270265    return VINF_SUCCESS;
    271266}
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette