VirtualBox

Changeset 104405 in vbox for trunk/src


Ignore:
Timestamp:
Apr 23, 2024 9:47:11 PM (13 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162900
Message:

VMM/IEM: Move the opcode checking of the first range from iemTbExec to the TB itself, so that we don't have to replicate this when jumping directly from one TB to the next one. bugref:10656

File:
1 edited

Legend:

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

    r104391 r104405  
    18981898        pVCpu->iem.s.rcPassUp               = VINF_SUCCESS;
    18991899        pVCpu->iem.s.fEndTb                 = false;
    1900         pVCpu->iem.s.fTbCheckOpcodes        = false;
     1900        pVCpu->iem.s.fTbCheckOpcodes        = true; /* (check opcodes for before executing the first instruction) */
    19011901        pVCpu->iem.s.fTbBranched            = IEMBRANCHED_F_NO;
    19021902        pVCpu->iem.s.fTbCrossedPage         = false;
     
    28252825{
    28262826    /*
    2827      * Check the opcodes in the first page before starting execution.
    2828      */
    2829 /** @todo this test should take IEMTB_F_CS_LIM_CHECKS into account or something.
    2830  * The 'near jmp+call' test in bs3-cpu-basic-2 triggers the 2nd assertion here by
    2831  * altering the CS limit such that only one or the two instruction bytes are valid.
    2832  * Since it's a CS_LIMT problem, the pbInstrBuf is good for the full length, and
    2833  * the test succeeds if skipped, but we assert in debug builds. */
    2834     Assert(!(pVCpu->iem.s.GCPhysInstrBuf & (RTGCPHYS)GUEST_PAGE_OFFSET_MASK));
    2835     Assert(pTb->aRanges[0].cbOpcodes <= pVCpu->iem.s.cbInstrBufTotal - pVCpu->iem.s.offInstrNextByte);
    2836     if (memcmp(pTb->pabOpcodes, &pVCpu->iem.s.pbInstrBuf[pTb->aRanges[0].offPhysPage], pTb->aRanges[0].cbOpcodes) == 0)
    2837     { /* likely */ }
    2838     else
    2839     {
    2840         Log7(("TB obsolete: %p GCPhys=%RGp\n", pTb, pTb->GCPhysPc));
    2841         iemThreadedTbObsolete(pVCpu, pTb, true /*fSafeToFree*/);
    2842         return VINF_SUCCESS;
    2843     }
    2844 
    2845     /*
    28462827     * Set the current TB so CIMPL functions may get at it.
    28472828     */
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