Changeset 72512 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jun 11, 2018 2:12:21 PM (7 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r72505 r72512 11082 11082 (a_u32Dst) = iemSRegBaseFetchU64(pVCpu, (a_iSReg)); \ 11083 11083 } while (0) 11084 /** @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... */11085 #define IEM_MC_FETCH_LDTR_U16(a_u16Dst) do { \11086 IEM_CTX_IMPORT_NORET(pVCpu, CPUMCTX_EXTRN_LDTR); \11087 (a_u16Dst) = pVCpu->cpum.GstCtx.ldtr.Sel; \11088 } while (0)11089 #define IEM_MC_FETCH_LDTR_U32(a_u32Dst) do { \11090 IEM_CTX_IMPORT_NORET(pVCpu, CPUMCTX_EXTRN_LDTR); \11091 (a_u32Dst) = pVCpu->cpum.GstCtx.ldtr.Sel; \11092 } while (0)11093 #define IEM_MC_FETCH_LDTR_U64(a_u64Dst) do { \11094 IEM_CTX_IMPORT_NORET(pVCpu, CPUMCTX_EXTRN_LDTR); \11095 (a_u64Dst) = pVCpu->cpum.GstCtx.ldtr.Sel; \11096 } while (0)11097 11084 #define IEM_MC_FETCH_TR_U16(a_u16Dst) do { \ 11098 11085 IEM_CTX_IMPORT_NORET(pVCpu, CPUMCTX_EXTRN_TR); \ -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r72506 r72512 4896 4896 4897 4897 /** 4898 * Implements sldt GReg 4899 * 4900 * @param iGReg The general register to store the CRx value in. 4901 * @param enmEffOpSize The operand size. 4902 */ 4903 IEM_CIMPL_DEF_2(iemCImpl_sldt_reg, uint8_t, iGReg, uint8_t, enmEffOpSize) 4904 { 4905 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0); 4906 4907 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_LDTR); 4908 switch (enmEffOpSize) 4909 { 4910 case IEMMODE_16BIT: *(uint16_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.ldtr.Sel; break; 4911 case IEMMODE_32BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.ldtr.Sel; break; 4912 case IEMMODE_64BIT: *(uint64_t *)iemGRegRef(pVCpu, iGReg) = pVCpu->cpum.GstCtx.ldtr.Sel; break; 4913 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 4914 } 4915 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 4916 return VINF_SUCCESS; 4917 } 4918 4919 4920 /** 4921 * Implements sldt mem. 4922 * 4923 * @param iGReg The general register to store the CRx value in. 4924 * @param iEffSeg The effective segment register to use with @a GCPtrMem. 4925 * @param GCPtrEffDst Where to store the 16-bit CR0 value. 4926 */ 4927 IEM_CIMPL_DEF_2(iemCImpl_sldt_mem, uint8_t, iEffSeg, RTGCPTR, GCPtrEffDst) 4928 { 4929 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0); 4930 4931 IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_LDTR); 4932 VBOXSTRICTRC rcStrict = iemMemStoreDataU16(pVCpu, iEffSeg, GCPtrEffDst, pVCpu->cpum.GstCtx.ldtr.Sel); 4933 if (rcStrict == VINF_SUCCESS) 4934 iemRegAddToRipAndClearRF(pVCpu, cbInstr); 4935 return rcStrict; 4936 } 4937 4938 4939 /** 4898 4940 * Implements lldt. 4899 4941 * … … 5135 5177 * Implements smsw mem. 5136 5178 * 5137 * @param iGReg The general register to store the CR xvalue in.5179 * @param iGReg The general register to store the CR0 value in. 5138 5180 * @param iEffSeg The effective segment register to use with @a GCPtrMem. 5139 5181 * @param GCPtrEffDst Where to store the 16-bit CR0 value. -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r72505 r72512 35 35 { 36 36 IEMOP_HLP_DECODED_NL_1(OP_SLDT, IEMOPFORM_M_REG, OP_PARM_Ew, DISOPTYPE_DANGEROUS | DISOPTYPE_PRIVILEGED_NOTRAP); 37 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0); 38 switch (pVCpu->iem.s.enmEffOpSize) 39 { 40 case IEMMODE_16BIT: 41 IEM_MC_BEGIN(0, 1); 42 IEM_MC_LOCAL(uint16_t, u16Ldtr); 43 IEM_MC_FETCH_LDTR_U16(u16Ldtr); 44 IEM_MC_STORE_GREG_U16((bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, u16Ldtr); 45 IEM_MC_ADVANCE_RIP(); 46 IEM_MC_END(); 47 break; 48 49 case IEMMODE_32BIT: 50 IEM_MC_BEGIN(0, 1); 51 IEM_MC_LOCAL(uint32_t, u32Ldtr); 52 IEM_MC_FETCH_LDTR_U32(u32Ldtr); 53 IEM_MC_STORE_GREG_U32((bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, u32Ldtr); 54 IEM_MC_ADVANCE_RIP(); 55 IEM_MC_END(); 56 break; 57 58 case IEMMODE_64BIT: 59 IEM_MC_BEGIN(0, 1); 60 IEM_MC_LOCAL(uint64_t, u64Ldtr); 61 IEM_MC_FETCH_LDTR_U64(u64Ldtr); 62 IEM_MC_STORE_GREG_U64((bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, u64Ldtr); 63 IEM_MC_ADVANCE_RIP(); 64 IEM_MC_END(); 65 break; 66 67 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 68 } 69 } 70 else 71 { 72 IEM_MC_BEGIN(0, 2); 73 IEM_MC_LOCAL(uint16_t, u16Ldtr); 74 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 75 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 76 IEMOP_HLP_DECODED_NL_1(OP_SLDT, IEMOPFORM_M_MEM, OP_PARM_Ew, DISOPTYPE_DANGEROUS | DISOPTYPE_PRIVILEGED_NOTRAP); 77 IEMOP_HLP_SVM_INSTR_INTERCEPT_AND_NRIP(pVCpu, SVM_CTRL_INTERCEPT_LDTR_READS, SVM_EXIT_LDTR_READ, 0, 0); 78 IEM_MC_FETCH_LDTR_U16(u16Ldtr); 79 IEM_MC_STORE_MEM_U16(pVCpu->iem.s.iEffSeg, GCPtrEffDst, u16Ldtr); 80 IEM_MC_ADVANCE_RIP(); 81 IEM_MC_END(); 82 } 37 return IEM_MC_DEFER_TO_CIMPL_2(iemCImpl_sldt_reg, (bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB, pVCpu->iem.s.enmEffOpSize); 38 } 39 40 /* Ignore operand size here, memory refs are always 16-bit. */ 41 IEM_MC_BEGIN(2, 0); 42 IEM_MC_ARG(uint16_t, iEffSeg, 0); 43 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 1); 44 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 45 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 46 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 47 IEM_MC_CALL_CIMPL_2(iemCImpl_sldt_mem, iEffSeg, GCPtrEffDst); 48 IEM_MC_END(); 83 49 return VINF_SUCCESS; 84 50 }
Note:
See TracChangeset
for help on using the changeset viewer.