VirtualBox

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


Ignore:
Timestamp:
Jun 12, 2018 8:45:27 AM (6 years ago)
Author:
vboxsync
Message:

NEM,TM: Work on TSC and NEM/win. bugref:9044 [=>office]

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/NEMR3Native-win.cpp

    r72488 r72522  
    2727*********************************************************************************************************************************/
    2828#define LOG_GROUP LOG_GROUP_NEM
     29#define VMCPU_INCL_CPUM_GST_CTX
    2930#include <iprt/nt/nt-and-windows.h>
    3031#include <iprt/nt/hyperv.h>
  • trunk/src/VBox/VMM/VMMR3/TM.cpp

    r70948 r72522  
    436436                          pVM->tm.s.cTSCTicksPerSecond);
    437437    else
    438     {
    439438        pVM->tm.s.enmTSCMode = TMTSCMODE_VIRT_TSC_EMULATED;
    440     }
    441439
    442440    /** @cfgm{/TM/TSCTiedToExecution, bool, false}
     
    11971195    VM_ASSERT_EMT0(pVM);
    11981196    uint64_t offTscRawSrc;
    1199     if (pVM->tm.s.enmTSCMode == TMTSCMODE_REAL_TSC_OFFSET)
    1200         offTscRawSrc = SUPReadTsc();
    1201     else
    1202     {
    1203         offTscRawSrc = TMVirtualSyncGetNoCheck(pVM);
    1204         offTscRawSrc = ASMMultU64ByU32DivByU32(offTscRawSrc, pVM->tm.s.cTSCTicksPerSecond, TMCLOCK_FREQ_VIRTUAL);
     1197    switch (pVM->tm.s.enmTSCMode)
     1198    {
     1199        case TMTSCMODE_REAL_TSC_OFFSET:
     1200            offTscRawSrc = SUPReadTsc();
     1201            break;
     1202        case TMTSCMODE_DYNAMIC:
     1203        case TMTSCMODE_VIRT_TSC_EMULATED:
     1204            offTscRawSrc = TMVirtualSyncGetNoCheck(pVM);
     1205            offTscRawSrc = ASMMultU64ByU32DivByU32(offTscRawSrc, pVM->tm.s.cTSCTicksPerSecond, TMCLOCK_FREQ_VIRTUAL);
     1206            break;
     1207        case TMTSCMODE_NATIVE_API:
     1208            /** @todo NEM TSC reset on reset for Windows8+ bug workaround. */
     1209            offTscRawSrc = 0;
     1210            break;
     1211        default:
     1212            AssertFailedBreakStmt(offTscRawSrc = 0);
    12051213    }
    12061214    for (VMCPUID iCpu = 0; iCpu < pVM->cCpus; iCpu++)
     
    33053313    AssertPtr(pVM); Assert(pVM->tm.s.fTSCModeSwitchAllowed); NOREF(pVCpuEmt); NOREF(pvData);
    33063314    Assert(pVM->tm.s.enmTSCMode != TMTSCMODE_REAL_TSC_OFFSET);
     3315    Assert(pVM->tm.s.enmTSCMode != TMTSCMODE_NATIVE_API); /** @todo figure out NEM/win and paravirt */
    33073316    Assert(tmR3HasFixedTSC(pVM));
    33083317
     
    35843593                pHlp->pfnPrintf(pHlp, "\n          offset %RU64", pVCpu->tm.s.offTSCRawSrc);
    35853594        }
     3595        else if (pVM->tm.s.enmTSCMode == TMTSCMODE_NATIVE_API)
     3596            pHlp->pfnPrintf(pHlp, " - native api");
    35863597        else
    35873598            pHlp->pfnPrintf(pHlp, " - virtual clock");
     
    36383649        case TMTSCMODE_VIRT_TSC_EMULATED:  return "VirtTscEmulated";
    36393650        case TMTSCMODE_DYNAMIC:            return "Dynamic";
     3651        case TMTSCMODE_NATIVE_API:         return "NativeApi";
    36403652        default:                           return "???";
    36413653    }
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