VirtualBox

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


Ignore:
Timestamp:
Feb 20, 2019 1:40:22 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128931
Message:

VMM: Further improvments on the IEM timer polling by making it fully configurable. Sideeffect is that EMSTATE_IEM_THEN_REM has now become more accurate and will execute fewer instructions (exactly 1024 rather than up to 1023+4096) before switching to REM.

File:
1 edited

Legend:

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

    r77159 r77380  
    12061206            rc = REMR3Run(pVM, pVCpu);
    12071207#else
    1208             rc = VBOXSTRICTRC_TODO(IEMExecLots(pVCpu, NULL /*pcInstructions*/));
     1208            rc = VBOXSTRICTRC_TODO(IEMExecLots(pVCpu, 8192 /*cMaxInstructions*/, 4095 /*cPollRate*/, NULL /*pcInstructions*/));
    12091209#endif
    12101210            STAM_PROFILE_STOP(&pVCpu->em.s.StatREMExec, c);
     
    13741374    {
    13751375        uint32_t     cInstructions;
    1376         VBOXSTRICTRC rcStrict = IEMExecLots(pVCpu, &cInstructions);
     1376        VBOXSTRICTRC rcStrict = IEMExecLots(pVCpu, 1024 - pVCpu->em.s.cIemThenRemInstructions /*cMaxInstructions*/,
     1377                                            UINT32_MAX/2 /*cPollRate*/, &cInstructions);
    13771378        pVCpu->em.s.cIemThenRemInstructions += cInstructions;
    13781379        if (rcStrict != VINF_SUCCESS)
     
    28942895                case EMSTATE_IEM:
    28952896                {
     2897                    uint32_t cInstructions = 0;
    28962898#if 0 /* For testing purposes. */
    28972899                    STAM_PROFILE_START(&pVCpu->em.s.StatHmExec, x1);
     
    29022904                    else if (rc == VERR_EM_CANNOT_EXEC_GUEST)
    29032905#endif
    2904                         rc = VBOXSTRICTRC_TODO(IEMExecLots(pVCpu, NULL /*pcInstructions*/));
     2906                        rc = VBOXSTRICTRC_TODO(IEMExecLots(pVCpu, 4096 /*cMaxInstructions*/, 2047 /*cPollRate*/, &cInstructions));
    29052907                    if (pVM->em.s.fIemExecutesAll)
    29062908                    {
     
    29082910                        Assert(rc != VINF_EM_RESCHEDULE_RAW);
    29092911                        Assert(rc != VINF_EM_RESCHEDULE_HM);
     2912#ifdef VBOX_HIGH_RES_TIMERS_HACK
     2913                        if (cInstructions < 2048)
     2914                            TMTimerPollVoid(pVM, pVCpu);
     2915#endif
    29102916                    }
    29112917                    fFFDone = false;
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