VirtualBox

忽略:
時間撮記:
2024-1-15 下午02:26:27 (13 月 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
161096
訊息:

VMM/IEM: Call different threaded functions for each branch in a conditional jump (jcc, loop, loopcc) so we can quit immediately when taking a different branch from what we did during compilation. bugref:10371

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/VMM/VMMAll/IEMAllThrdFuncs.cpp

    r102586 r102876  
    7979/** Variant of IEM_MC_ADVANCE_RIP_AND_FINISH with instruction length as param
    8080 *  and only used when we're in 16-bit code on a pre-386 CPU. */
    81 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC16(a_cbInstr) \
    82     return iemRegAddToIp16AndFinishingNoFlags(pVCpu, a_cbInstr)
     81#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC16(a_cbInstr, a_rcNormal) \
     82    return iemRegAddToIp16AndFinishingNoFlags(pVCpu, a_cbInstr, a_rcNormal)
    8383
    8484/** Variant of IEM_MC_ADVANCE_RIP_AND_FINISH with instruction length as param
    8585 *  and used for 16-bit and 32-bit code on 386 and later CPUs. */
    86 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC32(a_cbInstr) \
    87     return iemRegAddToEip32AndFinishingNoFlags(pVCpu, a_cbInstr)
     86#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC32(a_cbInstr, a_rcNormal) \
     87    return iemRegAddToEip32AndFinishingNoFlags(pVCpu, a_cbInstr, a_rcNormal)
    8888
    8989/** Variant of IEM_MC_ADVANCE_RIP_AND_FINISH with instruction length as param
    9090 *  and only used when we're in 64-bit code. */
    91 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC64(a_cbInstr) \
    92     return iemRegAddToRip64AndFinishingNoFlags(pVCpu, a_cbInstr)
     91#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC64(a_cbInstr, a_rcNormal) \
     92    return iemRegAddToRip64AndFinishingNoFlags(pVCpu, a_cbInstr, a_rcNormal)
    9393
    9494
     
    9696 *  and only used when we're in 16-bit code on a pre-386 CPU and we need to
    9797 *  check and clear flags. */
    98 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_cbInstr) \
    99     return iemRegAddToIp16AndFinishingClearingRF(pVCpu, a_cbInstr)
     98#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_cbInstr, a_rcNormal) \
     99    return iemRegAddToIp16AndFinishingClearingRF(pVCpu, a_cbInstr, a_rcNormal)
    100100
    101101/** Variant of IEM_MC_ADVANCE_RIP_AND_FINISH with instruction length as param
    102102 *  and used for 16-bit and 32-bit code on 386 and later CPUs and we need to
    103103 *  check and clear flags. */
    104 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_cbInstr) \
    105     return iemRegAddToEip32AndFinishingClearingRF(pVCpu, a_cbInstr)
     104#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_cbInstr, a_rcNormal) \
     105    return iemRegAddToEip32AndFinishingClearingRF(pVCpu, a_cbInstr, a_rcNormal)
    106106
    107107/** Variant of IEM_MC_ADVANCE_RIP_AND_FINISH with instruction length as param
    108108 *  and only used when we're in 64-bit code and we need to check and clear
    109109 *  flags. */
    110 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_cbInstr) \
    111     return iemRegAddToRip64AndFinishingClearingRF(pVCpu, a_cbInstr)
     110#define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_cbInstr, a_rcNormal) \
     111    return iemRegAddToRip64AndFinishingClearingRF(pVCpu, a_cbInstr, a_rcNormal)
    112112
    113113#undef  IEM_MC_ADVANCE_RIP_AND_FINISH
     
    116116/** Variant of IEM_MC_REL_JMP_S8_AND_FINISH with instruction length as extra
    117117 *  parameter, for use in 16-bit code on a pre-386 CPU. */
    118 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC16(a_i8, a_cbInstr) \
    119     return iemRegIp16RelativeJumpS8AndFinishNoFlags(pVCpu, a_cbInstr, (a_i8))
     118#define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC16(a_i8, a_cbInstr, a_rcNormal) \
     119    return iemRegIp16RelativeJumpS8AndFinishNoFlags(pVCpu, a_cbInstr, (a_i8), a_rcNormal)
    120120
    121121/** Variant of IEM_MC_REL_JMP_S8_AND_FINISH with instruction length and operand
    122122 * size as extra parameters, for use in 16-bit and 32-bit code on 386 and
    123123 * later CPUs. */
    124 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC32(a_i8, a_cbInstr, a_enmEffOpSize) \
    125     return iemRegEip32RelativeJumpS8AndFinishNoFlags(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize)
     124#define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC32(a_i8, a_cbInstr, a_enmEffOpSize, a_rcNormal) \
     125    return iemRegEip32RelativeJumpS8AndFinishNoFlags(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize, a_rcNormal)
    126126
    127127/** Variant of IEM_MC_REL_JMP_S8_AND_FINISH with instruction length and operand
    128128 * size as extra parameters, for use in 64-bit code. */
    129 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC64(a_i8, a_cbInstr, a_enmEffOpSize) \
    130     return iemRegRip64RelativeJumpS8AndFinishNoFlags(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize)
     129#define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC64(a_i8, a_cbInstr, a_enmEffOpSize, a_rcNormal) \
     130    return iemRegRip64RelativeJumpS8AndFinishNoFlags(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize, a_rcNormal)
    131131
    132132
     
    134134 *  parameter, for use in 16-bit code on a pre-386 CPU and we need to check and
    135135 *  clear flags. */
    136 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_i8, a_cbInstr) \
    137     return iemRegIp16RelativeJumpS8AndFinishClearingRF(pVCpu, a_cbInstr, (a_i8))
     136#define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_i8, a_cbInstr, a_rcNormal) \
     137    return iemRegIp16RelativeJumpS8AndFinishClearingRF(pVCpu, a_cbInstr, (a_i8), a_rcNormal)
    138138
    139139/** Variant of IEM_MC_REL_JMP_S8_AND_FINISH with instruction length and operand
    140140 * size as extra parameters, for use in 16-bit and 32-bit code on 386 and
    141141 * later CPUs and we need to check and clear flags. */
    142 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_i8, a_cbInstr, a_enmEffOpSize) \
    143     return iemRegEip32RelativeJumpS8AndFinishClearingRF(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize)
     142#define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_i8, a_cbInstr, a_enmEffOpSize, a_rcNormal) \
     143    return iemRegEip32RelativeJumpS8AndFinishClearingRF(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize, a_rcNormal)
    144144
    145145/** Variant of IEM_MC_REL_JMP_S8_AND_FINISH with instruction length and operand
    146146 * size as extra parameters, for use in 64-bit code and we need to check and
    147147 * clear flags. */
    148 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_i8, a_cbInstr, a_enmEffOpSize) \
    149     return iemRegRip64RelativeJumpS8AndFinishClearingRF(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize)
     148#define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_i8, a_cbInstr, a_enmEffOpSize, a_rcNormal) \
     149    return iemRegRip64RelativeJumpS8AndFinishClearingRF(pVCpu, a_cbInstr, (a_i8), a_enmEffOpSize, a_rcNormal)
    150150
    151151#undef  IEM_MC_REL_JMP_S8_AND_FINISH
     
    154154/** Variant of IEM_MC_REL_JMP_S16_AND_FINISH with instruction length as
    155155 *  param, for use in 16-bit code on a pre-386 CPU. */
    156 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC16(a_i16, a_cbInstr) \
    157     return iemRegEip32RelativeJumpS16AndFinishNoFlags(pVCpu, a_cbInstr, (a_i16))
     156#define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC16(a_i16, a_cbInstr, a_rcNormal) \
     157    return iemRegEip32RelativeJumpS16AndFinishNoFlags(pVCpu, a_cbInstr, (a_i16), a_rcNormal)
    158158
    159159/** Variant of IEM_MC_REL_JMP_S16_AND_FINISH with instruction length as
    160160 *  param, for use in 16-bit and 32-bit code on 386 and later CPUs. */
    161 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC32(a_i16, a_cbInstr) \
    162     return iemRegEip32RelativeJumpS16AndFinishNoFlags(pVCpu, a_cbInstr, (a_i16))
     161#define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC32(a_i16, a_cbInstr, a_rcNormal) \
     162    return iemRegEip32RelativeJumpS16AndFinishNoFlags(pVCpu, a_cbInstr, (a_i16), a_rcNormal)
    163163
    164164/** Variant of IEM_MC_REL_JMP_S16_AND_FINISH with instruction length as
    165165 *  param, for use in 64-bit code. */
    166 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC64(a_i16, a_cbInstr) \
    167     return iemRegRip64RelativeJumpS16AndFinishNoFlags(pVCpu, a_cbInstr, (a_i16))
     166#define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC64(a_i16, a_cbInstr, a_rcNormal) \
     167    return iemRegRip64RelativeJumpS16AndFinishNoFlags(pVCpu, a_cbInstr, (a_i16), a_rcNormal)
    168168
    169169
     
    171171 *  param, for use in 16-bit code on a pre-386 CPU and we need to check and
    172172 *  clear flags. */
    173 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_i16, a_cbInstr) \
    174     return iemRegEip32RelativeJumpS16AndFinishClearingRF(pVCpu, a_cbInstr, (a_i16))
     173#define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_i16, a_cbInstr, a_rcNormal) \
     174    return iemRegEip32RelativeJumpS16AndFinishClearingRF(pVCpu, a_cbInstr, (a_i16), a_rcNormal)
    175175
    176176/** Variant of IEM_MC_REL_JMP_S16_AND_FINISH with instruction length as
    177177 *  param, for use in 16-bit and 32-bit code on 386 and later CPUs and we need
    178178 *  to check and clear flags. */
    179 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_i16, a_cbInstr) \
    180     return iemRegEip32RelativeJumpS16AndFinishClearingRF(pVCpu, a_cbInstr, (a_i16))
     179#define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_i16, a_cbInstr, a_rcNormal) \
     180    return iemRegEip32RelativeJumpS16AndFinishClearingRF(pVCpu, a_cbInstr, (a_i16), a_rcNormal)
    181181
    182182/** Variant of IEM_MC_REL_JMP_S16_AND_FINISH with instruction length as
    183183 *  param, for use in 64-bit code and we need to check and clear flags. */
    184 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_i16, a_cbInstr) \
    185     return iemRegRip64RelativeJumpS16AndFinishClearingRF(pVCpu, a_cbInstr, (a_i16))
     184#define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_i16, a_cbInstr, a_rcNormal) \
     185    return iemRegRip64RelativeJumpS16AndFinishClearingRF(pVCpu, a_cbInstr, (a_i16), a_rcNormal)
    186186
    187187#undef  IEM_MC_REL_JMP_S16_AND_FINISH
     
    191191 *  an extra parameter - dummy for pre-386 variations not eliminated by the
    192192 *  python script. */
    193 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC16(a_i32, a_cbInstr) \
    194     do { RT_NOREF(pVCpu, a_i32, a_cbInstr); AssertFailedReturn(VERR_IEM_IPE_9); } while (0)
     193#define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC16(a_i32, a_cbInstr, a_rcNormal) \
     194    do { RT_NOREF(pVCpu, a_i32, a_cbInstr, a_rcNormal); AssertFailedReturn(VERR_IEM_IPE_9); } while (0)
    195195
    196196/** Variant of IEM_MC_REL_JMP_S32_AND_FINISH with instruction length as
    197197 *  an extra parameter, for use in 16-bit and 32-bit code on 386+. */
    198 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC32(a_i32, a_cbInstr) \
    199     return iemRegEip32RelativeJumpS32AndFinishNoFlags(pVCpu, a_cbInstr, (a_i32))
     198#define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC32(a_i32, a_cbInstr, a_rcNormal) \
     199    return iemRegEip32RelativeJumpS32AndFinishNoFlags(pVCpu, a_cbInstr, (a_i32), a_rcNormal)
    200200
    201201/** Variant of IEM_MC_REL_JMP_S32_AND_FINISH with instruction length as
    202202 *  an extra parameter, for use in 64-bit code. */
    203 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC64(a_i32, a_cbInstr) \
    204     return iemRegRip64RelativeJumpS32AndFinishNoFlags(pVCpu, a_cbInstr, (a_i32))
     203#define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC64(a_i32, a_cbInstr, a_rcNormal) \
     204    return iemRegRip64RelativeJumpS32AndFinishNoFlags(pVCpu, a_cbInstr, (a_i32), a_rcNormal)
    205205
    206206
     
    208208 *  an extra parameter - dummy for pre-386 variations not eliminated by the
    209209 *  python script. */
    210 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_i32, a_cbInstr) \
    211     do { RT_NOREF(pVCpu, a_i32, a_cbInstr); AssertFailedReturn(VERR_IEM_IPE_9); } while (0)
     210#define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC16_WITH_FLAGS(a_i32, a_cbInstr, a_rcNormal) \
     211    do { RT_NOREF(pVCpu, a_i32, a_cbInstr, a_rcNormal); AssertFailedReturn(VERR_IEM_IPE_9); } while (0)
    212212
    213213/** Variant of IEM_MC_REL_JMP_S32_AND_FINISH with instruction length as
    214214 *  an extra parameter, for use in 16-bit and 32-bit code on 386+ and we need
    215215 *  to check and clear flags. */
    216 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_i32, a_cbInstr) \
    217     return iemRegEip32RelativeJumpS32AndFinishClearingRF(pVCpu, a_cbInstr, (a_i32))
     216#define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC32_WITH_FLAGS(a_i32, a_cbInstr, a_rcNormal) \
     217    return iemRegEip32RelativeJumpS32AndFinishClearingRF(pVCpu, a_cbInstr, (a_i32), a_rcNormal)
    218218
    219219/** Variant of IEM_MC_REL_JMP_S32_AND_FINISH with instruction length as
    220220 *  an extra parameter, for use in 64-bit code and we need to check and clear
    221221 *  flags. */
    222 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_i32, a_cbInstr) \
    223     return iemRegRip64RelativeJumpS32AndFinishClearingRF(pVCpu, a_cbInstr, (a_i32))
     222#define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC64_WITH_FLAGS(a_i32, a_cbInstr, a_rcNormal) \
     223    return iemRegRip64RelativeJumpS32AndFinishClearingRF(pVCpu, a_cbInstr, (a_i32), a_rcNormal)
    224224
    225225#undef  IEM_MC_REL_JMP_S32_AND_FINISH
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette