Changeset 72513 in vbox
- Timestamp:
- Jun 11, 2018 2:20:47 PM (7 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r72512 r72513 11082 11082 (a_u32Dst) = iemSRegBaseFetchU64(pVCpu, (a_iSReg)); \ 11083 11083 } while (0) 11084 #define IEM_MC_FETCH_TR_U16(a_u16Dst) do { \11085 IEM_CTX_IMPORT_NORET(pVCpu, CPUMCTX_EXTRN_TR); \11086 (a_u16Dst) = pVCpu->cpum.GstCtx.tr.Sel; \11087 } while (0)11088 #define IEM_MC_FETCH_TR_U32(a_u32Dst) do { \11089 IEM_CTX_IMPORT_NORET(pVCpu, CPUMCTX_EXTRN_TR); \11090 (a_u32Dst) = pVCpu->cpum.GstCtx.tr.Sel; \11091 } while (0)11092 #define IEM_MC_FETCH_TR_U64(a_u64Dst) do { \11093 IEM_CTX_IMPORT_NORET(pVCpu, CPUMCTX_EXTRN_TR); \11094 (a_u64Dst) = pVCpu->cpum.GstCtx.tr.Sel; \11095 } while (0)11096 11084 /** @note Not for IOPL or IF testing or modification. */ 11097 11085 #define IEM_MC_FETCH_EFLAGS(a_EFlags) (a_EFlags) = pVCpu->cpum.GstCtx.eflags.u -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r72512 r72513 5057 5057 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 5058 5058 return VINF_SUCCESS; 5059 } 5060 5061 5062 /** 5063 * Implements str GReg 5064 * 5065 * @param iGReg The general register to store the CRx value in. 5066 * @param enmEffOpSize The operand size. 5067 */ 5068 IEM_CIMPL_DEF_2(iemCImpl_str_reg, uint8_t, iGReg, uint8_t, enmEffOpSize) 5069 { 5070 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0); 5071 5072 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_TR); 5073 switch (enmEffOpSize) 5074 { 5075 case IEMMODE_16BIT: *(uint16_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.tr.Sel; break; 5076 case IEMMODE_32BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.tr.Sel; break; 5077 case IEMMODE_64BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.tr.Sel; break; 5078 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 5079 } 5080 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 5081 return VINF_SUCCESS; 5082 } 5083 5084 5085 /** 5086 * Implements str mem. 5087 * 5088 * @param iGReg The general register to store the CRx value in. 5089 * @param iEffSeg The effective segment register to use with @a GCPtrMem. 5090 * @param GCPtrEffDst Where to store the 16-bit CR0 value. 5091 */ 5092 IEM_CIMPL_DEF_2(iemCImpl_str_mem, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst) 5093 { 5094 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0); 5095 5096 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_TR); 5097 VBOXSTRICTRC rcStrict = iemMemStoreDataU16(pVCpu, iEffSeg, GCPtrEffDst, pVCpu->cpum.GstCtx.tr.Sel); 5098 if (rcStrict == VINF_SUCCESS) 5099 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 5100 return rcStrict; 5059 5101 } 5060 5102 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r72512 r72513 43 43 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 1); 44 44 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 45 IEMOP_HLP_D ONE_DECODING_NO_LOCK_PREFIX();45 IEMOP_HLP_DECODED_NL_1(OP_SLDT, IEMOPFORM_M_MEM, OP_PARM_Ew, DISOPTYPE_DANGEROUS | DISOPTYPE_PRIVILEGED_NOTRAP); 46 46 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 47 47 IEM_MC_CALL_CIMPL_2(iemCImpl_sldt_mem, iEffSeg, GCPtrEffDst); … … 58 58 IEMOP_HLP_NO_REAL_OR_V86_MODE(); 59 59 60 60 61 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 61 62 { 62 63 IEMOP_HLP_DECODED_NL_1(OP_STR, IEMOPFORM_M_REG, OP_PARM_Ew, DISOPTYPE_DANGEROUS | DISOPTYPE_PRIVILEGED_NOTRAP); 63 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0); 64 switch (pVCpu->iem.s.enmEffOpSize) 65 { 66 case IEMMODE_16BIT: 67 IEM_MC_BEGIN(0, 1); 68 IEM_MC_LOCAL(uint16_t, u16Tr); 69 IEM_MC_FETCH_TR_U16(u16Tr); 70 IEM_MC_STORE_GREG_U16((bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, u16Tr); 71 IEM_MC_ADVANCE_RIP(); 72 IEM_MC_END(); 73 break; 74 75 case IEMMODE_32BIT: 76 IEM_MC_BEGIN(0, 1); 77 IEM_MC_LOCAL(uint32_t, u32Tr); 78 IEM_MC_FETCH_TR_U32(u32Tr); 79 IEM_MC_STORE_GREG_U32((bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, u32Tr); 80 IEM_MC_ADVANCE_RIP(); 81 IEM_MC_END(); 82 break; 83 84 case IEMMODE_64BIT: 85 IEM_MC_BEGIN(0, 1); 86 IEM_MC_LOCAL(uint64_t, u64Tr); 87 IEM_MC_FETCH_TR_U64(u64Tr); 88 IEM_MC_STORE_GREG_U64((bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, u64Tr); 89 IEM_MC_ADVANCE_RIP(); 90 IEM_MC_END(); 91 break; 92 93 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 94 } 95 } 96 else 97 { 98 IEM_MC_BEGIN(0, 2); 99 IEM_MC_LOCAL(uint16_t, u16Tr); 100 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 101 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 102 IEMOP_HLP_DECODED_NL_1(OP_STR, IEMOPFORM_M_MEM, OP_PARM_Ew, DISOPTYPE_DANGEROUS | DISOPTYPE_PRIVILEGED_NOTRAP); 103 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_TR_READS, SVM_EXIT_TR_READ, 0, 0); 104 IEM_MC_FETCH_TR_U16(u16Tr); 105 IEM_MC_STORE_MEM_U16(pVCpu->iem.s.iEffSeg, GCPtrEffDst, u16Tr); 106 IEM_MC_ADVANCE_RIP(); 107 IEM_MC_END(); 108 } 64 return IEM_MC_DEFER_TO_CIMPL_2(iemCImpl_str_reg, (bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, pVCpu->iem.s.enmEffOpSize); 65 } 66 67 /* Ignore operand size here, memory refs are always 16-bit. */ 68 IEM_MC_BEGIN(2, 0); 69 IEM_MC_ARG(uint16_t, iEffSeg, 0); 70 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 1); 71 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 72 IEMOP_HLP_DECODED_NL_1(OP_STR, IEMOPFORM_M_MEM, OP_PARM_Ew, DISOPTYPE_DANGEROUS | DISOPTYPE_PRIVILEGED_NOTRAP); 73 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 74 IEM_MC_CALL_CIMPL_2(iemCImpl_str_mem, iEffSeg, GCPtrEffDst); 75 IEM_MC_END(); 109 76 return VINF_SUCCESS; 110 77 } -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r72512 r72513 429 429 #define IEM_MC_FETCH_SREG_BASE_U64(a_u64Dst, a_iSReg) do { (a_u64Dst) = 0; CHK_TYPE(uint64_t, a_u64Dst); } while (0) 430 430 #define IEM_MC_FETCH_SREG_BASE_U32(a_u32Dst, a_iSReg) do { (a_u32Dst) = 0; CHK_TYPE(uint32_t, a_u32Dst); } while (0) 431 #define IEM_MC_FETCH_TR_U16(a_u16Dst) do { (a_u16Dst) = 0; CHK_TYPE(uint16_t, a_u16Dst); } while (0)432 #define IEM_MC_FETCH_TR_U32(a_u32Dst) do { (a_u32Dst) = 0; CHK_TYPE(uint32_t, a_u32Dst); } while (0)433 #define IEM_MC_FETCH_TR_U64(a_u64Dst) do { (a_u64Dst) = 0; CHK_TYPE(uint64_t, a_u64Dst); } while (0)434 431 #define IEM_MC_FETCH_EFLAGS(a_EFlags) do { (a_EFlags) = 0; CHK_TYPE(uint32_t, a_EFlags); } while (0) 435 432 #define IEM_MC_FETCH_EFLAGS_U8(a_EFlags) do { (a_EFlags) = 0; CHK_TYPE(uint8_t, a_EFlags); } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.