VirtualBox

Ignore:
Timestamp:
Jun 27, 2023 10:25:44 PM (22 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
158020
Message:

VMM/IEM: Added missing VM_FF checks and timer polling (TMTimerPollBool) to the IEMExecRecompilerThreaded loop. This fixes slow interrupt deliver and whatnot. bugref:10369

File:
1 edited

Legend:

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

    r100277 r100305  
    169169        struct
    170170        {
     171            /** The call sequence table. */
     172            PIEMTHRDEDCALLENTRY paCalls;
    171173            /** Number of calls in paCalls. */
    172174            uint16_t            cCalls;
    173175            /** Number of calls allocated. */
    174176            uint16_t            cAllocated;
    175             /** The call sequence table. */
    176             PIEMTHRDEDCALLENTRY paCalls;
    177177        } Thrd;
    178178    };
     
    10471047            pTb->cbOpcodes += pVCpu->iem.s.offOpcode;
    10481048            Assert(pTb->cbOpcodes <= pTb->cbOpcodesAllocated);
     1049            pVCpu->iem.s.cInstructions++;
    10491050        }
    10501051        else if (pTb->Thrd.cCalls > 0)
     
    10571058                pTb->cbOpcodes += pVCpu->iem.s.offOpcode;
    10581059                Assert(pTb->cbOpcodes <= pTb->cbOpcodesAllocated);
     1060                pVCpu->iem.s.cInstructions++;
    10591061            }
    10601062            break;
     
    11171119    /* Set the current TB so CIMPL function may get at it. */
    11181120    pVCpu->iem.s.pCurTbR3 = pTb;
     1121    pVCpu->iem.s.cTbExec++;
    11191122
    11201123    /* The execution loop. */
     
    12581261        IEM_TRY_SETJMP(pVCpu, rcStrict)
    12591262        {
    1260             for (;;)
     1263            uint32_t const cPollRate = 511; /* EM.cpp passes 4095 to IEMExecLots, so an eigth of that seems reasonable for now. */
     1264            for (uint32_t iIterations = 0; ; iIterations++)
    12611265            {
    12621266                /* Translate PC to physical address, we'll need this for both lookup and compilation. */
     
    12781282                                                  | VMCPU_FF_TLB_FLUSH
    12791283                                                  | VMCPU_FF_UNHALT );
    1280                     if (!fCpu)
     1284                    if (RT_LIKELY(   (   !fCpu
     1285                                      || (   !(fCpu & ~(VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC))
     1286                                          && !pVCpu->cpum.GstCtx.rflags.Bits.u1IF) )
     1287                                  && !VM_FF_IS_ANY_SET(pVM, VM_FF_ALL_MASK) ))
    12811288                    {
    1282                         /* likely */
     1289                        if (RT_LIKELY(   (iIterations & cPollRate) != 0
     1290                                      || !TMTimerPollBool(pVM, pVCpu)))
     1291                        {
     1292
     1293                        }
     1294                        else
     1295                            return VINF_SUCCESS;
    12831296                    }
    12841297                    else
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