VirtualBox

Changeset 105877 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Aug 27, 2024 11:17:09 PM (6 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164597
Message:

VMM/IEM: Don't flush PC prior to 64-bit relative jumps, flush it when in the #GP(0) code path. bugref:10720 bugref:10373

Location:
trunk/src/VBox/VMM/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r105853 r105877  
    14481448        /* kIemTbDbgEntryType_DelayedPcUpdate. */
    14491449        uint32_t    uType         : 4;
     1450        /** Number of instructions skipped. */
     1451        uint32_t    cInstrSkipped : 8;
    14501452        /* The instruction offset added to the program counter. */
    1451         uint32_t    offPc         : 14;
    1452         /** Number of instructions skipped. */
    1453         uint32_t    cInstrSkipped : 14;
     1453        int32_t     offPc         : 20;
    14541454    } DelayedPcUpdate;
    14551455#endif
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r105863 r105877  
    12581258     * as long as possible. */
    12591259    int64_t                     offPc;
    1260 # if defined(IEMNATIVE_WITH_TB_DEBUG_INFO) || defined(VBOX_WITH_STATISTICS)
    1261     /** Statistics: The idxInstr+1 value at the last PC update. */
    1262     uint8_t                     idxInstrPlusOneOfLastPcUpdate;
    1263 # endif
    12641260# ifdef IEMNATIVE_WITH_DELAYED_PC_UPDATING_DEBUG
    12651261    /** Set after we've loaded PC into uPcUpdatingDebug at the first update. */
     
    14631459#endif
    14641460
     1461#if defined(IEMNATIVE_WITH_TB_DEBUG_INFO) || defined(VBOX_WITH_STATISTICS)
     1462    /** Statistics: The idxInstr+1 value at the last PC update. */
     1463    uint8_t                     idxInstrPlusOneOfLastPcUpdate;
     1464#endif
     1465
    14651466#ifdef IEMNATIVE_WITH_TB_DEBUG_INFO
    14661467    /** Number of debug info entries allocated for pDbgInfo. */
    14671468    uint32_t                    cDbgInfoAlloc;
    1468     uint32_t                    uPadding;
    14691469    /** Debug info. */
    14701470    PIEMTBDBG                   pDbgInfo;
  • trunk/src/VBox/VMM/include/IEMN8veRecompilerEmit.h

    r105856 r105877  
    10591059 */
    10601060DECL_INLINE_THROW(uint32_t)
    1061 iemNativeEmitStoreImmToVCpuU8(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t bImm, uint32_t offVCpu)
     1061iemNativeEmitStoreImmToVCpuU8(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t bImm, uint32_t offVCpu,
     1062                              uint8_t idxRegTmp = UINT8_MAX)
    10621063{
    10631064#ifdef RT_ARCH_AMD64
     
    10681069    pbCodeBuf[off++] = bImm;
    10691070    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     1071    RT_NOREF(idxRegTmp);
    10701072
    10711073#elif defined(RT_ARCH_ARM64)
    10721074    /* Cannot use IEMNATIVE_REG_FIXED_TMP0 for the immediate as that's used by iemNativeEmitGprByVCpuLdSt. */
    1073     uint8_t const idxRegImm = iemNativeRegAllocTmpImm(pReNative, &off, bImm);
    1074     off = iemNativeEmitGprByVCpuLdSt(pReNative, off, idxRegImm, offVCpu, kArmv8A64InstrLdStType_St_Byte, sizeof(uint8_t));
    1075     iemNativeRegFreeTmpImm(pReNative, idxRegImm);
     1075    if (idxRegTmp != UINT8_MAX)
     1076    {
     1077        Assert(idxRegTmp != IEMNATIVE_REG_FIXED_TMP0);
     1078        off = iemNativeEmitLoadGprImm32(pReNative, off, idxRegTmp, bImm);
     1079        off = iemNativeEmitGprByVCpuLdSt(pReNative, off, idxRegTmp, offVCpu, kArmv8A64InstrLdStType_St_Byte, sizeof(uint8_t));
     1080    }
     1081    else
     1082    {
     1083        uint8_t const idxRegImm = iemNativeRegAllocTmpImm(pReNative, &off, bImm);
     1084        off = iemNativeEmitGprByVCpuLdSt(pReNative, off, idxRegImm, offVCpu, kArmv8A64InstrLdStType_St_Byte, sizeof(uint8_t));
     1085        iemNativeRegFreeTmpImm(pReNative, idxRegImm);
     1086    }
    10761087
    10771088#else
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