VirtualBox

Changeset 102586 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Dec 12, 2023 1:30:02 PM (14 months ago)
Author:
vboxsync
Message:

VMM/IEM: Refactored the IEM_MC_SET_RIP_Uxx_AND_FINISH MCs in prep for native translation. [build fix] bugref:10371

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

Legend:

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

    r102585 r102586  
    242242 *  clears flags. */
    243243#define IEM_MC_SET_RIP_U16_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_u16NewIP) \
    244     return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP))
     244    return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP), 0 /* cbInstr - not used */)
    245245
    246246/** Variant of IEM_MC_SET_RIP_U16_AND_FINISH for 386+ targets that checks and
    247247 *  clears flags. */
    248248#define IEM_MC_SET_RIP_U16_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_u16NewIP) \
    249     return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP))
     249    return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP), 0 /* cbInstr - not used */)
    250250
    251251/** Variant of IEM_MC_SET_RIP_U16_AND_FINISH for use in 64-bit code that checks and
    252252 *  clears flags. */
    253253#define IEM_MC_SET_RIP_U16_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_u16NewIP) \
    254     return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP))
     254    return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP), 0 /* cbInstr - not used */)
    255255
    256256#undef IEM_MC_SET_RIP_U16_AND_FINISH
     
    268268 *  clears flags. */
    269269#define IEM_MC_SET_RIP_U32_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_u32NewEIP) \
    270     return iemRegRipJumpU32AndFinishClearingRF((pVCpu), (a_u32NewEIP))
     270    return iemRegRipJumpU32AndFinishClearingRF((pVCpu), (a_u32NewEIP), 0 /* cbInstr - not used */)
    271271
    272272/** Variant of IEM_MC_SET_RIP_U32_AND_FINISH for use in 64-bit code that checks
    273273 *  and clears flags. */
    274274#define IEM_MC_SET_RIP_U32_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_u32NewEIP) \
    275     return iemRegRipJumpU32AndFinishClearingRF((pVCpu), (a_u32NewEIP))
     275    return iemRegRipJumpU32AndFinishClearingRF((pVCpu), (a_u32NewEIP), 0 /* cbInstr - not used */)
    276276
    277277#undef IEM_MC_SET_RIP_U32_AND_FINISH
     
    285285 *  and clears flags. */
    286286#define IEM_MC_SET_RIP_U64_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_u32NewEIP) \
    287     return iemRegRipJumpU64AndFinishClearingRF((pVCpu), (a_u32NewEIP))
     287    return iemRegRipJumpU64AndFinishClearingRF((pVCpu), (a_u32NewEIP), 0 /* cbInstr - not used */)
    288288
    289289#undef IEM_MC_SET_RIP_U64_AND_FINISH
  • trunk/src/VBox/VMM/include/IEMInline.h

    r102585 r102586  
    27732773
    27742774
     2775#ifdef IEM_WITH_CODE_TLB
    27752776
    27762777/**
     
    27902791    else
    27912792        return iemRaiseGeneralProtectionFault0(pVCpu);
    2792 #ifndef IEM_WITH_CODE_TLB
    2793     pVCpu->iem.s.cbOpcode = IEM_GET_INSTR_LEN(pVCpu);
    2794 #endif
    27952793    return iemRegFinishNoFlags(pVCpu);
    27962794}
     
    28142812    else
    28152813        return iemRaiseGeneralProtectionFault0(pVCpu);
    2816 #ifndef IEM_WITH_CODE_TLB
    2817     pVCpu->iem.s.cbOpcode = IEM_GET_INSTR_LEN(pVCpu);
    2818 #endif
    28192814    return iemRegFinishNoFlags(pVCpu);
    28202815}
     
    28382833    else
    28392834        return iemRaiseGeneralProtectionFault0(pVCpu);
    2840 #ifndef IEM_WITH_CODE_TLB
    2841     pVCpu->iem.s.cbOpcode = IEM_GET_INSTR_LEN(pVCpu);
    2842 #endif
    28432835    return iemRegFinishNoFlags(pVCpu);
    28442836}
    28452837
     2838#endif /* IEM_WITH_CODE_TLB */
    28462839
    28472840/**
     
    28522845 * @param   pVCpu               The cross context virtual CPU structure of the calling thread.
    28532846 * @param   uNewIp              The new IP value.
    2854  */
    2855 DECLINLINE(VBOXSTRICTRC) iemRegRipJumpU16AndFinishClearingRF(PVMCPUCC pVCpu, uint16_t uNewIp) RT_NOEXCEPT
     2847 * @param   cbInstr             The instruction length, for flushing in the non-TLB case.
     2848 */
     2849DECLINLINE(VBOXSTRICTRC) iemRegRipJumpU16AndFinishClearingRF(PVMCPUCC pVCpu, uint16_t uNewIp, uint8_t cbInstr) RT_NOEXCEPT
    28562850{
    28572851    if (RT_LIKELY(   uNewIp <= pVCpu->cpum.GstCtx.cs.u32Limit
     
    28612855        return iemRaiseGeneralProtectionFault0(pVCpu);
    28622856#ifndef IEM_WITH_CODE_TLB
    2863     pVCpu->iem.s.cbOpcode = IEM_GET_INSTR_LEN(pVCpu);
     2857    iemOpcodeFlushLight(pVCpu, cbInstr);
     2858#else
     2859    RT_NOREF_PV(cbInstr);
    28642860#endif
    28652861    return iemRegFinishClearingRF(pVCpu);
     
    28742870 * @param   pVCpu               The cross context virtual CPU structure of the calling thread.
    28752871 * @param   uNewEip             The new EIP value.
    2876  */
    2877 DECLINLINE(VBOXSTRICTRC) iemRegRipJumpU32AndFinishClearingRF(PVMCPUCC pVCpu, uint32_t uNewEip) RT_NOEXCEPT
     2872 * @param   cbInstr             The instruction length, for flushing in the non-TLB case.
     2873 */
     2874DECLINLINE(VBOXSTRICTRC) iemRegRipJumpU32AndFinishClearingRF(PVMCPUCC pVCpu, uint32_t uNewEip, uint8_t cbInstr) RT_NOEXCEPT
    28782875{
    28792876    Assert(pVCpu->cpum.GstCtx.rip <= UINT32_MAX);
     
    28842881        return iemRaiseGeneralProtectionFault0(pVCpu);
    28852882#ifndef IEM_WITH_CODE_TLB
    2886     pVCpu->iem.s.cbOpcode = IEM_GET_INSTR_LEN(pVCpu);
     2883    iemOpcodeFlushLight(pVCpu, cbInstr);
     2884#else
     2885    RT_NOREF_PV(cbInstr);
    28872886#endif
    28882887    return iemRegFinishClearingRF(pVCpu);
     
    28982897 * @param   pVCpu               The cross context virtual CPU structure of the calling thread.
    28992898 * @param   uNewRip             The new RIP value.
    2900  */
    2901 DECLINLINE(VBOXSTRICTRC) iemRegRipJumpU64AndFinishClearingRF(PVMCPUCC pVCpu, uint64_t uNewRip) RT_NOEXCEPT
     2899 * @param   cbInstr             The instruction length, for flushing in the non-TLB case.
     2900 */
     2901DECLINLINE(VBOXSTRICTRC) iemRegRipJumpU64AndFinishClearingRF(PVMCPUCC pVCpu, uint64_t uNewRip, uint8_t cbInstr) RT_NOEXCEPT
    29022902{
    29032903    Assert(IEM_IS_64BIT_CODE(pVCpu));
     
    29072907        return iemRaiseGeneralProtectionFault0(pVCpu);
    29082908#ifndef IEM_WITH_CODE_TLB
    2909     pVCpu->iem.s.cbOpcode = IEM_GET_INSTR_LEN(pVCpu);
     2909    iemOpcodeFlushLight(pVCpu, cbInstr);
     2910#else
     2911    RT_NOREF_PV(cbInstr);
    29102912#endif
    29112913    return iemRegFinishClearingRF(pVCpu);
  • trunk/src/VBox/VMM/include/IEMMc.h

    r102585 r102586  
    7373    return iemRegRipRelativeJumpS32AndFinishClearingRF(pVCpu, IEM_GET_INSTR_LEN(pVCpu), (a_i32), pVCpu->iem.s.enmEffOpSize)
    7474/** Sets RIP (may trigger \#GP), finishes the instruction and returns. */
    75 #define IEM_MC_SET_RIP_U16_AND_FINISH(a_u16NewIP)       return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP))
     75#define IEM_MC_SET_RIP_U16_AND_FINISH(a_u16NewIP) \
     76    return iemRegRipJumpU16AndFinishClearingRF((pVCpu), (a_u16NewIP), IEM_GET_INSTR_LEN(pVCpu))
    7677/** Sets RIP (may trigger \#GP), finishes the instruction and returns. */
    77 #define IEM_MC_SET_RIP_U32_AND_FINISH(a_u32NewIP)       return iemRegRipJumpU32AndFinishClearingRF((pVCpu), (a_u32NewIP))
     78#define IEM_MC_SET_RIP_U32_AND_FINISH(a_u32NewIP) \
     79    return iemRegRipJumpU32AndFinishClearingRF((pVCpu), (a_u32NewIP), IEM_GET_INSTR_LEN(pVCpu))
    7880/** Sets RIP (may trigger \#GP), finishes the instruction and returns. */
    79 #define IEM_MC_SET_RIP_U64_AND_FINISH(a_u64NewIP)       return iemRegRipJumpU64AndFinishClearingRF((pVCpu), (a_u64NewIP))
     81#define IEM_MC_SET_RIP_U64_AND_FINISH(a_u64NewIP) \
     82    return iemRegRipJumpU64AndFinishClearingRF((pVCpu), (a_u64NewIP), IEM_GET_INSTR_LEN(pVCpu))
    8083
    8184#define IEM_MC_RAISE_DIVIDE_ERROR()                     return iemRaiseDivideError(pVCpu)
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