- Timestamp:
- Jul 6, 2016 4:37:04 PM (9 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r62027 r62076 83 83 #define IEM_IMPLEMENTS_TASKSWITCH 84 84 85 85 86 /********************************************************************************************************************************* 86 87 * Header Files * 87 88 *********************************************************************************************************************************/ 88 89 #define LOG_GROUP LOG_GROUP_IEM 90 #define VMCPU_INCL_CPUM_GST_CTX 89 91 #include <VBox/vmm/iem.h> 90 92 #include <VBox/vmm/cpum.h> … … 292 294 * @param a_pVCpu The IEM state of the current CPU. 293 295 */ 294 #define IEM_IS_REAL_OR_V86_MODE(a_pVCpu) (CPUMIsGuestInRealOrV86ModeEx( (a_pVCpu)->iem.s.CTX_SUFF(pCtx)))296 #define IEM_IS_REAL_OR_V86_MODE(a_pVCpu) (CPUMIsGuestInRealOrV86ModeEx(IEM_GET_CTX(a_pVCpu))) 295 297 296 298 /** … … 298 300 * 299 301 * @returns @c true if it is, @c false if not. 300 * @param a_pVCpu The IEM state of the current CPU.301 */ 302 #define IEM_IS_V86_MODE(a_pVCpu) (CPUMIsGuestInV86ModeEx( (a_pVCpu)->iem.s.CTX_SUFF(pCtx)))302 * @param a_pVCpu The cross context virtual CPU structure of the calling thread. 303 */ 304 #define IEM_IS_V86_MODE(a_pVCpu) (CPUMIsGuestInV86ModeEx(IEM_GET_CTX(a_pVCpu))) 303 305 304 306 /** … … 306 308 * 307 309 * @returns @c true if it is, @c false if not. 308 * @param a_pVCpu The IEM state of the current CPU.309 */ 310 #define IEM_IS_LONG_MODE(a_pVCpu) (CPUMIsGuestInLongModeEx( (a_pVCpu)->iem.s.CTX_SUFF(pCtx)))310 * @param a_pVCpu The cross context virtual CPU structure of the calling thread. 311 */ 312 #define IEM_IS_LONG_MODE(a_pVCpu) (CPUMIsGuestInLongModeEx(IEM_GET_CTX(a_pVCpu))) 311 313 312 314 /** … … 314 316 * 315 317 * @returns @c true if it is, @c false if not. 316 * @param a_pVCpu The IEM state of the current CPU.317 */ 318 #define IEM_IS_REAL_MODE(a_pVCpu) (CPUMIsGuestInRealModeEx( (a_pVCpu)->iem.s.CTX_SUFF(pCtx)))318 * @param a_pVCpu The cross context virtual CPU structure of the calling thread. 319 */ 320 #define IEM_IS_REAL_MODE(a_pVCpu) (CPUMIsGuestInRealModeEx(IEM_GET_CTX(a_pVCpu))) 319 321 320 322 /** 321 323 * Returns a (const) pointer to the CPUMFEATURES for the guest CPU. 322 324 * @returns PCCPUMFEATURES 323 * @param a_pVCpu The IEM state of the current CPU.325 * @param a_pVCpu The cross context virtual CPU structure of the calling thread. 324 326 */ 325 327 #define IEM_GET_GUEST_CPU_FEATURES(a_pVCpu) (&((a_pVCpu)->CTX_SUFF(pVM)->cpum.ro.GuestFeatures)) … … 328 330 * Returns a (const) pointer to the CPUMFEATURES for the host CPU. 329 331 * @returns PCCPUMFEATURES 330 * @param a_pVCpu The IEM state of the current CPU.332 * @param a_pVCpu The cross context virtual CPU structure of the calling thread. 331 333 */ 332 334 #define IEM_GET_HOST_CPU_FEATURES(a_pVCpu) (&((a_pVCpu)->CTX_SUFF(pVM)->cpum.ro.HostFeatures)) … … 821 823 DECLINLINE(void) iemInitExec(PVMCPU pVCpu, bool fBypassHandlers) 822 824 { 823 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);825 PCPUMCTX const pCtx = IEM_GET_CTX(pVCpu); 824 826 825 827 Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_IEM)); … … 906 908 DECLINLINE(void) iemInitDecoder(PVMCPU pVCpu, bool fBypassHandlers) 907 909 { 908 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);910 PCPUMCTX const pCtx = IEM_GET_CTX(pVCpu); 909 911 910 912 Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_IEM)); … … 989 991 DECLINLINE(void) iemReInitDecoder(PVMCPU pVCpu) 990 992 { 991 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);993 PCPUMCTX const pCtx = IEM_GET_CTX(pVCpu); 992 994 993 995 Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_IEM)); … … 1092 1094 * First translate CS:rIP to a physical address. 1093 1095 */ 1094 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1096 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1095 1097 uint32_t cbToTryRead; 1096 1098 RTGCPTR GCPtrPC; … … 1252 1254 * First translate CS:rIP to a physical address. 1253 1255 */ 1254 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1256 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1255 1257 uint8_t cbLeft = pVCpu->iem.s.cbOpcode - pVCpu->iem.s.offOpcode; Assert(cbLeft < cbMin); 1256 1258 uint32_t cbToTryRead; … … 4357 4359 uint64_t uCr2) 4358 4360 { 4359 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4361 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4360 4362 #ifdef IN_RING0 4361 4363 int rc = HMR0EnsureCompleteBasicContext(pVCpu, pCtx); … … 4517 4519 { 4518 4520 /** @todo set/clear RF. */ 4519 pVCpu->iem.s.CTX_SUFF(pCtx)->dr[7] &= ~X86_DR7_GD;4521 IEM_GET_CTX(pVCpu)->dr[7] &= ~X86_DR7_GD; 4520 4522 return iemRaiseXcptOrInt(pVCpu, 0, X86_XCPT_DB, IEM_XCPT_FLAGS_T_CPU_XCPT, 0, 0); 4521 4523 } … … 4547 4549 { 4548 4550 return iemRaiseXcptOrInt(pVCpu, 0, X86_XCPT_TS, IEM_XCPT_FLAGS_T_CPU_XCPT | IEM_XCPT_FLAGS_ERR, 4549 pVCpu->iem.s.CTX_SUFF(pCtx)->tr.Sel, 0);4551 IEM_GET_CTX(pVCpu)->tr.Sel, 0); 4550 4552 } 4551 4553 … … 4721 4723 4722 4724 if ( (fAccess & IEM_ACCESS_WHAT_MASK) == IEM_ACCESS_WHAT_CODE 4723 && ( ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr4 & X86_CR4_PAE)4724 && ( pVCpu->iem.s.CTX_SUFF(pCtx)->msrEFER & MSR_K6_EFER_NXE) ) )4725 && ( (IEM_GET_CTX(pVCpu)->cr4 & X86_CR4_PAE) 4726 && (IEM_GET_CTX(pVCpu)->msrEFER & MSR_K6_EFER_NXE) ) ) 4725 4727 uErr |= X86_TRAP_PF_ID; 4726 4728 … … 4922 4924 RTAssertMsg2Weak("%s%s\n", szRegs, szInstr); 4923 4925 #else 4924 RTAssertMsg2Weak("cs:rip=%04x:%RX64\n", pVCpu->iem.s.CTX_SUFF(pCtx)->cs, pVCpu->iem.s.CTX_SUFF(pCtx)->rip);4926 RTAssertMsg2Weak("cs:rip=%04x:%RX64\n", IEM_GET_CTX(pVCpu)->cs, IEM_GET_CTX(pVCpu)->rip); 4925 4927 #endif 4926 4928 } … … 4996 4998 IEM_STATIC PCPUMSELREG iemSRegGetHid(PVMCPU pVCpu, uint8_t iSegReg) 4997 4999 { 4998 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4999 5000 5000 Assert(iSegReg < X86_SREG_COUNT); 5001 AssertCompileAdjacentMembers(CPUMCTX, es, cs); 5002 AssertCompileAdjacentMembers(CPUMCTX, cs, ss); 5003 AssertCompileAdjacentMembers(CPUMCTX, ss, ds); 5004 AssertCompileAdjacentMembers(CPUMCTX, ds, fs); 5005 AssertCompileAdjacentMembers(CPUMCTX, fs, gs); 5006 PCPUMSELREG pSReg = &pCtx->es + iSegReg; 5001 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5002 PCPUMSELREG pSReg = &pCtx->aSRegs[iSegReg]; 5007 5003 5008 5004 #ifdef VBOX_WITH_RAW_MODE_NOT_R0 … … 5048 5044 IEM_STATIC uint16_t *iemSRegRef(PVMCPU pVCpu, uint8_t iSegReg) 5049 5045 { 5050 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx); 5046 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5047 #if 0 5048 Assert(iSegReg < X86_SREG_COUNT); 5049 return &pCtx->aSRegs[iSegReg].Sel; 5050 #else 5051 5051 switch (iSegReg) 5052 5052 { … … 5059 5059 } 5060 5060 AssertFailedReturn(NULL); 5061 #endif 5061 5062 } 5062 5063 … … 5071 5072 IEM_STATIC uint16_t iemSRegFetchU16(PVMCPU pVCpu, uint8_t iSegReg) 5072 5073 { 5073 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx); 5074 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5075 #if 0 5076 Assert(iSegReg < X86_SREG_COUNT); 5077 return pCtx->aSRegs[iSegReg].Sel; 5078 #else 5074 5079 switch (iSegReg) 5075 5080 { … … 5082 5087 } 5083 5088 AssertFailedReturn(0xffff); 5089 #endif 5084 5090 } 5085 5091 … … 5094 5100 IEM_STATIC void *iemGRegRef(PVMCPU pVCpu, uint8_t iReg) 5095 5101 { 5096 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx); 5102 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5103 #if 0 5104 Assert(iReg < 16); 5105 return &pCtx->aGRegs[iReg]; 5106 #else 5097 5107 switch (iReg) 5098 5108 { … … 5115 5125 } 5116 5126 AssertFailedReturn(NULL); 5127 #endif 5117 5128 } 5118 5129 … … 5203 5214 IEM_STATIC VBOXSTRICTRC iemRegRipRelativeJumpS8(PVMCPU pVCpu, int8_t offNextInstr) 5204 5215 { 5205 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5216 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5206 5217 switch (pVCpu->iem.s.enmEffOpSize) 5207 5218 { … … 5263 5274 IEM_STATIC VBOXSTRICTRC iemRegRipRelativeJumpS16(PVMCPU pVCpu, int16_t offNextInstr) 5264 5275 { 5265 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5276 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5266 5277 Assert(pVCpu->iem.s.enmEffOpSize == IEMMODE_16BIT); 5267 5278 … … 5293 5304 IEM_STATIC VBOXSTRICTRC iemRegRipRelativeJumpS32(PVMCPU pVCpu, int32_t offNextInstr) 5294 5305 { 5295 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5306 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5296 5307 Assert(pVCpu->iem.s.enmEffOpSize != IEMMODE_16BIT); 5297 5308 … … 5334 5345 IEM_STATIC VBOXSTRICTRC iemRegRipJump(PVMCPU pVCpu, uint64_t uNewRip) 5335 5346 { 5336 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5347 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5337 5348 switch (pVCpu->iem.s.enmEffOpSize) 5338 5349 { … … 5409 5420 IEM_STATIC void iemRegAddToRipKeepRF(PVMCPU pVCpu, uint8_t cbInstr) 5410 5421 { 5411 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5422 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5412 5423 switch (pVCpu->iem.s.enmCpuMode) 5413 5424 { … … 5453 5464 IEM_STATIC void iemRegAddToRipAndClearRF(PVMCPU pVCpu, uint8_t cbInstr) 5454 5465 { 5455 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5466 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5456 5467 5457 5468 pCtx->eflags.Bits.u1RF = 0; … … 6025 6036 IEM_STATIC void iemFpuPushResult(PVMCPU pVCpu, PIEMFPURESULT pResult) 6026 6037 { 6027 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6038 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6028 6039 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6029 6040 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6043 6054 IEM_STATIC void iemFpuPushResultWithMemOp(PVMCPU pVCpu, PIEMFPURESULT pResult, uint8_t iEffSeg, RTGCPTR GCPtrEff) 6044 6055 { 6045 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6056 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6046 6057 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6047 6058 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6060 6071 IEM_STATIC void iemFpuPushResultTwo(PVMCPU pVCpu, PIEMFPURESULTTWO pResult) 6061 6072 { 6062 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6073 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6063 6074 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6064 6075 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6115 6126 IEM_STATIC void iemFpuStoreResult(PVMCPU pVCpu, PIEMFPURESULT pResult, uint8_t iStReg) 6116 6127 { 6117 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6128 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6118 6129 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6119 6130 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6132 6143 IEM_STATIC void iemFpuStoreResultThenPop(PVMCPU pVCpu, PIEMFPURESULT pResult, uint8_t iStReg) 6133 6144 { 6134 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6145 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6135 6146 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6136 6147 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6153 6164 uint8_t iEffSeg, RTGCPTR GCPtrEff) 6154 6165 { 6155 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6166 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6156 6167 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6157 6168 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6174 6185 uint8_t iStReg, uint8_t iEffSeg, RTGCPTR GCPtrEff) 6175 6186 { 6176 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6187 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6177 6188 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6178 6189 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6190 6201 IEM_STATIC void iemFpuUpdateOpcodeAndIp(PVMCPU pVCpu) 6191 6202 { 6192 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6203 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6193 6204 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6194 6205 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6205 6216 { 6206 6217 Assert(iStReg < 8); 6207 PX86FXSTATE pFpuCtx = & pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87;6218 PX86FXSTATE pFpuCtx = &IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87; 6208 6219 uint8_t iReg = (X86_FSW_TOP_GET(pFpuCtx->FSW) + iStReg) & X86_FSW_TOP_SMASK; 6209 6220 pFpuCtx->FTW &= ~RT_BIT(iReg); … … 6218 6229 IEM_STATIC void iemFpuStackIncTop(PVMCPU pVCpu) 6219 6230 { 6220 PX86FXSTATE pFpuCtx = & pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87;6231 PX86FXSTATE pFpuCtx = &IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87; 6221 6232 uint16_t uFsw = pFpuCtx->FSW; 6222 6233 uint16_t uTop = uFsw & X86_FSW_TOP_MASK; … … 6235 6246 IEM_STATIC void iemFpuStackDecTop(PVMCPU pVCpu) 6236 6247 { 6237 PX86FXSTATE pFpuCtx = & pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87;6248 PX86FXSTATE pFpuCtx = &IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87; 6238 6249 uint16_t uFsw = pFpuCtx->FSW; 6239 6250 uint16_t uTop = uFsw & X86_FSW_TOP_MASK; … … 6253 6264 IEM_STATIC void iemFpuUpdateFSW(PVMCPU pVCpu, uint16_t u16FSW) 6254 6265 { 6255 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6266 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6256 6267 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6257 6268 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6268 6279 IEM_STATIC void iemFpuUpdateFSWThenPop(PVMCPU pVCpu, uint16_t u16FSW) 6269 6280 { 6270 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6281 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6271 6282 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6272 6283 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6286 6297 IEM_STATIC void iemFpuUpdateFSWWithMemOp(PVMCPU pVCpu, uint16_t u16FSW, uint8_t iEffSeg, RTGCPTR GCPtrEff) 6287 6298 { 6288 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6299 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6289 6300 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6290 6301 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6302 6313 IEM_STATIC void iemFpuUpdateFSWThenPopPop(PVMCPU pVCpu, uint16_t u16FSW) 6303 6314 { 6304 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6315 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6305 6316 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6306 6317 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6321 6332 IEM_STATIC void iemFpuUpdateFSWWithMemOpThenPop(PVMCPU pVCpu, uint16_t u16FSW, uint8_t iEffSeg, RTGCPTR GCPtrEff) 6322 6333 { 6323 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6334 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6324 6335 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6325 6336 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6370 6381 DECL_NO_INLINE(IEM_STATIC, void) iemFpuStackUnderflow(PVMCPU pVCpu, uint8_t iStReg) 6371 6382 { 6372 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6383 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6373 6384 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6374 6385 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6380 6391 iemFpuStackUnderflowWithMemOp(PVMCPU pVCpu, uint8_t iStReg, uint8_t iEffSeg, RTGCPTR GCPtrEff) 6381 6392 { 6382 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6393 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6383 6394 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6384 6395 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6390 6401 DECL_NO_INLINE(IEM_STATIC, void) iemFpuStackUnderflowThenPop(PVMCPU pVCpu, uint8_t iStReg) 6391 6402 { 6392 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6403 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6393 6404 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6394 6405 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6401 6412 iemFpuStackUnderflowWithMemOpThenPop(PVMCPU pVCpu, uint8_t iStReg, uint8_t iEffSeg, RTGCPTR GCPtrEff) 6402 6413 { 6403 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6414 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6404 6415 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6405 6416 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6412 6423 DECL_NO_INLINE(IEM_STATIC, void) iemFpuStackUnderflowThenPopPop(PVMCPU pVCpu) 6413 6424 { 6414 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6425 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6415 6426 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6416 6427 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6424 6435 iemFpuStackPushUnderflow(PVMCPU pVCpu) 6425 6436 { 6426 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6437 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6427 6438 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6428 6439 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6451 6462 iemFpuStackPushUnderflowTwo(PVMCPU pVCpu) 6452 6463 { 6453 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6464 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6454 6465 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6455 6466 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6510 6521 DECL_NO_INLINE(IEM_STATIC, void) iemFpuStackPushOverflow(PVMCPU pVCpu) 6511 6522 { 6512 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6523 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6513 6524 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6514 6525 iemFpuUpdateOpcodeAndIpWorker(pVCpu, pCtx, pFpuCtx); … … 6527 6538 iemFpuStackPushOverflowWithMemOp(PVMCPU pVCpu, uint8_t iEffSeg, RTGCPTR GCPtrEff) 6528 6539 { 6529 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6540 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6530 6541 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; 6531 6542 iemFpuUpdateDP(pVCpu, pCtx, pFpuCtx, iEffSeg, GCPtrEff); … … 6537 6548 IEM_STATIC int iemFpuStRegNotEmpty(PVMCPU pVCpu, uint8_t iStReg) 6538 6549 { 6539 PX86FXSTATE pFpuCtx = & pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87;6550 PX86FXSTATE pFpuCtx = &IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87; 6540 6551 uint16_t iReg = (X86_FSW_TOP_GET(pFpuCtx->FSW) + iStReg) & X86_FSW_TOP_SMASK; 6541 6552 if (pFpuCtx->FTW & RT_BIT(iReg)) … … 6547 6558 IEM_STATIC int iemFpuStRegNotEmptyRef(PVMCPU pVCpu, uint8_t iStReg, PCRTFLOAT80U *ppRef) 6548 6559 { 6549 PX86FXSTATE pFpuCtx = & pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87;6560 PX86FXSTATE pFpuCtx = &IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87; 6550 6561 uint16_t iReg = (X86_FSW_TOP_GET(pFpuCtx->FSW) + iStReg) & X86_FSW_TOP_SMASK; 6551 6562 if (pFpuCtx->FTW & RT_BIT(iReg)) … … 6561 6572 uint8_t iStReg1, PCRTFLOAT80U *ppRef1) 6562 6573 { 6563 PX86FXSTATE pFpuCtx = & pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87;6574 PX86FXSTATE pFpuCtx = &IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87; 6564 6575 uint16_t iTop = X86_FSW_TOP_GET(pFpuCtx->FSW); 6565 6576 uint16_t iReg0 = (iTop + iStReg0) & X86_FSW_TOP_SMASK; … … 6577 6588 IEM_STATIC int iemFpu2StRegsNotEmptyRefFirst(PVMCPU pVCpu, uint8_t iStReg0, PCRTFLOAT80U *ppRef0, uint8_t iStReg1) 6578 6589 { 6579 PX86FXSTATE pFpuCtx = & pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87;6590 PX86FXSTATE pFpuCtx = &IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87; 6580 6591 uint16_t iTop = X86_FSW_TOP_GET(pFpuCtx->FSW); 6581 6592 uint16_t iReg0 = (iTop + iStReg0) & X86_FSW_TOP_SMASK; … … 6902 6913 && !(fFlags & X86_PTE_RW) 6903 6914 && ( pVCpu->iem.s.uCpl != 0 6904 || ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_WP)))6915 || (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_WP))) 6905 6916 { 6906 6917 Log(("iemMemPageTranslateAndCheckAccess: GCPtrMem=%RGv - read-only page -> #PF\n", GCPtrMem)); … … 6922 6933 if ( (fAccess & IEM_ACCESS_TYPE_EXEC) 6923 6934 && (fFlags & X86_PTE_PAE_NX) 6924 && ( pVCpu->iem.s.CTX_SUFF(pCtx)->msrEFER & MSR_K6_EFER_NXE) )6935 && (IEM_GET_CTX(pVCpu)->msrEFER & MSR_K6_EFER_NXE) ) 6925 6936 { 6926 6937 Log(("iemMemPageTranslateAndCheckAccess: GCPtrMem=%RGv - NX -> #PF\n", GCPtrMem)); … … 8377 8388 /** @todo testcase: Ordering of \#SS(0) vs \#GP() vs \#PF on SSE stuff. */ 8378 8389 if ( (GCPtrMem & 15) 8379 && !( pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */8390 && !(IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */ 8380 8391 return iemRaiseGeneralProtectionFault0(pVCpu); 8381 8392 … … 8409 8420 /** @todo testcase: Ordering of \#SS(0) vs \#GP() vs \#PF on SSE stuff. */ 8410 8421 if ( (GCPtrMem & 15) == 0 8411 || ( pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */8422 || (IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */ 8412 8423 { 8413 8424 uint128_t const *pu128Src = (uint128_t const *)iemMemMapJmp(pVCpu, sizeof(*pu128Src), iSegReg, GCPtrMem, … … 8732 8743 /* The lazy approach for now... */ 8733 8744 if ( (GCPtrMem & 15) 8734 && !( pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */8745 && !(IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */ 8735 8746 return iemRaiseGeneralProtectionFault0(pVCpu); 8736 8747 … … 8762 8773 /* The lazy approach for now... */ 8763 8774 if ( (GCPtrMem & 15) == 0 8764 || ( pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */8775 || (IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.MXCSR & X86_MXSCR_MM)) /** @todo should probably check this *after* applying seg.u64Base... Check real HW. */ 8765 8776 { 8766 8777 uint128_t *pu128Dst = (uint128_t *)iemMemMapJmp(pVCpu, sizeof(*pu128Dst), iSegReg, GCPtrMem, IEM_ACCESS_DATA_W); … … 8821 8832 /* Increment the stack pointer. */ 8822 8833 uint64_t uNewRsp; 8823 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);8834 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 8824 8835 RTGCPTR GCPtrTop = iemRegGetRspForPush(pVCpu, pCtx, 2, &uNewRsp); 8825 8836 … … 8852 8863 /* Increment the stack pointer. */ 8853 8864 uint64_t uNewRsp; 8854 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);8865 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 8855 8866 RTGCPTR GCPtrTop = iemRegGetRspForPush(pVCpu, pCtx, 4, &uNewRsp); 8856 8867 … … 8883 8894 /* Increment the stack pointer. */ 8884 8895 uint64_t uNewRsp; 8885 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);8896 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 8886 8897 RTGCPTR GCPtrTop = iemRegGetRspForPush(pVCpu, pCtx, 4, &uNewRsp); 8887 8898 … … 8938 8949 /* Increment the stack pointer. */ 8939 8950 uint64_t uNewRsp; 8940 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);8951 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 8941 8952 RTGCPTR GCPtrTop = iemRegGetRspForPush(pVCpu, pCtx, 8, &uNewRsp); 8942 8953 … … 8969 8980 /* Increment the stack pointer. */ 8970 8981 uint64_t uNewRsp; 8971 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);8982 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 8972 8983 RTGCPTR GCPtrTop = iemRegGetRspForPop(pVCpu, pCtx, 2, &uNewRsp); 8973 8984 … … 9000 9011 /* Increment the stack pointer. */ 9001 9012 uint64_t uNewRsp; 9002 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9013 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9003 9014 RTGCPTR GCPtrTop = iemRegGetRspForPop(pVCpu, pCtx, 4, &uNewRsp); 9004 9015 … … 9031 9042 /* Increment the stack pointer. */ 9032 9043 uint64_t uNewRsp; 9033 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9044 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9034 9045 RTGCPTR GCPtrTop = iemRegGetRspForPop(pVCpu, pCtx, 8, &uNewRsp); 9035 9046 … … 9062 9073 { 9063 9074 /* Increment the stack pointer. */ 9064 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9075 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9065 9076 RTUINT64U NewRsp = *pTmpRsp; 9066 9077 RTGCPTR GCPtrTop = iemRegGetRspForPushEx(pVCpu, pCtx, &NewRsp, 2); … … 9094 9105 { 9095 9106 /* Increment the stack pointer. */ 9096 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9107 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9097 9108 RTUINT64U NewRsp = *pTmpRsp; 9098 9109 RTGCPTR GCPtrTop = iemRegGetRspForPushEx(pVCpu, pCtx, &NewRsp, 4); … … 9126 9137 { 9127 9138 /* Increment the stack pointer. */ 9128 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9139 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9129 9140 RTUINT64U NewRsp = *pTmpRsp; 9130 9141 RTGCPTR GCPtrTop = iemRegGetRspForPushEx(pVCpu, pCtx, &NewRsp, 8); … … 9158 9169 { 9159 9170 /* Increment the stack pointer. */ 9160 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9171 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9161 9172 RTUINT64U NewRsp = *pTmpRsp; 9162 9173 RTGCPTR GCPtrTop = iemRegGetRspForPopEx(pVCpu, pCtx, &NewRsp, 2); … … 9190 9201 { 9191 9202 /* Increment the stack pointer. */ 9192 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9203 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9193 9204 RTUINT64U NewRsp = *pTmpRsp; 9194 9205 RTGCPTR GCPtrTop = iemRegGetRspForPopEx(pVCpu, pCtx, &NewRsp, 4); … … 9222 9233 { 9223 9234 /* Increment the stack pointer. */ 9224 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9235 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9225 9236 RTUINT64U NewRsp = *pTmpRsp; 9226 9237 RTGCPTR GCPtrTop = iemRegGetRspForPopEx(pVCpu, pCtx, &NewRsp, 8); … … 9263 9274 { 9264 9275 Assert(cbMem < UINT8_MAX); 9265 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9276 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9266 9277 RTGCPTR GCPtrTop = iemRegGetRspForPush(pVCpu, pCtx, (uint8_t)cbMem, puNewRsp); 9267 9278 return iemMemMap(pVCpu, ppvMem, cbMem, X86_SREG_SS, GCPtrTop, IEM_ACCESS_STACK_W); … … 9285 9296 VBOXSTRICTRC rcStrict = iemMemCommitAndUnmap(pVCpu, pvMem, IEM_ACCESS_STACK_W); 9286 9297 if (rcStrict == VINF_SUCCESS) 9287 pVCpu->iem.s.CTX_SUFF(pCtx)->rsp = uNewRsp;9298 IEM_GET_CTX(pVCpu)->rsp = uNewRsp; 9288 9299 return rcStrict; 9289 9300 } … … 9307 9318 { 9308 9319 Assert(cbMem < UINT8_MAX); 9309 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9320 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9310 9321 RTGCPTR GCPtrTop = iemRegGetRspForPop(pVCpu, pCtx, (uint8_t)cbMem, puNewRsp); 9311 9322 return iemMemMap(pVCpu, (void **)ppvMem, cbMem, X86_SREG_SS, GCPtrTop, IEM_ACCESS_STACK_R); … … 9330 9341 { 9331 9342 Assert(cbMem < UINT8_MAX); 9332 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9343 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9333 9344 RTUINT64U NewRsp; 9334 9345 NewRsp.u = *puNewRsp; … … 9355 9366 VBOXSTRICTRC rcStrict = iemMemCommitAndUnmap(pVCpu, (void *)pvMem, IEM_ACCESS_STACK_R); 9356 9367 if (rcStrict == VINF_SUCCESS) 9357 pVCpu->iem.s.CTX_SUFF(pCtx)->rsp = uNewRsp;9368 IEM_GET_CTX(pVCpu)->rsp = uNewRsp; 9358 9369 return rcStrict; 9359 9370 } … … 9488 9499 { 9489 9500 AssertPtr(pDesc); 9490 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9501 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9491 9502 9492 9503 /** @todo did the 286 require all 8 bytes to be accessible? */ … … 9588 9599 IEM_STATIC VBOXSTRICTRC iemMemMarkSelDescAccessed(PVMCPU pVCpu, uint16_t uSel) 9589 9600 { 9590 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);9601 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 9591 9602 9592 9603 /* … … 9684 9695 #define IEM_MC_MAYBE_RAISE_SSE2_RELATED_XCPT() \ 9685 9696 do { \ 9686 if ( ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_EM) \9687 || !( pVCpu->iem.s.CTX_SUFF(pCtx)->cr4 & X86_CR4_OSFXSR) \9697 if ( (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_EM) \ 9698 || !(IEM_GET_CTX(pVCpu)->cr4 & X86_CR4_OSFXSR) \ 9688 9699 || !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fSse2) \ 9689 9700 return iemRaiseUndefinedOpcode(pVCpu); \ 9690 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_TS) \9701 if (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_TS) \ 9691 9702 return iemRaiseDeviceNotAvailable(pVCpu); \ 9692 9703 } while (0) 9693 9704 #define IEM_MC_MAYBE_RAISE_SSE_RELATED_XCPT() \ 9694 9705 do { \ 9695 if ( ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_EM) \9696 || !( pVCpu->iem.s.CTX_SUFF(pCtx)->cr4 & X86_CR4_OSFXSR) \9706 if ( (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_EM) \ 9707 || !(IEM_GET_CTX(pVCpu)->cr4 & X86_CR4_OSFXSR) \ 9697 9708 || !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fSse) \ 9698 9709 return iemRaiseUndefinedOpcode(pVCpu); \ 9699 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_TS) \9710 if (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_TS) \ 9700 9711 return iemRaiseDeviceNotAvailable(pVCpu); \ 9701 9712 } while (0) … … 9705 9716 || !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fMmx) \ 9706 9717 return iemRaiseUndefinedOpcode(pVCpu); \ 9707 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_TS) \9718 if (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_TS) \ 9708 9719 return iemRaiseDeviceNotAvailable(pVCpu); \ 9709 9720 } while (0) … … 9714 9725 && !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fAmdMmxExts) ) \ 9715 9726 return iemRaiseUndefinedOpcode(pVCpu); \ 9716 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_TS) \9727 if (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_TS) \ 9717 9728 return iemRaiseDeviceNotAvailable(pVCpu); \ 9718 9729 } while (0) … … 9771 9782 #define IEM_MC_FETCH_EFLAGS(a_EFlags) (a_EFlags) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u 9772 9783 #define IEM_MC_FETCH_EFLAGS_U8(a_EFlags) (a_EFlags) = (uint8_t)(pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u 9773 #define IEM_MC_FETCH_FSW(a_u16Fsw) (a_u16Fsw) = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.FSW9774 #define IEM_MC_FETCH_FCW(a_u16Fcw) (a_u16Fcw) = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.FCW9784 #define IEM_MC_FETCH_FSW(a_u16Fsw) (a_u16Fsw) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FSW 9785 #define IEM_MC_FETCH_FCW(a_u16Fcw) (a_u16Fcw) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FCW 9775 9786 9776 9787 #define IEM_MC_STORE_GREG_U8(a_iGReg, a_u8Value) *iemGRegRefU8(pVCpu, (a_iGReg)) = (a_u8Value) … … 9785 9796 #define IEM_MC_CLEAR_HIGH_GREG_U64_BY_REF(a_pu32Dst) do { (a_pu32Dst)[1] = 0; } while (0) 9786 9797 #define IEM_MC_STORE_FPUREG_R80_SRC_REF(a_iSt, a_pr80Src) \ 9787 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[a_iSt].r80 = *(a_pr80Src); } while (0)9798 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[a_iSt].r80 = *(a_pr80Src); } while (0) 9788 9799 9789 9800 #define IEM_MC_REF_GREG_U8(a_pu8Dst, a_iGReg) (a_pu8Dst) = iemGRegRefU8(pVCpu, (a_iGReg)) … … 9882 9893 9883 9894 #define IEM_MC_FETCH_MREG_U64(a_u64Value, a_iMReg) \ 9884 do { (a_u64Value) = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx; } while (0)9895 do { (a_u64Value) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx; } while (0) 9885 9896 #define IEM_MC_FETCH_MREG_U32(a_u32Value, a_iMReg) \ 9886 do { (a_u32Value) = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].au32[0]; } while (0)9897 do { (a_u32Value) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].au32[0]; } while (0) 9887 9898 #define IEM_MC_STORE_MREG_U64(a_iMReg, a_u64Value) \ 9888 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx = (a_u64Value); } while (0)9899 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx = (a_u64Value); } while (0) 9889 9900 #define IEM_MC_STORE_MREG_U32_ZX_U64(a_iMReg, a_u32Value) \ 9890 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx = (uint32_t)(a_u32Value); } while (0)9901 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx = (uint32_t)(a_u32Value); } while (0) 9891 9902 #define IEM_MC_REF_MREG_U64(a_pu64Dst, a_iMReg) \ 9892 (a_pu64Dst) = (& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx)9903 (a_pu64Dst) = (&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx) 9893 9904 #define IEM_MC_REF_MREG_U64_CONST(a_pu64Dst, a_iMReg) \ 9894 (a_pu64Dst) = ((uint64_t const *)& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx)9905 (a_pu64Dst) = ((uint64_t const *)&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx) 9895 9906 #define IEM_MC_REF_MREG_U32_CONST(a_pu32Dst, a_iMReg) \ 9896 (a_pu32Dst) = ((uint32_t const *)& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx)9907 (a_pu32Dst) = ((uint32_t const *)&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aRegs[(a_iMReg)].mmx) 9897 9908 9898 9909 #define IEM_MC_FETCH_XREG_U128(a_u128Value, a_iXReg) \ 9899 do { (a_u128Value) = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm; } while (0)9910 do { (a_u128Value) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm; } while (0) 9900 9911 #define IEM_MC_FETCH_XREG_U64(a_u64Value, a_iXReg) \ 9901 do { (a_u64Value) = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0]; } while (0)9912 do { (a_u64Value) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0]; } while (0) 9902 9913 #define IEM_MC_FETCH_XREG_U32(a_u32Value, a_iXReg) \ 9903 do { (a_u32Value) = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au32[0]; } while (0)9914 do { (a_u32Value) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au32[0]; } while (0) 9904 9915 #define IEM_MC_STORE_XREG_U128(a_iXReg, a_u128Value) \ 9905 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm = (a_u128Value); } while (0)9916 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm = (a_u128Value); } while (0) 9906 9917 #define IEM_MC_STORE_XREG_U64(a_iXReg, a_u64Value) \ 9907 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0] = (a_u64Value); } while (0)9918 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0] = (a_u64Value); } while (0) 9908 9919 #define IEM_MC_STORE_XREG_U64_ZX_U128(a_iXReg, a_u64Value) \ 9909 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0] = (a_u64Value); \9910 pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[1] = 0; \9920 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0] = (a_u64Value); \ 9921 IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[1] = 0; \ 9911 9922 } while (0) 9912 9923 #define IEM_MC_STORE_XREG_U32_ZX_U128(a_iXReg, a_u32Value) \ 9913 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0] = (uint32_t)(a_u32Value); \9914 pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[1] = 0; \9924 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0] = (uint32_t)(a_u32Value); \ 9925 IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[1] = 0; \ 9915 9926 } while (0) 9916 9927 #define IEM_MC_REF_XREG_U128(a_pu128Dst, a_iXReg) \ 9917 (a_pu128Dst) = (& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm)9928 (a_pu128Dst) = (&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm) 9918 9929 #define IEM_MC_REF_XREG_U128_CONST(a_pu128Dst, a_iXReg) \ 9919 (a_pu128Dst) = ((uint128_t const *)& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm)9930 (a_pu128Dst) = ((uint128_t const *)&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm) 9920 9931 #define IEM_MC_REF_XREG_U64_CONST(a_pu64Dst, a_iXReg) \ 9921 (a_pu64Dst) = ((uint64_t const *)& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0])9932 (a_pu64Dst) = ((uint64_t const *)&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[0]) 9922 9933 #define IEM_MC_COPY_XREG_U128(a_iXRegDst, a_iXRegSrc) \ 9923 do { pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXRegDst)].xmm \9924 = pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.aXMM[(a_iXRegSrc)].xmm; } while (0)9934 do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXRegDst)].xmm \ 9935 = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXRegSrc)].xmm; } while (0) 9925 9936 9926 9937 #ifndef IEM_WITH_SETJMP … … 10245 10256 if ( !(a_u16FSW & X86_FSW_ES) \ 10246 10257 || !( (a_u16FSW & (X86_FSW_UE | X86_FSW_OE | X86_FSW_IE)) \ 10247 & ~( pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.FCW & X86_FCW_MASK_ALL) ) ) \10258 & ~(IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FCW & X86_FCW_MASK_ALL) ) ) \ 10248 10259 IEM_MC_RETURN_ON_FAILURE(iemMemCommitAndUnmap(pVCpu, (a_pvMem), (a_fAccess))); \ 10249 10260 } while (0) … … 10385 10396 #define IEM_MC_CALL_FPU_AIMPL_1(a_pfnAImpl, a0) \ 10386 10397 do { \ 10387 a_pfnAImpl(& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87, (a0)); \10398 a_pfnAImpl(&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87, (a0)); \ 10388 10399 } while (0) 10389 10400 … … 10397 10408 #define IEM_MC_CALL_FPU_AIMPL_2(a_pfnAImpl, a0, a1) \ 10398 10409 do { \ 10399 a_pfnAImpl(& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87, (a0), (a1)); \10410 a_pfnAImpl(&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87, (a0), (a1)); \ 10400 10411 } while (0) 10401 10412 … … 10410 10421 #define IEM_MC_CALL_FPU_AIMPL_3(a_pfnAImpl, a0, a1, a2) \ 10411 10422 do { \ 10412 a_pfnAImpl(& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87, (a0), (a1), (a2)); \10423 a_pfnAImpl(&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87, (a0), (a1), (a2)); \ 10413 10424 } while (0) 10414 10425 … … 10541 10552 do { \ 10542 10553 IEM_MC_PREPARE_FPU_USAGE(); \ 10543 a_pfnAImpl(& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87, (a0), (a1)); \10554 a_pfnAImpl(&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87, (a0), (a1)); \ 10544 10555 } while (0) 10545 10556 … … 10555 10566 do { \ 10556 10567 IEM_MC_PREPARE_FPU_USAGE(); \ 10557 a_pfnAImpl(& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87, (a0), (a1), (a2)); \10568 a_pfnAImpl(&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87, (a0), (a1), (a2)); \ 10558 10569 } while (0) 10559 10570 … … 10569 10580 do { \ 10570 10581 IEM_MC_PREPARE_SSE_USAGE(); \ 10571 a_pfnAImpl(& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87, (a0), (a1)); \10582 a_pfnAImpl(&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87, (a0), (a1)); \ 10572 10583 } while (0) 10573 10584 … … 10583 10594 do { \ 10584 10595 IEM_MC_PREPARE_SSE_USAGE(); \ 10585 a_pfnAImpl(& pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87, (a0), (a1), (a2)); \10596 a_pfnAImpl(&IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87, (a0), (a1), (a2)); \ 10586 10597 } while (0) 10587 10598 10588 10599 /** @note Not for IOPL or IF testing. */ 10589 #define IEM_MC_IF_EFL_BIT_SET(a_fBit) if ( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit)) {10600 #define IEM_MC_IF_EFL_BIT_SET(a_fBit) if (IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit)) { 10590 10601 /** @note Not for IOPL or IF testing. */ 10591 #define IEM_MC_IF_EFL_BIT_NOT_SET(a_fBit) if (!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit))) {10602 #define IEM_MC_IF_EFL_BIT_NOT_SET(a_fBit) if (!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit))) { 10592 10603 /** @note Not for IOPL or IF testing. */ 10593 #define IEM_MC_IF_EFL_ANY_BITS_SET(a_fBits) if ( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBits)) {10604 #define IEM_MC_IF_EFL_ANY_BITS_SET(a_fBits) if (IEM_GET_CTX(pVCpu)->eflags.u & (a_fBits)) { 10594 10605 /** @note Not for IOPL or IF testing. */ 10595 #define IEM_MC_IF_EFL_NO_BITS_SET(a_fBits) if (!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBits))) {10606 #define IEM_MC_IF_EFL_NO_BITS_SET(a_fBits) if (!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBits))) { 10596 10607 /** @note Not for IOPL or IF testing. */ 10597 10608 #define IEM_MC_IF_EFL_BITS_NE(a_fBit1, a_fBit2) \ 10598 if ( !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit1)) \10599 != !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit2)) ) {10609 if ( !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit1)) \ 10610 != !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit2)) ) { 10600 10611 /** @note Not for IOPL or IF testing. */ 10601 10612 #define IEM_MC_IF_EFL_BITS_EQ(a_fBit1, a_fBit2) \ 10602 if ( !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit1)) \10603 == !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit2)) ) {10613 if ( !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit1)) \ 10614 == !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit2)) ) { 10604 10615 /** @note Not for IOPL or IF testing. */ 10605 10616 #define IEM_MC_IF_EFL_BIT_SET_OR_BITS_NE(a_fBit, a_fBit1, a_fBit2) \ 10606 if ( ( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit)) \10607 || !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit1)) \10608 != !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit2)) ) {10617 if ( (IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit)) \ 10618 || !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit1)) \ 10619 != !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit2)) ) { 10609 10620 /** @note Not for IOPL or IF testing. */ 10610 10621 #define IEM_MC_IF_EFL_BIT_NOT_SET_AND_BITS_EQ(a_fBit, a_fBit1, a_fBit2) \ 10611 if ( !( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit)) \10612 && !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit1)) \10613 == !!( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & (a_fBit2)) ) {10614 #define IEM_MC_IF_CX_IS_NZ() if ( pVCpu->iem.s.CTX_SUFF(pCtx)->cx != 0) {10615 #define IEM_MC_IF_ECX_IS_NZ() if ( pVCpu->iem.s.CTX_SUFF(pCtx)->ecx != 0) {10616 #define IEM_MC_IF_RCX_IS_NZ() if ( pVCpu->iem.s.CTX_SUFF(pCtx)->rcx != 0) {10622 if ( !(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit)) \ 10623 && !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit1)) \ 10624 == !!(IEM_GET_CTX(pVCpu)->eflags.u & (a_fBit2)) ) { 10625 #define IEM_MC_IF_CX_IS_NZ() if (IEM_GET_CTX(pVCpu)->cx != 0) { 10626 #define IEM_MC_IF_ECX_IS_NZ() if (IEM_GET_CTX(pVCpu)->ecx != 0) { 10627 #define IEM_MC_IF_RCX_IS_NZ() if (IEM_GET_CTX(pVCpu)->rcx != 0) { 10617 10628 /** @note Not for IOPL or IF testing. */ 10618 10629 #define IEM_MC_IF_CX_IS_NZ_AND_EFL_BIT_SET(a_fBit) \ 10619 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->cx != 0 \10620 && ( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & a_fBit)) {10630 if ( IEM_GET_CTX(pVCpu)->cx != 0 \ 10631 && (IEM_GET_CTX(pVCpu)->eflags.u & a_fBit)) { 10621 10632 /** @note Not for IOPL or IF testing. */ 10622 10633 #define IEM_MC_IF_ECX_IS_NZ_AND_EFL_BIT_SET(a_fBit) \ 10623 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->ecx != 0 \10624 && ( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & a_fBit)) {10634 if ( IEM_GET_CTX(pVCpu)->ecx != 0 \ 10635 && (IEM_GET_CTX(pVCpu)->eflags.u & a_fBit)) { 10625 10636 /** @note Not for IOPL or IF testing. */ 10626 10637 #define IEM_MC_IF_RCX_IS_NZ_AND_EFL_BIT_SET(a_fBit) \ 10627 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->rcx != 0 \10628 && ( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & a_fBit)) {10638 if ( IEM_GET_CTX(pVCpu)->rcx != 0 \ 10639 && (IEM_GET_CTX(pVCpu)->eflags.u & a_fBit)) { 10629 10640 /** @note Not for IOPL or IF testing. */ 10630 10641 #define IEM_MC_IF_CX_IS_NZ_AND_EFL_BIT_NOT_SET(a_fBit) \ 10631 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->cx != 0 \10632 && !( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & a_fBit)) {10642 if ( IEM_GET_CTX(pVCpu)->cx != 0 \ 10643 && !(IEM_GET_CTX(pVCpu)->eflags.u & a_fBit)) { 10633 10644 /** @note Not for IOPL or IF testing. */ 10634 10645 #define IEM_MC_IF_ECX_IS_NZ_AND_EFL_BIT_NOT_SET(a_fBit) \ 10635 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->ecx != 0 \10636 && !( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & a_fBit)) {10646 if ( IEM_GET_CTX(pVCpu)->ecx != 0 \ 10647 && !(IEM_GET_CTX(pVCpu)->eflags.u & a_fBit)) { 10637 10648 /** @note Not for IOPL or IF testing. */ 10638 10649 #define IEM_MC_IF_RCX_IS_NZ_AND_EFL_BIT_NOT_SET(a_fBit) \ 10639 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->rcx != 0 \10640 && !( pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.u & a_fBit)) {10650 if ( IEM_GET_CTX(pVCpu)->rcx != 0 \ 10651 && !(IEM_GET_CTX(pVCpu)->eflags.u & a_fBit)) { 10641 10652 #define IEM_MC_IF_LOCAL_IS_Z(a_Local) if ((a_Local) == 0) { 10642 10653 #define IEM_MC_IF_GREG_BIT_SET(a_iGReg, a_iBitNo) if (*(uint64_t *)iemGRegRef(pVCpu, (a_iGReg)) & RT_BIT_64(a_iBitNo)) { … … 10653 10664 if (iemFpu2StRegsNotEmptyRefFirst(pVCpu, (a_iSt0), &(a_pr80Dst0), (a_iSt1)) == VINF_SUCCESS) { 10654 10665 #define IEM_MC_IF_FCW_IM() \ 10655 if ( pVCpu->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.FCW & X86_FCW_IM) {10666 if (IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FCW & X86_FCW_IM) { 10656 10667 10657 10668 #define IEM_MC_ELSE() } else { … … 10666 10677 #ifdef DEBUG 10667 10678 # define IEMOP_MNEMONIC(a_szMnemonic) \ 10668 Log4(("decode - %04x:%RGv %s%s [#%u]\n", pVCpu->iem.s.CTX_SUFF(pCtx)->cs.Sel, pVCpu->iem.s.CTX_SUFF(pCtx)->rip, \10679 Log4(("decode - %04x:%RGv %s%s [#%u]\n", IEM_GET_CTX(pVCpu)->cs.Sel, IEM_GET_CTX(pVCpu)->rip, \ 10669 10680 pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK ? "lock " : "", a_szMnemonic, pVCpu->iem.s.cInstructions)) 10670 10681 # define IEMOP_MNEMONIC2(a_szMnemonic, a_szOps) \ 10671 Log4(("decode - %04x:%RGv %s%s %s [#%u]\n", pVCpu->iem.s.CTX_SUFF(pCtx)->cs.Sel, pVCpu->iem.s.CTX_SUFF(pCtx)->rip, \10682 Log4(("decode - %04x:%RGv %s%s %s [#%u]\n", IEM_GET_CTX(pVCpu)->cs.Sel, IEM_GET_CTX(pVCpu)->rip, \ 10672 10683 pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK ? "lock " : "", a_szMnemonic, a_szOps, pVCpu->iem.s.cInstructions)) 10673 10684 #else … … 10811 10822 { \ 10812 10823 Log5((a_szPrf ": Overriding REX prefix at %RX16! fPrefixes=%#x\n", \ 10813 pVCpu->iem.s.CTX_SUFF(pCtx)->rip, pVCpu->iem.s.fPrefixes)); \10824 IEM_GET_CTX(pVCpu)->rip, pVCpu->iem.s.fPrefixes)); \ 10814 10825 pVCpu->iem.s.fPrefixes &= ~IEM_OP_PRF_REX_MASK; \ 10815 10826 pVCpu->iem.s.uRexB = 0; \ … … 10892 10903 { 10893 10904 Log5(("iemOpHlpCalcRmEffAddr: bRm=%#x\n", bRm)); 10894 PCCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);10905 PCCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 10895 10906 # define SET_SS_DEF() \ 10896 10907 do \ … … 11195 11206 { 11196 11207 Log5(("iemOpHlpCalcRmEffAddrJmp: bRm=%#x\n", bRm)); 11197 PCCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);11208 PCCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 11198 11209 # define SET_SS_DEF() \ 11199 11210 do \ … … 11497 11508 { 11498 11509 PVMCPU pVCpu = pVCpu; 11499 PCPUMCTX pOrgCtx = pVCpu->iem.s.CTX_SUFF(pCtx);11510 PCPUMCTX pOrgCtx = IEM_GET_CTX(pVCpu); 11500 11511 11501 11512 /* … … 11610 11621 11611 11622 s_DebugCtx = *pOrgCtx; 11612 pVCpu->iem.s.CTX_SUFF(pCtx) = &s_DebugCtx;11623 IEM_GET_CTX(pVCpu) = &s_DebugCtx; 11613 11624 } 11614 11625 … … 11866 11877 IEM_STATIC void iemVerifyAssertMsg2(PVMCPU pVCpu) 11867 11878 { 11868 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);11879 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 11869 11880 PVM pVM = pVCpu->CTX_SUFF(pVM); 11870 11881 PVMCPU pVCpu = pVCpu; … … 12057 12068 */ 12058 12069 PCPUMCTX pOrgCtx = CPUMQueryGuestCtxPtr(pVCpu); 12059 PCPUMCTX pDebugCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12070 PCPUMCTX pDebugCtx = IEM_GET_CTX(pVCpu); 12060 12071 Assert(pOrgCtx != pDebugCtx); 12061 pVCpu->iem.s.CTX_SUFF(pCtx) = pOrgCtx;12072 IEM_GET_CTX(pVCpu) = pOrgCtx; 12062 12073 12063 12074 /* … … 12112 12123 if (rcStrictIem == VERR_IEM_INSTR_NOT_IMPLEMENTED) 12113 12124 { 12114 pVCpu->iem.s.CTX_SUFF(pCtx) = pOrgCtx;12125 IEM_GET_CTX(pVCpu) = pOrgCtx; 12115 12126 if (rc == VINF_EM_DBG_STEPPED) 12116 12127 return VINF_SUCCESS; … … 12443 12454 iemVerifyAssertRecord(pVCpu, pOtherRec, "Extra Other record!"); 12444 12455 } 12445 pVCpu->iem.s.CTX_SUFF(pCtx) = pOrgCtx;12456 IEM_GET_CTX(pVCpu) = pOrgCtx; 12446 12457 12447 12458 return rcStrictIem; … … 12653 12664 && rcStrict == VINF_SUCCESS 12654 12665 && VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS) 12655 && EMGetInhibitInterruptsPC(pVCpu) == pVCpu->iem.s.CTX_SUFF(pCtx)->rip )12666 && EMGetInhibitInterruptsPC(pVCpu) == IEM_GET_CTX(pVCpu)->rip ) 12656 12667 { 12657 12668 rcStrict = iemInitDecoderAndPrefetchOpcodes(pVCpu, pVCpu->iem.s.fBypassHandlers); … … 12659 12670 { 12660 12671 #ifdef LOG_ENABLED 12661 iemLogCurInstr(pVCpu, pVCpu->iem.s.CTX_SUFF(pCtx), false);12672 iemLogCurInstr(pVCpu, IEM_GET_CTX(pVCpu), false); 12662 12673 #endif 12663 12674 #ifdef IEM_WITH_SETJMP … … 12691 12702 rcStrict = iemExecStatusCodeFiddling(pVCpu, rcStrict); 12692 12703 12693 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->cs));12694 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->ss));12704 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->cs)); 12705 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->ss)); 12695 12706 #if defined(IEM_VERIFICATION_MODE_FULL) 12696 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->es));12697 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->ds));12698 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->fs));12699 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->gs));12707 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->es)); 12708 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->ds)); 12709 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->fs)); 12710 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->gs)); 12700 12711 #endif 12701 12712 return rcStrict; … … 12745 12756 #endif 12746 12757 #ifdef LOG_ENABLED 12747 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12758 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12748 12759 iemLogCurInstr(pVCpu, pCtx, true); 12749 12760 #endif … … 12765 12776 #endif 12766 12777 #ifdef IN_RC 12767 rcStrict = iemRCRawMaybeReenter(pVCpu, pVCpu->iem.s.CTX_SUFF(pCtx), rcStrict);12778 rcStrict = iemRCRawMaybeReenter(pVCpu, IEM_GET_CTX(pVCpu), rcStrict); 12768 12779 #endif 12769 12780 if (rcStrict != VINF_SUCCESS) … … 12776 12787 VMMDECL(VBOXSTRICTRC) IEMExecOneEx(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, uint32_t *pcbWritten) 12777 12788 { 12778 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12789 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12779 12790 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 12780 12791 … … 12798 12809 const void *pvOpcodeBytes, size_t cbOpcodeBytes) 12799 12810 { 12800 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12811 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12801 12812 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 12802 12813 … … 12826 12837 VMMDECL(VBOXSTRICTRC) IEMExecOneBypassEx(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore, uint32_t *pcbWritten) 12827 12838 { 12828 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12839 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12829 12840 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 12830 12841 … … 12848 12859 const void *pvOpcodeBytes, size_t cbOpcodeBytes) 12849 12860 { 12850 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12861 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12851 12862 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 12852 12863 … … 12889 12900 uint32_t *pcbWritten) 12890 12901 { 12891 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12902 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12892 12903 AssertReturn(CPUMCTX2CORE(pCtx) == pCtxCore, VERR_IEM_IPE_3); 12893 12904 … … 12926 12937 * See if there is an interrupt pending in TRPM, inject it if we can. 12927 12938 */ 12928 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12939 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12929 12940 # ifdef IEM_VERIFICATION_MODE_FULL 12930 12941 pVCpu->iem.s.uInjectCpl = UINT8_MAX; … … 12978 12989 * See if there is an interrupt pending in TRPM, inject it if we can. 12979 12990 */ 12980 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);12991 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 12981 12992 # ifdef IEM_VERIFICATION_MODE_FULL 12982 12993 pVCpu->iem.s.uInjectCpl = UINT8_MAX; … … 13062 13073 * Assert hidden register sanity (also done in iemInitDecoder and iemReInitDecoder). 13063 13074 */ 13064 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->cs));13065 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->ss));13075 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->cs)); 13076 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->ss)); 13066 13077 # if defined(IEM_VERIFICATION_MODE_FULL) 13067 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->es));13068 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->ds));13069 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->fs));13070 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, & pVCpu->iem.s.CTX_SUFF(pCtx)->gs));13078 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->es)); 13079 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->ds)); 13080 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->fs)); 13081 Assert(CPUMSELREG_ARE_HIDDEN_PARTS_VALID(pVCpu, &IEM_GET_CTX(pVCpu)->gs)); 13071 13082 # endif 13072 13083 } … … 13076 13087 */ 13077 13088 # ifdef IN_RC 13078 rcStrict = iemRCRawMaybeReenter(pVCpu, pVCpu->iem.s.CTX_SUFF(pCtx), rcStrict);13089 rcStrict = iemRCRawMaybeReenter(pVCpu, IEM_GET_CTX(pVCpu), rcStrict); 13079 13090 # endif 13080 13091 if (rcStrict != VINF_SUCCESS) … … 13215 13226 VMM_INT_DECL(int) IEMExecInstr_iret(PVMCPU pVCpu, PCPUMCTXCORE pCtxCore) 13216 13227 { 13217 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);13228 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 13218 13229 13219 13230 iemCtxCoreToCtx(pCtx, pCtxCore); … … 13256 13267 iemUninitExec(pVCpu); 13257 13268 #ifdef IN_RC 13258 return iemRCRawMaybeReenter(pVCpu, pVCpu->iem.s.CTX_SUFF(pCtx),13269 return iemRCRawMaybeReenter(pVCpu, IEM_GET_CTX(pVCpu), 13259 13270 iemExecStatusCodeFiddling(pVCpu, rcStrict)); 13260 13271 #else -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r62015 r62076 176 176 static void iemHlpUpdateArithEFlagsU8(PVMCPU pVCpu, uint8_t u8Result, uint32_t fToUpdate, uint32_t fUndefined) 177 177 { 178 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);178 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 179 179 180 180 uint32_t fEFlags = pCtx->eflags.u; … … 232 232 IEM_CIMPL_DEF_0(iemCImpl_popa_16) 233 233 { 234 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);234 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 235 235 RTGCPTR GCPtrStart = iemRegGetEffRsp(pVCpu, pCtx); 236 236 RTGCPTR GCPtrLast = GCPtrStart + 15; … … 304 304 IEM_CIMPL_DEF_0(iemCImpl_popa_32) 305 305 { 306 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);306 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 307 307 RTGCPTR GCPtrStart = iemRegGetEffRsp(pVCpu, pCtx); 308 308 RTGCPTR GCPtrLast = GCPtrStart + 31; … … 385 385 IEM_CIMPL_DEF_0(iemCImpl_pusha_16) 386 386 { 387 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);387 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 388 388 RTGCPTR GCPtrTop = iemRegGetEffRsp(pVCpu, pCtx); 389 389 RTGCPTR GCPtrBottom = GCPtrTop - 15; … … 457 457 IEM_CIMPL_DEF_0(iemCImpl_pusha_32) 458 458 { 459 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);459 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 460 460 RTGCPTR GCPtrTop = iemRegGetEffRsp(pVCpu, pCtx); 461 461 RTGCPTR GCPtrBottom = GCPtrTop - 31; … … 532 532 IEM_CIMPL_DEF_1(iemCImpl_pushf, IEMMODE, enmEffOpSize) 533 533 { 534 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);534 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 535 535 536 536 /* … … 588 588 IEM_CIMPL_DEF_1(iemCImpl_popf, IEMMODE, enmEffOpSize) 589 589 { 590 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);590 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 591 591 uint32_t const fEflOld = IEMMISC_GET_EFL(pVCpu, pCtx); 592 592 VBOXSTRICTRC rcStrict; … … 748 748 IEM_CIMPL_DEF_1(iemCImpl_call_16, uint16_t, uNewPC) 749 749 { 750 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);750 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 751 751 uint16_t uOldPC = pCtx->ip + cbInstr; 752 752 if (uNewPC > pCtx->cs.u32Limit) … … 773 773 IEM_CIMPL_DEF_1(iemCImpl_call_rel_16, int16_t, offDisp) 774 774 { 775 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);775 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 776 776 uint16_t uOldPC = pCtx->ip + cbInstr; 777 777 uint16_t uNewPC = uOldPC + offDisp; … … 801 801 IEM_CIMPL_DEF_1(iemCImpl_call_32, uint32_t, uNewPC) 802 802 { 803 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);803 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 804 804 uint32_t uOldPC = pCtx->eip + cbInstr; 805 805 if (uNewPC > pCtx->cs.u32Limit) … … 843 843 IEM_CIMPL_DEF_1(iemCImpl_call_rel_32, int32_t, offDisp) 844 844 { 845 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);845 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 846 846 uint32_t uOldPC = pCtx->eip + cbInstr; 847 847 uint32_t uNewPC = uOldPC + offDisp; … … 871 871 IEM_CIMPL_DEF_1(iemCImpl_call_64, uint64_t, uNewPC) 872 872 { 873 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);873 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 874 874 uint64_t uOldPC = pCtx->rip + cbInstr; 875 875 if (!IEM_IS_CANONICAL(uNewPC)) … … 896 896 IEM_CIMPL_DEF_1(iemCImpl_call_rel_64, int64_t, offDisp) 897 897 { 898 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);898 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 899 899 uint64_t uOldPC = pCtx->rip + cbInstr; 900 900 uint64_t uNewPC = uOldPC + offDisp; … … 951 951 } 952 952 953 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);953 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 954 954 uint32_t uNextEip = pCtx->eip + cbInstr; 955 return iemTaskSwitch(pVCpu, p VCpu->iem.s.CTX_SUFF(pCtx), enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL,955 return iemTaskSwitch(pVCpu, pCtx, enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL, 956 956 uNextEip, 0 /* fFlags */, 0 /* uErr */, 0 /* uCr2 */, uSel, pDesc); 957 957 #endif … … 1020 1020 } 1021 1021 1022 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1022 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1023 1023 uint32_t uNextEip = pCtx->eip + cbInstr; 1024 return iemTaskSwitch(pVCpu, p VCpu->iem.s.CTX_SUFF(pCtx), enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL,1024 return iemTaskSwitch(pVCpu, pCtx, enmBranch == IEMBRANCH_JUMP ? IEMTASKSWITCH_JUMP : IEMTASKSWITCH_CALL, 1025 1025 uNextEip, 0 /* fFlags */, 0 /* uErr */, 0 /* uCr2 */, uSelTss, &TssDesc); 1026 1026 #endif … … 1061 1061 RTSEL uNewCS; 1062 1062 IEMSELDESC DescCS; 1063 PCPUMCTX pCtx;1064 1063 1065 1064 AssertCompile(X86_SEL_TYPE_SYS_386_CALL_GATE == AMD64_SEL_TYPE_SYS_CALL_GATE); … … 1163 1162 } 1164 1163 1165 pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1164 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1166 1165 1167 1166 if (enmBranch == IEMBRANCH_JUMP) … … 1723 1722 IEM_CIMPL_DEF_3(iemCImpl_FarJmp, uint16_t, uSel, uint64_t, offSeg, IEMMODE, enmEffOpSize) 1724 1723 { 1725 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1724 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1726 1725 NOREF(cbInstr); 1727 1726 Assert(offSeg <= UINT32_MAX); … … 1888 1887 IEM_CIMPL_DEF_3(iemCImpl_callf, uint16_t, uSel, uint64_t, offSeg, IEMMODE, enmEffOpSize) 1889 1888 { 1890 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1889 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1891 1890 VBOXSTRICTRC rcStrict; 1892 1891 uint64_t uNewRsp; … … 2109 2108 IEM_CIMPL_DEF_2(iemCImpl_retf, IEMMODE, enmEffOpSize, uint16_t, cbPop) 2110 2109 { 2111 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);2110 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 2112 2111 VBOXSTRICTRC rcStrict; 2113 2112 RTCPTRUNION uPtrFrame; … … 2515 2514 IEM_CIMPL_DEF_2(iemCImpl_retn, IEMMODE, enmEffOpSize, uint16_t, cbPop) 2516 2515 { 2517 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);2516 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 2518 2517 NOREF(cbInstr); 2519 2518 … … 2587 2586 IEM_CIMPL_DEF_3(iemCImpl_enter, IEMMODE, enmEffOpSize, uint16_t, cbFrame, uint8_t, cParameters) 2588 2587 { 2589 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);2588 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 2590 2589 2591 2590 /* Push RBP, saving the old value in TmpRbp. */ … … 2703 2702 IEM_CIMPL_DEF_1(iemCImpl_leave, IEMMODE, enmEffOpSize) 2704 2703 { 2705 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);2704 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 2706 2705 2707 2706 /* Calculate the intermediate RSP from RBP and the stack attributes. */ … … 2774 2773 IEM_CIMPL_DEF_1(iemCImpl_iret_real_v8086, IEMMODE, enmEffOpSize) 2775 2774 { 2776 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);2775 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 2777 2776 X86EFLAGS Efl; 2778 2777 Efl.u = IEMMISC_GET_EFL(pVCpu, pCtx); … … 2994 2993 */ 2995 2994 RTSEL uSelRet; 2996 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);2995 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 2997 2996 VBOXSTRICTRC rcStrict = iemMemFetchSysU16(pVCpu, &uSelRet, UINT8_MAX, pCtx->tr.u64Base); 2998 2997 if (rcStrict != VINF_SUCCESS) … … 3033 3032 3034 3033 uint32_t uNextEip = pCtx->eip + cbInstr; 3035 return iemTaskSwitch(pVCpu, p VCpu->iem.s.CTX_SUFF(pCtx), IEMTASKSWITCH_IRET, uNextEip, 0 /* fFlags */, 0 /* uErr */,3034 return iemTaskSwitch(pVCpu, pCtx, IEMTASKSWITCH_IRET, uNextEip, 0 /* fFlags */, 0 /* uErr */, 3036 3035 0 /* uCr2 */, uSelRet, &TssDesc); 3037 3036 #endif … … 3046 3045 IEM_CIMPL_DEF_1(iemCImpl_iret_prot, IEMMODE, enmEffOpSize) 3047 3046 { 3048 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);3047 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 3049 3048 NOREF(cbInstr); 3050 3049 Assert(enmEffOpSize == IEMMODE_32BIT || enmEffOpSize == IEMMODE_16BIT); … … 3421 3420 IEM_CIMPL_DEF_1(iemCImpl_iret_64bit, IEMMODE, enmEffOpSize) 3422 3421 { 3423 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);3422 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 3424 3423 NOREF(cbInstr); 3425 3424 … … 3744 3743 IEM_CIMPL_DEF_0(iemCImpl_syscall) 3745 3744 { 3746 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);3745 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 3747 3746 3748 3747 /* … … 3846 3845 3847 3846 { 3848 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);3847 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 3849 3848 3850 3849 /* … … 3952 3951 IEM_CIMPL_DEF_2(iemCImpl_LoadSReg, uint8_t, iSegReg, uint16_t, uSel) 3953 3952 { 3954 /*PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);*/3953 /*PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);*/ 3955 3954 uint16_t *pSel = iemSRegRef(pVCpu, iSegReg); 3956 3955 PCPUMSELREGHID pHid = iemSRegGetHid(pVCpu, iSegReg); … … 4142 4141 if (iSegReg == X86_SREG_SS) 4143 4142 { 4144 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4143 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4145 4144 EMSetInhibitInterruptsPC(pVCpu, pCtx->rip); 4146 4145 } … … 4158 4157 IEM_CIMPL_DEF_2(iemCImpl_pop_Sreg, uint8_t, iSegReg, IEMMODE, enmEffOpSize) 4159 4158 { 4160 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4159 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4161 4160 VBOXSTRICTRC rcStrict; 4162 4161 … … 4220 4219 IEMMODE, enmEffOpSize) 4221 4220 { 4222 /*PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);*/4221 /*PCPUMCTX pCtx = IEM_GET_CTX(pVCpu);*/ 4223 4222 VBOXSTRICTRC rcStrict; 4224 4223 … … 4271 4270 4272 4271 /* Within the table limits? */ 4273 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4272 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4274 4273 RTGCPTR GCPtrBase; 4275 4274 if (uSel & X86_SEL_LDT) … … 4351 4350 4352 4351 /* commit */ 4353 pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1ZF = fAccessible;4352 IEM_GET_CTX(pVCpu)->eflags.Bits.u1ZF = fAccessible; 4354 4353 4355 4354 iemRegAddToRipAndClearRF(pVCpu, cbInstr); … … 4383 4382 if (!Desc.Legacy.Gen.u1DescType) 4384 4383 { 4385 if (CPUMIsGuestInLongModeEx( pVCpu->iem.s.CTX_SUFF(pCtx)))4384 if (CPUMIsGuestInLongModeEx(IEM_GET_CTX(pVCpu))) 4386 4385 { 4387 4386 if (Desc.Long.Gen.u5Zeros) … … 4458 4457 4459 4458 /* commit flags value and advance rip. */ 4460 pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1ZF = fDescOk;4459 IEM_GET_CTX(pVCpu)->eflags.Bits.u1ZF = fDescOk; 4461 4460 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 4462 4461 … … 4494 4493 if (pVCpu->iem.s.uCpl != 0) 4495 4494 return iemRaiseGeneralProtectionFault0(pVCpu); 4496 Assert(! pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);4495 Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM); 4497 4496 4498 4497 /* … … 4511 4510 else 4512 4511 { 4513 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4512 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4514 4513 pCtx->gdtr.cbGdt = cbLimit; 4515 4514 pCtx->gdtr.pGdt = GCPtrBase; … … 4541 4540 * you really must know. 4542 4541 */ 4543 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4542 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4544 4543 VBOXSTRICTRC rcStrict = iemMemStoreDataXdtr(pVCpu, pCtx->gdtr.cbGdt, pCtx->gdtr.pGdt, iEffSeg, GCPtrEffDst); 4545 4544 if (rcStrict == VINF_SUCCESS) … … 4560 4559 if (pVCpu->iem.s.uCpl != 0) 4561 4560 return iemRaiseGeneralProtectionFault0(pVCpu); 4562 Assert(! pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);4561 Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM); 4563 4562 4564 4563 /* … … 4577 4576 else 4578 4577 { 4579 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4578 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4580 4579 pCtx->idtr.cbIdt = cbLimit; 4581 4580 pCtx->idtr.pIdt = GCPtrBase; … … 4606 4605 * you really must know. 4607 4606 */ 4608 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4607 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4609 4608 VBOXSTRICTRC rcStrict = iemMemStoreDataXdtr(pVCpu, pCtx->idtr.cbIdt, pCtx->idtr.pIdt, iEffSeg, GCPtrEffDst); 4610 4609 if (rcStrict == VINF_SUCCESS) … … 4621 4620 IEM_CIMPL_DEF_1(iemCImpl_lldt, uint16_t, uNewLdt) 4622 4621 { 4623 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4622 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4624 4623 4625 4624 /* … … 4747 4746 IEM_CIMPL_DEF_1(iemCImpl_ltr, uint16_t, uNewTr) 4748 4747 { 4749 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4748 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4750 4749 4751 4750 /* … … 4869 4868 IEM_CIMPL_DEF_2(iemCImpl_mov_Rd_Cd, uint8_t, iGReg, uint8_t, iCrReg) 4870 4869 { 4871 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4870 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4872 4871 if (pVCpu->iem.s.uCpl != 0) 4873 4872 return iemRaiseGeneralProtectionFault0(pVCpu); … … 4918 4917 IEM_CIMPL_DEF_2(iemCImpl_load_CrX, uint8_t, iCrReg, uint64_t, uNewCrX) 4919 4918 { 4920 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);4919 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 4921 4920 VBOXSTRICTRC rcStrict; 4922 4921 int rc; … … 5233 5232 if (pVCpu->iem.s.uCpl != 0) 5234 5233 return iemRaiseGeneralProtectionFault0(pVCpu); 5235 Assert(! pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);5234 Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM); 5236 5235 5237 5236 /* … … 5254 5253 IEM_CIMPL_DEF_1(iemCImpl_lmsw, uint16_t, u16NewMsw) 5255 5254 { 5256 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5255 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5257 5256 5258 5257 if (pVCpu->iem.s.uCpl != 0) … … 5277 5276 return iemRaiseGeneralProtectionFault0(pVCpu); 5278 5277 5279 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5278 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5280 5279 uint64_t uNewCr0 = pCtx->cr0; 5281 5280 uNewCr0 &= ~X86_CR0_TS; … … 5292 5291 IEM_CIMPL_DEF_2(iemCImpl_mov_Rd_Dd, uint8_t, iGReg, uint8_t, iDrReg) 5293 5292 { 5294 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5293 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5295 5294 5296 5295 /* … … 5360 5359 IEM_CIMPL_DEF_2(iemCImpl_mov_Dd_Rd, uint8_t, iDrReg, uint8_t, iGReg) 5361 5360 { 5362 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5361 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5363 5362 5364 5363 /* … … 5459 5458 if (pVCpu->iem.s.uCpl != 0) 5460 5459 return iemRaiseGeneralProtectionFault0(pVCpu); 5461 Assert(! pVCpu->iem.s.CTX_SUFF(pCtx)->eflags.Bits.u1VM);5460 Assert(!IEM_GET_CTX(pVCpu)->eflags.Bits.u1VM); 5462 5461 5463 5462 int rc = PGMInvalidatePage(pVCpu, GCPtrPage); … … 5480 5479 IEM_CIMPL_DEF_0(iemCImpl_rdtsc) 5481 5480 { 5482 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5481 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5483 5482 5484 5483 /* … … 5515 5514 IEM_CIMPL_DEF_0(iemCImpl_rdmsr) 5516 5515 { 5517 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5516 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5518 5517 5519 5518 /* … … 5564 5563 IEM_CIMPL_DEF_0(iemCImpl_wrmsr) 5565 5564 { 5566 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5565 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5567 5566 5568 5567 /* … … 5630 5629 IEM_CIMPL_DEF_2(iemCImpl_in, uint16_t, u16Port, uint8_t, cbReg) 5631 5630 { 5632 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5631 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5633 5632 5634 5633 /* … … 5688 5687 IEM_CIMPL_DEF_1(iemCImpl_in_eAX_DX, uint8_t, cbReg) 5689 5688 { 5690 return IEM_CIMPL_CALL_2(iemCImpl_in, pVCpu->iem.s.CTX_SUFF(pCtx)->dx, cbReg);5689 return IEM_CIMPL_CALL_2(iemCImpl_in, IEM_GET_CTX(pVCpu)->dx, cbReg); 5691 5690 } 5692 5691 … … 5700 5699 IEM_CIMPL_DEF_2(iemCImpl_out, uint16_t, u16Port, uint8_t, cbReg) 5701 5700 { 5702 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5701 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5703 5702 5704 5703 /* … … 5757 5756 IEM_CIMPL_DEF_1(iemCImpl_out_DX_eAX, uint8_t, cbReg) 5758 5757 { 5759 return IEM_CIMPL_CALL_2(iemCImpl_out, pVCpu->iem.s.CTX_SUFF(pCtx)->dx, cbReg);5758 return IEM_CIMPL_CALL_2(iemCImpl_out, IEM_GET_CTX(pVCpu)->dx, cbReg); 5760 5759 } 5761 5760 … … 5766 5765 IEM_CIMPL_DEF_0(iemCImpl_cli) 5767 5766 { 5768 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5767 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5769 5768 uint32_t fEfl = IEMMISC_GET_EFL(pVCpu, pCtx); 5770 5769 uint32_t const fEflOld = fEfl; … … 5808 5807 IEM_CIMPL_DEF_0(iemCImpl_sti) 5809 5808 { 5810 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5809 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5811 5810 uint32_t fEfl = IEMMISC_GET_EFL(pVCpu, pCtx); 5812 5811 uint32_t const fEflOld = fEfl; … … 5884 5883 * Gather the operands and validate them. 5885 5884 */ 5886 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5885 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5887 5886 RTGCPTR GCPtrMem = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT ? pCtx->rax : pCtx->eax; 5888 5887 uint32_t uEcx = pCtx->ecx; … … 5940 5939 * Gather the operands and validate them. 5941 5940 */ 5942 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5941 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5943 5942 uint32_t uEax = pCtx->eax; 5944 5943 uint32_t uEcx = pCtx->ecx; … … 5991 5990 * Do the job. 5992 5991 */ 5993 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);5992 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 5994 5993 uint64_t uOtherGsBase = pCtx->msrKERNELGSBASE; 5995 5994 pCtx->msrKERNELGSBASE = pCtx->gs.u64Base; … … 6006 6005 IEM_CIMPL_DEF_0(iemCImpl_cpuid) 6007 6006 { 6008 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6007 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6009 6008 6010 6009 CPUMGetGuestCpuId(pVCpu, pCtx->eax, pCtx->ecx, &pCtx->eax, &pCtx->ebx, &pCtx->ecx, &pCtx->edx); … … 6026 6025 IEM_CIMPL_DEF_1(iemCImpl_aad, uint8_t, bImm) 6027 6026 { 6028 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6027 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6029 6028 6030 6029 uint16_t const ax = pCtx->ax; … … 6047 6046 IEM_CIMPL_DEF_1(iemCImpl_aam, uint8_t, bImm) 6048 6047 { 6049 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6048 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6050 6049 Assert(bImm != 0); /* #DE on 0 is handled in the decoder. */ 6051 6050 … … 6068 6067 IEM_CIMPL_DEF_0(iemCImpl_daa) 6069 6068 { 6070 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6069 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6071 6070 6072 6071 uint8_t const al = pCtx->al; … … 6101 6100 IEM_CIMPL_DEF_0(iemCImpl_das) 6102 6101 { 6103 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6102 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6104 6103 6105 6104 uint8_t const uInputAL = pCtx->al; … … 6180 6179 IEM_CIMPL_DEF_0(iemCImpl_xgetbv) 6181 6180 { 6182 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6181 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6183 6182 if (pCtx->cr4 & X86_CR4_OSXSAVE) 6184 6183 { … … 6211 6210 IEM_CIMPL_DEF_0(iemCImpl_xsetbv) 6212 6211 { 6213 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6212 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6214 6213 if (pCtx->cr4 & X86_CR4_OSXSAVE) 6215 6214 { … … 6258 6257 IEM_CIMPL_DEF_1(iemCImpl_finit, bool, fCheckXcpts) 6259 6258 { 6260 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6259 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6261 6260 6262 6261 if (pCtx->cr0 & (X86_CR0_EM | X86_CR0_TS)) … … 6295 6294 IEM_CIMPL_DEF_3(iemCImpl_fxsave, uint8_t, iEffSeg, RTGCPTR, GCPtrEff, IEMMODE, enmEffOpSize) 6296 6295 { 6297 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6296 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6298 6297 6299 6298 /* … … 6399 6398 IEM_CIMPL_DEF_3(iemCImpl_fxrstor, uint8_t, iEffSeg, RTGCPTR, GCPtrEff, IEMMODE, enmEffOpSize) 6400 6399 { 6401 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6400 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6402 6401 6403 6402 /* … … 6647 6646 IEM_CIMPL_DEF_3(iemCImpl_fnstenv, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst) 6648 6647 { 6649 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6648 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6650 6649 RTPTRUNION uPtr; 6651 6650 VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, &uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 14 : 28, … … 6674 6673 IEM_CIMPL_DEF_3(iemCImpl_fnsave, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst) 6675 6674 { 6676 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6675 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6677 6676 RTPTRUNION uPtr; 6678 6677 VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, &uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 94 : 108, … … 6725 6724 IEM_CIMPL_DEF_3(iemCImpl_fldenv, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffSrc) 6726 6725 { 6727 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6726 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6728 6727 RTCPTRUNION uPtr; 6729 6728 VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, (void **)&uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 14 : 28, … … 6752 6751 IEM_CIMPL_DEF_3(iemCImpl_frstor, IEMMODE, enmEffOpSize, uint8_t, iEffSeg, RTGCPTR, GCPtrEffSrc) 6753 6752 { 6754 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6753 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6755 6754 RTCPTRUNION uPtr; 6756 6755 VBOXSTRICTRC rcStrict = iemMemMap(pVCpu, (void **)&uPtr.pv, enmEffOpSize == IEMMODE_16BIT ? 94 : 108, … … 6787 6786 IEM_CIMPL_DEF_1(iemCImpl_fldcw, uint16_t, u16Fcw) 6788 6787 { 6789 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6788 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6790 6789 6791 6790 /** @todo Testcase: Check what happens when trying to load X86_FCW_PC_RSVD. */ … … 6813 6812 IEM_CIMPL_DEF_1(iemCImpl_fxch_underflow, uint8_t, iStReg) 6814 6813 { 6815 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6814 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6816 6815 6817 6816 PX86FXSTATE pFpuCtx = &pCtx->CTX_SUFF(pXState)->x87; … … 6862 6861 IEM_CIMPL_DEF_3(iemCImpl_fcomi_fucomi, uint8_t, iStReg, PFNIEMAIMPLFPUR80EFL, pfnAImpl, bool, fPop) 6863 6862 { 6864 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);6863 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 6865 6864 Assert(iStReg < 8); 6866 6865 -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplStrInstr.cpp.h
r62015 r62076 156 156 { 157 157 PVM pVM = pVCpu->CTX_SUFF(pVM); 158 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);158 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 159 159 160 160 /* … … 325 325 { 326 326 PVM pVM = pVCpu->CTX_SUFF(pVM); 327 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);327 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 328 328 329 329 /* … … 494 494 { 495 495 PVM pVM = pVCpu->CTX_SUFF(pVM); 496 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);496 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 497 497 498 498 /* … … 626 626 { 627 627 PVM pVM = pVCpu->CTX_SUFF(pVM); 628 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);628 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 629 629 630 630 /* … … 759 759 { 760 760 PVM pVM = pVCpu->CTX_SUFF(pVM); 761 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);761 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 762 762 763 763 /* … … 933 933 { 934 934 PVM pVM = pVCpu->CTX_SUFF(pVM); 935 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);935 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 936 936 937 937 /* … … 1066 1066 { 1067 1067 PVM pVM = pVCpu->CTX_SUFF(pVM); 1068 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1068 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1069 1069 1070 1070 /* … … 1194 1194 { 1195 1195 PVM pVM = pVCpu->CTX_SUFF(pVM); 1196 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1196 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1197 1197 VBOXSTRICTRC rcStrict; 1198 1198 … … 1257 1257 { 1258 1258 PVM pVM = pVCpu->CTX_SUFF(pVM); 1259 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1259 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1260 1260 1261 1261 /* … … 1440 1440 { 1441 1441 PVM pVM = pVCpu->CTX_SUFF(pVM); 1442 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1442 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1443 1443 VBOXSTRICTRC rcStrict; 1444 1444 … … 1484 1484 { 1485 1485 PVM pVM = pVCpu->CTX_SUFF(pVM); 1486 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);1486 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 1487 1487 1488 1488 /* -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r62015 r62076 10780 10780 pVCpu->iem.s.offOpcode = offOpcodeSaved; 10781 10781 10782 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);10782 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 10783 10783 uint64_t const RspSaved = pCtx->rsp; 10784 10784 switch (pVCpu->iem.s.enmEffOpSize) … … 17658 17658 { 17659 17659 /* Registers? How?? */ 17660 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 17660 if (RT_LIKELY((bRm & X86_MODRM_MOD_MASK) != (3 << X86_MODRM_MOD_SHIFT))) 17661 { /* likely */ } 17662 else 17661 17663 return IEMOP_RAISE_INVALID_OPCODE(); /* callf eax is not legal */ 17662 17664 -
trunk/src/VBox/VMM/include/IEMInternal.h
r62017 r62076 635 635 636 636 637 /** @def IEM_GET_CTX 638 * Gets the guest CPU context for the calling EMT. 639 * @returns PCPUMCTX 640 * @param a_pVCpu The cross context virtual CPU structure of the calling thread. 641 */ 642 #if !defined(IEM_VERIFICATION_MODE_FULL) && !defined(IEM_VERIFICATION_MODE) \ 643 && !defined(IEM_VERIFICATION_MODE_MINIMAL) && defined(VMCPU_INCL_CPUM_GST_CTX) 644 # define IEM_GET_CTX(a_pVCpu) (&(a_pVCpu)->cpum.GstCtx) 645 #else 646 # define IEM_GET_CTX(a_pVCpu) ((a_pVCpu)->iem.s.CTX_SUFF(pCtx)) 647 #endif 648 637 649 /** Gets the current IEMTARGETCPU value. 638 650 * @returns IEMTARGETCPU value. 639 * @param a_pVCpu The IEM per CPU instance data.651 * @param a_pVCpu The cross context virtual CPU structure of the calling thread. 640 652 */ 641 653 #if IEM_CFG_TARGET_CPU != IEMTARGETCPU_DYNAMIC
Note:
See TracChangeset
for help on using the changeset viewer.