Changeset 72494 in vbox
- Timestamp:
- Jun 10, 2018 4:16:36 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r72493 r72494 11032 11032 #define IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE() \ 11033 11033 do { \ 11034 if ( (pVCpu)->iem.s.CTX_SUFF(pCtx)->cr0 & (X86_CR0_EM | X86_CR0_TS)) \11034 if (IEM_GET_CTX(pVCpu)->cr0 & (X86_CR0_EM | X86_CR0_TS)) \ 11035 11035 return iemRaiseDeviceNotAvailable(pVCpu); \ 11036 11036 } while (0) 11037 11037 #define IEM_MC_MAYBE_RAISE_WAIT_DEVICE_NOT_AVAILABLE() \ 11038 11038 do { \ 11039 if (( (pVCpu)->iem.s.CTX_SUFF(pCtx)->cr0 & (X86_CR0_MP | X86_CR0_TS)) == (X86_CR0_MP | X86_CR0_TS)) \11039 if ((IEM_GET_CTX(pVCpu)->cr0 & (X86_CR0_MP | X86_CR0_TS)) == (X86_CR0_MP | X86_CR0_TS)) \ 11040 11040 return iemRaiseDeviceNotAvailable(pVCpu); \ 11041 11041 } while (0) 11042 11042 #define IEM_MC_MAYBE_RAISE_FPU_XCPT() \ 11043 11043 do { \ 11044 if ( (pVCpu)->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.FSW & X86_FSW_ES) \11044 if (IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FSW & X86_FSW_ES) \ 11045 11045 return iemRaiseMathFault(pVCpu); \ 11046 11046 } while (0) … … 11101 11101 #define IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT() \ 11102 11102 do { \ 11103 if ( ( (pVCpu)->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_EM) \11103 if ( (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_EM) \ 11104 11104 || !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fMmx) \ 11105 11105 return iemRaiseUndefinedOpcode(pVCpu); \ … … 11109 11109 #define IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT_CHECK_SSE_OR_MMXEXT() \ 11110 11110 do { \ 11111 if ( ( (pVCpu)->iem.s.CTX_SUFF(pCtx)->cr0 & X86_CR0_EM) \11111 if ( (IEM_GET_CTX(pVCpu)->cr0 & X86_CR0_EM) \ 11112 11112 || ( !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fSse \ 11113 11113 && !IEM_GET_GUEST_CPU_FEATURES(pVCpu)->fAmdMmxExts) ) \ … … 11150 11150 uint32_t *a_pName = &a_Name 11151 11151 #define IEM_MC_COMMIT_EFLAGS(a_EFlags) \ 11152 do { (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u = (a_EFlags); Assert((pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u & X86_EFL_1); } while (0)11152 do { IEM_GET_CTX(pVCpu)->eflags.u = (a_EFlags); Assert(IEM_GET_CTX(pVCpu)->eflags.u & X86_EFL_1); } while (0) 11153 11153 11154 11154 #define IEM_MC_ASSIGN(a_VarOrArg, a_CVariableOrConst) (a_VarOrArg) = (a_CVariableOrConst) … … 11193 11193 (a_u32Dst) = iemSRegBaseFetchU64(pVCpu, (a_iSReg)); \ 11194 11194 } while (0) 11195 #define IEM_MC_FETCH_CR0_U16(a_u16Dst) (a_u16Dst) = (uint16_t) (pVCpu)->iem.s.CTX_SUFF(pCtx)->cr011196 #define IEM_MC_FETCH_CR0_U32(a_u32Dst) (a_u32Dst) = (uint32_t) (pVCpu)->iem.s.CTX_SUFF(pCtx)->cr011197 #define IEM_MC_FETCH_CR0_U64(a_u64Dst) (a_u64Dst) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->cr011195 #define IEM_MC_FETCH_CR0_U16(a_u16Dst) (a_u16Dst) = (uint16_t)IEM_GET_CTX(pVCpu)->cr0 11196 #define IEM_MC_FETCH_CR0_U32(a_u32Dst) (a_u32Dst) = (uint32_t)IEM_GET_CTX(pVCpu)->cr0 11197 #define IEM_MC_FETCH_CR0_U64(a_u64Dst) (a_u64Dst) = IEM_GET_CTX(pVCpu)->cr0 11198 11198 /** @todo IEM_MC_FETCH_LDTR_U16, IEM_MC_FETCH_LDTR_U32, IEM_MC_FETCH_LDTR_U64, IEM_MC_FETCH_TR_U16, IEM_MC_FETCH_TR_U32, and IEM_MC_FETCH_TR_U64 aren't worth it... */ 11199 11199 #define IEM_MC_FETCH_LDTR_U16(a_u16Dst) do { \ 11200 11200 IEM_CTX_IMPORT_NORET(pVCpu, IEM_GET_CTX(pVCpu), CPUMCTX_EXTRN_LDTR); \ 11201 (a_u16Dst) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->ldtr.Sel; \11201 (a_u16Dst) = IEM_GET_CTX(pVCpu)->ldtr.Sel; \ 11202 11202 } while (0) 11203 11203 #define IEM_MC_FETCH_LDTR_U32(a_u32Dst) do { \ 11204 11204 IEM_CTX_IMPORT_NORET(pVCpu, IEM_GET_CTX(pVCpu), CPUMCTX_EXTRN_LDTR); \ 11205 (a_u32Dst) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->ldtr.Sel; \11205 (a_u32Dst) = IEM_GET_CTX(pVCpu)->ldtr.Sel; \ 11206 11206 } while (0) 11207 11207 #define IEM_MC_FETCH_LDTR_U64(a_u64Dst) do { \ 11208 11208 IEM_CTX_IMPORT_NORET(pVCpu, IEM_GET_CTX(pVCpu), CPUMCTX_EXTRN_LDTR); \ 11209 (a_u64Dst) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->ldtr.Sel; \11209 (a_u64Dst) = IEM_GET_CTX(pVCpu)->ldtr.Sel; \ 11210 11210 } while (0) 11211 11211 #define IEM_MC_FETCH_TR_U16(a_u16Dst) do { \ 11212 11212 IEM_CTX_IMPORT_NORET(pVCpu, IEM_GET_CTX(pVCpu), CPUMCTX_EXTRN_TR); \ 11213 (a_u16Dst) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->tr.Sel; \11213 (a_u16Dst) = IEM_GET_CTX(pVCpu)->tr.Sel; \ 11214 11214 } while (0) 11215 11215 #define IEM_MC_FETCH_TR_U32(a_u32Dst) do { \ 11216 11216 IEM_CTX_IMPORT_NORET(pVCpu, IEM_GET_CTX(pVCpu), CPUMCTX_EXTRN_TR); \ 11217 (a_u32Dst) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->tr.Sel; \11217 (a_u32Dst) = IEM_GET_CTX(pVCpu)->tr.Sel; \ 11218 11218 } while (0) 11219 11219 #define IEM_MC_FETCH_TR_U64(a_u64Dst) do { \ 11220 11220 IEM_CTX_IMPORT_NORET(pVCpu, IEM_GET_CTX(pVCpu), CPUMCTX_EXTRN_TR); \ 11221 (a_u64Dst) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->tr.Sel; \11221 (a_u64Dst) = IEM_GET_CTX(pVCpu)->tr.Sel; \ 11222 11222 } while (0) 11223 11223 /** @note Not for IOPL or IF testing or modification. */ 11224 #define IEM_MC_FETCH_EFLAGS(a_EFlags) (a_EFlags) = (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u11225 #define IEM_MC_FETCH_EFLAGS_U8(a_EFlags) (a_EFlags) = (uint8_t) (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u11224 #define IEM_MC_FETCH_EFLAGS(a_EFlags) (a_EFlags) = IEM_GET_CTX(pVCpu)->eflags.u 11225 #define IEM_MC_FETCH_EFLAGS_U8(a_EFlags) (a_EFlags) = (uint8_t)IEM_GET_CTX(pVCpu)->eflags.u 11226 11226 #define IEM_MC_FETCH_FSW(a_u16Fsw) (a_u16Fsw) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FSW 11227 11227 #define IEM_MC_FETCH_FCW(a_u16Fcw) (a_u16Fcw) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FCW … … 11257 11257 #define IEM_MC_REF_GREG_U64(a_pu64Dst, a_iGReg) (a_pu64Dst) = iemGRegRefU64(pVCpu, (a_iGReg)) 11258 11258 /** @note Not for IOPL or IF testing or modification. */ 11259 #define IEM_MC_REF_EFLAGS(a_pEFlags) (a_pEFlags) = & (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u11259 #define IEM_MC_REF_EFLAGS(a_pEFlags) (a_pEFlags) = &IEM_GET_CTX(pVCpu)->eflags.u 11260 11260 11261 11261 #define IEM_MC_ADD_GREG_U8(a_iGReg, a_u8Value) *iemGRegRefU8( pVCpu, (a_iGReg)) += (a_u8Value) … … 11335 11335 11336 11336 /** @note Not for IOPL or IF modification. */ 11337 #define IEM_MC_SET_EFL_BIT(a_fBit) do { (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u |= (a_fBit); } while (0)11337 #define IEM_MC_SET_EFL_BIT(a_fBit) do { IEM_GET_CTX(pVCpu)->eflags.u |= (a_fBit); } while (0) 11338 11338 /** @note Not for IOPL or IF modification. */ 11339 #define IEM_MC_CLEAR_EFL_BIT(a_fBit) do { (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u &= ~(a_fBit); } while (0)11339 #define IEM_MC_CLEAR_EFL_BIT(a_fBit) do { IEM_GET_CTX(pVCpu)->eflags.u &= ~(a_fBit); } while (0) 11340 11340 /** @note Not for IOPL or IF modification. */ 11341 #define IEM_MC_FLIP_EFL_BIT(a_fBit) do { (pVCpu)->iem.s.CTX_SUFF(pCtx)->eflags.u ^= (a_fBit); } while (0)11342 11343 #define IEM_MC_CLEAR_FSW_EX() do { (pVCpu)->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState)->x87.FSW &= X86_FSW_C_MASK | X86_FSW_TOP_MASK; } while (0)11341 #define IEM_MC_FLIP_EFL_BIT(a_fBit) do { IEM_GET_CTX(pVCpu)->eflags.u ^= (a_fBit); } while (0) 11342 11343 #define IEM_MC_CLEAR_FSW_EX() do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.FSW &= X86_FSW_C_MASK | X86_FSW_TOP_MASK; } while (0) 11344 11344 11345 11345 /** Switches the FPU state to MMX mode (FSW.TOS=0, FTW=0) if necessary. */ … … 12269 12269 * IEM_MC_CALL_AVX_AIMPL_3, IEM_MC_CALL_AVX_AIMPL_4, ... */ 12270 12270 #define IEM_MC_IMPLICIT_AVX_AIMPL_ARGS() \ 12271 IEM_MC_ARG_CONST(PX86XSAVEAREA, pXState, (pVCpu)->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState), 0)12271 IEM_MC_ARG_CONST(PX86XSAVEAREA, pXState, IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState), 0) 12272 12272 12273 12273 /** -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r72493 r72494 7126 7126 if (rcStrict == VINF_SUCCESS) 7127 7127 { 7128 PCPUMCTX pCtx = pVCpu->iem.s.CTX_SUFF(pCtx);7128 PCPUMCTX pCtx = IEM_GET_CTX(pVCpu); 7129 7129 pCtx->eflags.u = *pEFlags; /* IEM_MC_COMMIT_EFLAGS */ 7130 7130 if (!(*pEFlags & X86_EFL_ZF)) -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r69111 r72494 67 67 { 68 68 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 69 pVCpu->iem.s.pCtxR3 = CPUMQueryGuestCtxPtr(pVCpu);70 pVCpu->iem.s.pCtxR0 = VM_R0_ADDR(pVM, pVCpu->iem.s.pCtxR3);71 pVCpu->iem.s.pCtxRC = VM_RC_ADDR(pVM, pVCpu->iem.s.pCtxR3);72 69 73 70 pVCpu->iem.s.CodeTlb.uTlbRevision = pVCpu->iem.s.DataTlb.uTlbRevision = uInitialTlbRevision; … … 194 191 { 195 192 for (VMCPUID idCpu = 0; idCpu < pVM->cCpus; idCpu++) 196 {197 pVM->aCpus[idCpu].iem.s.pCtxRC = VM_RC_ADDR(pVM, pVM->aCpus[idCpu].iem.s.pCtxR3);198 193 if (pVM->aCpus[idCpu].iem.s.pStatsRC) 199 194 pVM->aCpus[idCpu].iem.s.pStatsRC = MMHyperR3ToRC(pVM, pVM->aCpus[idCpu].iem.s.pStatsCCR3); 200 }201 195 } 202 196 -
trunk/src/VBox/VMM/include/IEMInternal.h
r72493 r72494 607 607 IEMTLB CodeTlb; 608 608 609 /** Pointer to the CPU context - ring-3 context.610 * @todo put inside IEM_VERIFICATION_MODE_FULL++. */611 R3PTRTYPE(PCPUMCTX) pCtxR3;612 /** Pointer to the CPU context - ring-0 context. */613 R0PTRTYPE(PCPUMCTX) pCtxR0;614 /** Pointer to the CPU context - raw-mode context. */615 RCPTRTYPE(PCPUMCTX) pCtxRC;616 617 609 /** Pointer to instruction statistics for raw-mode context (same as R0). */ 618 610 RCPTRTYPE(PIEMINSTRSTATS) pStatsRC; -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r71092 r72494 20 20 * Header Files * 21 21 *********************************************************************************************************************************/ 22 #define VMCPU_INCL_CPUM_GST_CTX 22 23 #include <iprt/assert.h> 23 24 #include <iprt/rand.h> … … 708 709 #define IEM_MC_CALL_SSE_AIMPL_3(a_pfnAImpl, a0, a1, a2) \ 709 710 do { (void)fSseHost; (void)fSseWrite; CHK_CALL_ARG(a0, 0); CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2);} while (0) 710 #define IEM_MC_IMPLICIT_AVX_AIMPL_ARGS() IEM_MC_ARG_CONST(PX86XSAVEAREA, pXState, (pVCpu)->iem.s.CTX_SUFF(pCtx)->CTX_SUFF(pXState), 0)711 #define IEM_MC_IMPLICIT_AVX_AIMPL_ARGS() IEM_MC_ARG_CONST(PX86XSAVEAREA, pXState, IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState), 0) 711 712 #define IEM_MC_CALL_AVX_AIMPL_2(a_pfnAImpl, a1, a2) \ 712 713 do { (void)fAvxHost; (void)fAvxWrite; CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2); } while (0) -
trunk/src/VBox/VMM/testcase/tstVMStruct.h
r72490 r72494 296 296 297 297 GEN_CHECK_SIZE(IEMCPU); 298 GEN_CHECK_OFF(IEMCPU, pCtxR0);299 GEN_CHECK_OFF(IEMCPU, pCtxR3);300 GEN_CHECK_OFF(IEMCPU, pCtxRC);301 298 GEN_CHECK_OFF(IEMCPU, enmCpuMode); 302 299 GEN_CHECK_OFF(IEMCPU, fPrefixes);
Note:
See TracChangeset
for help on using the changeset viewer.