VirtualBox

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


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/VMMAll/IEMAll.cpp

    r77378 r77380  
    1433714337
    1433814338
    14339 VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPU pVCpu, uint32_t *pcInstructions)
     14339VMMDECL(VBOXSTRICTRC) IEMExecLots(PVMCPU pVCpu, uint32_t cMaxInstructions, uint32_t cPollRate, uint32_t *pcInstructions)
    1434014340{
    1434114341    uint32_t const cInstructionsAtStart = pVCpu->iem.s.cInstructions;
     14342    AssertMsg(RT_IS_POWER_OF_TWO(cPollRate + 1), ("%#x\n", cPollRate));
    1434214343
    1434314344    /*
     
    1438614387     * Initial decoder init w/ prefetch, then setup setjmp.
    1438714388     */
    14388     unsigned     cTimerPoll = 0;
    1438914389    VBOXSTRICTRC rcStrict = iemInitDecoderAndPrefetchOpcodes(pVCpu, false);
    1439014390    if (rcStrict == VINF_SUCCESS)
     
    1440114401             * The run loop.  We limit ourselves to 4096 instructions right now.
    1440214402             */
    14403             PVM         pVM    = pVCpu->CTX_SUFF(pVM);
    14404             uint32_t    cInstr = 4096;
     14403            PVM pVM = pVCpu->CTX_SUFF(pVM);
    1440514404            for (;;)
    1440614405            {
     
    1444214441                                      && !VM_FF_IS_ANY_SET(pVM, VM_FF_ALL_MASK) ))
    1444314442                        {
    14444                             if (cInstr-- > 0)
     14443                            if (cMaxInstructions-- > 0)
    1444514444                            {
    14446                                 /* Poll timers every 128 call*/
    14447                                 if (   (++cTimerPoll & 0x7f) != 0
     14445                                /* Poll timers every 2048 instructions. */
     14446                                if (   (cMaxInstructions & cPollRate) != 0
    1444814447                                    || !TMTimerPollBool(pVM, pVCpu))
    1444914448                                {
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