Changeset 73959 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Aug 29, 2018 3:24:49 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r73937 r73959 952 952 #endif 953 953 954 #ifdef VBOX_WITH_NESTED_HWVIRT_VMX955 IEM_STATIC VBOXSTRICTRC iemVmxVmxon(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmxon, PCVMXEXITINSTRINFO pExitInstrInfo,956 RTGCPTR GCPtrDisp);957 #endif958 954 959 955 /** … … 15549 15545 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15550 15546 * @param cbInstr The instruction length in bytes. 15551 * @param GCPtrVmxon The linear address of the VMCS pointer.15552 * @param uExitInstrInfo The VM-exit instruction information field.15553 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any.15547 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 15548 * @param GCPtrVmcs The linear address of the VMCS pointer. 15549 * @param pExitInfo Pointer to the VM-exit information struct. 15554 15550 * @thread EMT(pVCpu) 15555 15551 */ 15556 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmptrld(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, uint32_t uExitInstrInfo,15557 RTGCPTR GCPtrDisp)15552 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmptrld(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmcs, 15553 PCVMXVEXITINFO pExitInfo) 15558 15554 { 15559 15555 IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3); 15560 15556 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 15557 Assert(pExitInfo); 15561 15558 15562 15559 iemInitExec(pVCpu, false /*fBypassHandlers*/); 15563 PCVMXEXITINSTRINFO pExitInstrInfo = (PCVMXEXITINSTRINFO)&uExitInstrInfo; 15564 VBOXSTRICTRC rcStrict = iemVmxVmptrld(pVCpu, cbInstr, GCPtrVmcs, pExitInstrInfo, GCPtrDisp); 15560 VBOXSTRICTRC rcStrict = iemVmxVmptrld(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, pExitInfo); 15565 15561 if (pVCpu->iem.s.cActiveMappings) 15566 15562 iemMemRollback(pVCpu); … … 15575 15571 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15576 15572 * @param cbInstr The instruction length in bytes. 15577 * @param GCPtrVmxon The linear address of where to store the VMCS pointer.15578 * @param uExitInstrInfo The VM-exit instruction information field.15579 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any.15573 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 15574 * @param GCPtrVmcs The linear address of the VMCS pointer. 15575 * @param pExitInfo Pointer to the VM-exit information struct. 15580 15576 * @thread EMT(pVCpu) 15581 15577 */ 15582 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmptrst(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, uint32_t uExitInstrInfo,15583 RTGCPTR GCPtrDisp)15578 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmptrst(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmcs, 15579 PCVMXVEXITINFO pExitInfo) 15584 15580 { 15585 15581 IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3); 15586 15582 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 15583 Assert(pExitInfo); 15587 15584 15588 15585 iemInitExec(pVCpu, false /*fBypassHandlers*/); 15589 PCVMXEXITINSTRINFO pExitInstrInfo = (PCVMXEXITINSTRINFO)&uExitInstrInfo; 15590 VBOXSTRICTRC rcStrict = iemVmxVmptrst(pVCpu, cbInstr, GCPtrVmcs, pExitInstrInfo, GCPtrDisp); 15586 VBOXSTRICTRC rcStrict = iemVmxVmptrst(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, pExitInfo); 15591 15587 if (pVCpu->iem.s.cActiveMappings) 15592 15588 iemMemRollback(pVCpu); … … 15601 15597 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15602 15598 * @param cbInstr The instruction length in bytes. 15603 * @param GCPtrVmxon The linear address of the VMCS pointer.15604 * @param uExitInstrInfo The VM-exit instruction information field.15605 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any.15599 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 15600 * @param GCPtrVmcs The linear address of the VMCS pointer. 15601 * @param pExitInfo Pointer to the VM-exit information struct. 15606 15602 * @thread EMT(pVCpu) 15607 15603 */ 15608 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmclear(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, uint32_t uExitInstrInfo,15609 RTGCPTR GCPtrDisp)15604 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmclear(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmcs, 15605 PCVMXVEXITINFO pExitInfo) 15610 15606 { 15611 15607 IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3); 15612 15608 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 15609 Assert(pExitInfo); 15613 15610 15614 15611 iemInitExec(pVCpu, false /*fBypassHandlers*/); 15615 PCVMXEXITINSTRINFO pExitInstrInfo = (PCVMXEXITINSTRINFO)&uExitInstrInfo; 15616 VBOXSTRICTRC rcStrict = iemVmxVmclear(pVCpu, cbInstr, GCPtrVmcs, pExitInstrInfo, GCPtrDisp); 15612 VBOXSTRICTRC rcStrict = iemVmxVmclear(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, pExitInfo); 15617 15613 if (pVCpu->iem.s.cActiveMappings) 15618 15614 iemMemRollback(pVCpu); … … 15627 15623 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15628 15624 * @param cbInstr The instruction length in bytes. 15625 * @param iEffSeg The effective segment register to use with @a 15626 * GCPtrVmxon. 15629 15627 * @param GCPtrVmxon The linear address of the VMXON pointer. 15630 * @param uExitInstrInfo The VM-exit instruction information field. 15631 * @param GCPtrDisp The displacement field for @a GCPtrVmxon if any. 15628 * @param pExitInfo The VM-exit instruction information struct. 15632 15629 * @thread EMT(pVCpu) 15633 15630 */ 15634 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmxon(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmxon, uint32_t uExitInstrInfo,15635 RTGCPTR GCPtrDisp)15631 VMM_INT_DECL(VBOXSTRICTRC) IEMExecDecodedVmxon(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmxon, 15632 PCVMXVEXITINFO pExitInfo) 15636 15633 { 15637 15634 IEMEXEC_ASSERT_INSTR_LEN_RETURN(cbInstr, 3); 15638 15635 IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_HWVIRT); 15636 Assert(pExitInfo); 15639 15637 15640 15638 iemInitExec(pVCpu, false /*fBypassHandlers*/); 15641 PCVMXEXITINSTRINFO pExitInstrInfo = (PCVMXEXITINSTRINFO)&uExitInstrInfo; 15642 VBOXSTRICTRC rcStrict = iemVmxVmxon(pVCpu, cbInstr, GCPtrVmxon, pExitInstrInfo, GCPtrDisp); 15639 VBOXSTRICTRC rcStrict = iemVmxVmxon(pVCpu, cbInstr, iEffSeg, GCPtrVmxon, pExitInfo); 15643 15640 if (pVCpu->iem.s.cActiveMappings) 15644 15641 iemMemRollback(pVCpu); -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r73937 r73959 1041 1041 * @param pVCpu The cross context virtual CPU structure. 1042 1042 * @param cbInstr The instruction length. 1043 * @param iEffSeg The effective segment register to use with @a u64Val. 1044 * Pass UINT8_MAX if it is a register access. 1045 * @param enmEffAddrMode The effective addressing mode. 1046 * @param u64Val The value to write (or guest linear address to the 1047 * value), @a iEffSeg will indicate if it's a memory 1048 * operand. 1043 1049 * @param uFieldEnc The VMCS field encoding. 1044 * @param u64Val The value to write (or guest linear address to the 1045 * value), @a pExitInstrInfo will indicate whether it's a 1046 * memory or register operand. 1047 * @param pExitInstrInfo Pointer to the VM-exit instruction information field. 1048 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any. 1049 */ 1050 IEM_STATIC VBOXSTRICTRC iemVmxVmwrite(PVMCPU pVCpu, uint8_t cbInstr, uint32_t uFieldEnc, uint64_t u64Val, 1051 PCVMXEXITINSTRINFO pExitInstrInfo, RTGCPTR GCPtrDisp) 1050 * @param pExitInfo Pointer to the VM-exit information struct. 1051 */ 1052 IEM_STATIC VBOXSTRICTRC iemVmxVmwrite(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, IEMMODE enmEffAddrMode, 1053 uint64_t u64Val, uint32_t uFieldEnc, PCVMXVEXITINFO pExitInfo) 1052 1054 { 1053 1055 if (IEM_IS_VMX_NON_ROOT_MODE(pVCpu)) 1054 1056 { 1055 RT_NOREF( GCPtrDisp);1057 RT_NOREF(pExitInfo); 1056 1058 /** @todo NSTVMX: intercept. */ 1057 1059 /** @todo NSTVMX: VMCS shadowing intercept (VMREAD/VMWRITE bitmap). */ … … 1089 1091 1090 1092 /* If the VMWRITE instruction references memory, access the specified in memory operand. */ 1091 if (!pExitInstrInfo->VmreadVmwrite.fIsRegOperand)1092 {1093 uint8_t const uAddrSize = pExitInstrInfo->VmreadVmwrite.u3AddrSize;1094 static uint64_t const s_auAddrSizeMasks[] = { UINT64_C(0xffff), UINT64_C(0xffffffff), UINT64_C(0xffffffffffffffff) , 0};1095 Assert RCReturn(uAddrSize != 3, VERR_IEM_IPE_1);1096 RTGCPTR const GCPtrVal = u64Val & s_auAddrSizeMasks[ uAddrSize];1093 bool const fIsRegOperand = iEffSeg == UINT8_MAX; 1094 if (fIsRegOperand) 1095 { 1096 static uint64_t const s_auAddrSizeMasks[] = { UINT64_C(0xffff), UINT64_C(0xffffffff), UINT64_C(0xffffffffffffffff) }; 1097 Assert(enmEffAddrMode < RT_ELEMENTS(s_auAddrSizeMasks)); 1098 RTGCPTR const GCPtrVal = u64Val & s_auAddrSizeMasks[enmEffAddrMode]; 1097 1099 1098 1100 /* Read the value from the specified guest memory location. */ 1099 1101 VBOXSTRICTRC rcStrict; 1100 1102 if (pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT) 1101 rcStrict = iemMemFetchDataU64(pVCpu, &u64Val, pExitInstrInfo->VmreadVmwrite.iSegReg, GCPtrVal);1103 rcStrict = iemMemFetchDataU64(pVCpu, &u64Val, iEffSeg, GCPtrVal); 1102 1104 else 1103 1105 { 1104 1106 uint32_t u32Val; 1105 rcStrict = iemMemFetchDataU32(pVCpu, &u32Val, pExitInstrInfo->VmreadVmwrite.iSegReg, GCPtrVal);1107 rcStrict = iemMemFetchDataU32(pVCpu, &u32Val, iEffSeg, GCPtrVal); 1106 1108 u64Val = u32Val; 1107 1109 } … … 1182 1184 * @param pVCpu The cross context virtual CPU structure. 1183 1185 * @param cbInstr The instruction length. 1186 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 1184 1187 * @param GCPtrVmcs The linear address of the VMCS pointer. 1185 * @param pExitIn strInfo Pointer to the VM-exit instruction information field.1186 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any.1188 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can 1189 * be NULL. 1187 1190 * 1188 1191 * @remarks Common VMX instruction checks are already expected to by the caller, 1189 1192 * i.e. VMX operation, CR4.VMXE, Real/V86 mode, EFER/CS.L checks. 1190 1193 */ 1191 IEM_STATIC VBOXSTRICTRC iemVmxVmclear(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, PCVMXEXITINSTRINFO pExitInstrInfo,1192 RTGCPTR GCPtrDisp)1194 IEM_STATIC VBOXSTRICTRC iemVmxVmclear(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmcs, 1195 PCVMXVEXITINFO pExitInfo) 1193 1196 { 1194 1197 if (IEM_IS_VMX_NON_ROOT_MODE(pVCpu)) 1195 1198 { 1196 RT_NOREF( GCPtrDisp);1199 RT_NOREF(pExitInfo); 1197 1200 /** @todo NSTVMX: intercept. */ 1198 1201 } … … 1209 1212 /* Get the VMCS pointer from the location specified by the source memory operand. */ 1210 1213 RTGCPHYS GCPhysVmcs; 1211 VBOXSTRICTRC rcStrict = iemMemFetchDataU64(pVCpu, &GCPhysVmcs, pExitInstrInfo->VmxXsave.iSegReg, GCPtrVmcs);1214 VBOXSTRICTRC rcStrict = iemMemFetchDataU64(pVCpu, &GCPhysVmcs, iEffSeg, GCPtrVmcs); 1212 1215 if (RT_UNLIKELY(rcStrict != VINF_SUCCESS)) 1213 1216 { … … 1292 1295 * @param pVCpu The cross context virtual CPU structure. 1293 1296 * @param cbInstr The instruction length. 1297 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 1294 1298 * @param GCPtrVmcs The linear address of where to store the current VMCS 1295 1299 * pointer. 1296 * @param pExitIn strInfo Pointer to the VM-exit instruction information field.1297 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any.1300 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can 1301 * be NULL. 1298 1302 * 1299 1303 * @remarks Common VMX instruction checks are already expected to by the caller, 1300 1304 * i.e. VMX operation, CR4.VMXE, Real/V86 mode, EFER/CS.L checks. 1301 1305 */ 1302 IEM_STATIC VBOXSTRICTRC iemVmxVmptrst(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, PCVMXEXITINSTRINFO pExitInstrInfo,1303 RTGCPTR GCPtrDisp)1306 IEM_STATIC VBOXSTRICTRC iemVmxVmptrst(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmcs, 1307 PCVMXVEXITINFO pExitInfo) 1304 1308 { 1305 1309 if (IEM_IS_VMX_NON_ROOT_MODE(pVCpu)) 1306 1310 { 1307 RT_NOREF( GCPtrDisp);1311 RT_NOREF(pExitInfo); 1308 1312 /** @todo NSTVMX: intercept. */ 1309 1313 } … … 1320 1324 /* Set the VMCS pointer to the location specified by the destination memory operand. */ 1321 1325 AssertCompile(NIL_RTGCPHYS == ~(RTGCPHYS)0U); 1322 VBOXSTRICTRC rcStrict = iemMemStoreDataU64(pVCpu, pExitInstrInfo->VmxXsave.iSegReg, GCPtrVmcs, 1323 IEM_VMX_GET_CURRENT_VMCS(pVCpu)); 1326 VBOXSTRICTRC rcStrict = iemMemStoreDataU64(pVCpu, iEffSeg, GCPtrVmcs, IEM_VMX_GET_CURRENT_VMCS(pVCpu)); 1324 1327 if (RT_LIKELY(rcStrict == VINF_SUCCESS)) 1325 1328 { … … 1342 1345 * @param cbInstr The instruction length. 1343 1346 * @param GCPtrVmcs The linear address of the current VMCS pointer. 1344 * @param pExitIn strInfo Pointer to the VM-exit instruction information field.1345 * @param GCPtrDisp The displacement field for @a GCPtrVmcs if any.1347 * @param pExitInfo Pointer to the virtual VM-exit information struct. 1348 * Optional, can be NULL. 1346 1349 * 1347 1350 * @remarks Common VMX instruction checks are already expected to by the caller, 1348 1351 * i.e. VMX operation, CR4.VMXE, Real/V86 mode, EFER/CS.L checks. 1349 1352 */ 1350 IEM_STATIC VBOXSTRICTRC iemVmxVmptrld(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmcs, PCVMXEXITINSTRINFO pExitInstrInfo,1351 RTGCPTR GCPtrDisp)1353 IEM_STATIC VBOXSTRICTRC iemVmxVmptrld(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmcs, 1354 PCVMXVEXITINFO pExitInfo) 1352 1355 { 1353 1356 if (IEM_IS_VMX_NON_ROOT_MODE(pVCpu)) 1354 1357 { 1355 RT_NOREF( GCPtrDisp);1358 RT_NOREF(pExitInfo); 1356 1359 /** @todo NSTVMX: intercept. */ 1357 1360 } … … 1368 1371 /* Get the VMCS pointer from the location specified by the source memory operand. */ 1369 1372 RTGCPHYS GCPhysVmcs; 1370 VBOXSTRICTRC rcStrict = iemMemFetchDataU64(pVCpu, &GCPhysVmcs, pExitInstrInfo->VmxXsave.iSegReg, GCPtrVmcs);1373 VBOXSTRICTRC rcStrict = iemMemFetchDataU64(pVCpu, &GCPhysVmcs, iEffSeg, GCPtrVmcs); 1371 1374 if (RT_UNLIKELY(rcStrict != VINF_SUCCESS)) 1372 1375 { … … 1473 1476 * @param pVCpu The cross context virtual CPU structure. 1474 1477 * @param cbInstr The instruction length. 1478 * @param iEffSeg The effective segment register to use with @a 1479 * GCPtrVmxon. 1475 1480 * @param GCPtrVmxon The linear address of the VMXON pointer. 1476 * @param pExitIn strInfo Pointer to the VM-exit instruction information field.1477 * @param GCPtrDisp The displacement field for @a GCPtrVmxon if any.1481 * @param pExitInfo Pointer to the VM-exit instruction information struct. 1482 * Optional, can be NULL. 1478 1483 * 1479 1484 * @remarks Common VMX instruction checks are already expected to by the caller, 1480 1485 * i.e. CR4.VMXE, Real/V86 mode, EFER/CS.L checks. 1481 1486 */ 1482 IEM_STATIC VBOXSTRICTRC iemVmxVmxon(PVMCPU pVCpu, uint8_t cbInstr, RTGCPHYS GCPtrVmxon, PCVMXEXITINSTRINFO pExitInstrInfo,1483 RTGCPTR GCPtrDisp)1487 IEM_STATIC VBOXSTRICTRC iemVmxVmxon(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPHYS GCPtrVmxon, 1488 PCVMXVEXITINFO pExitInfo) 1484 1489 { 1485 1490 #if defined(VBOX_WITH_NESTED_HWVIRT_ONLY_IN_IEM) && !defined(IN_RING3) 1486 RT_NOREF5(pVCpu, cbInstr, GCPtrVmxon, pExitInstrInfo, GCPtrDisp);1491 RT_NOREF5(pVCpu, cbInstr, iEffSeg, GCPtrVmxon, pExitInfo); 1487 1492 return VINF_EM_RAW_EMULATE_INSTR; 1488 1493 #else … … 1534 1539 /* Get the VMXON pointer from the location specified by the source memory operand. */ 1535 1540 RTGCPHYS GCPhysVmxon; 1536 VBOXSTRICTRC rcStrict = iemMemFetchDataU64(pVCpu, &GCPhysVmxon, pExitInstrInfo->VmxXsave.iSegReg, GCPtrVmxon);1541 VBOXSTRICTRC rcStrict = iemMemFetchDataU64(pVCpu, &GCPhysVmxon, iEffSeg, GCPtrVmxon); 1537 1542 if (RT_UNLIKELY(rcStrict != VINF_SUCCESS)) 1538 1543 { … … 1625 1630 else if (IEM_IS_VMX_NON_ROOT_MODE(pVCpu)) 1626 1631 { 1627 RT_NOREF( GCPtrDisp);1632 RT_NOREF(pExitInfo); 1628 1633 /** @todo NSTVMX: intercept. */ 1629 1634 } … … 1651 1656 * Implements 'VMXON'. 1652 1657 */ 1653 IEM_CIMPL_DEF_1(iemCImpl_vmxon, RTGCPTR, GCPtrVmxon) 1654 { 1655 RTGCPTR GCPtrDisp; 1656 VMXEXITINSTRINFO ExitInstrInfo; 1657 ExitInstrInfo.u = iemVmxGetExitInstrInfo(pVCpu, VMX_EXIT_VMXON, VMX_INSTR_ID_NONE, &GCPtrDisp); 1658 return iemVmxVmxon(pVCpu, cbInstr, GCPtrVmxon, &ExitInstrInfo, GCPtrDisp); 1658 IEM_CIMPL_DEF_2(iemCImpl_vmxon, uint8_t, iEffSeg, RTGCPTR, GCPtrVmxon) 1659 { 1660 return iemVmxVmxon(pVCpu, cbInstr, iEffSeg, GCPtrVmxon, NULL /* pExitInfo */); 1659 1661 } 1660 1662 … … 1725 1727 * Implements 'VMPTRLD'. 1726 1728 */ 1727 IEM_CIMPL_DEF_1(iemCImpl_vmptrld, RTGCPTR, GCPtrVmcs) 1728 { 1729 RTGCPTR GCPtrDisp; 1730 VMXEXITINSTRINFO ExitInstrInfo; 1731 ExitInstrInfo.u = iemVmxGetExitInstrInfo(pVCpu, VMX_EXIT_VMPTRLD, VMX_INSTR_ID_NONE, &GCPtrDisp); 1732 return iemVmxVmptrld(pVCpu, cbInstr, GCPtrVmcs, &ExitInstrInfo, GCPtrDisp); 1729 IEM_CIMPL_DEF_2(iemCImpl_vmptrld, uint8_t, iEffSeg, RTGCPTR, GCPtrVmcs) 1730 { 1731 return iemVmxVmptrld(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, NULL /* pExitInfo */); 1733 1732 } 1734 1733 … … 1737 1736 * Implements 'VMPTRST'. 1738 1737 */ 1739 IEM_CIMPL_DEF_1(iemCImpl_vmptrst, RTGCPTR, GCPtrVmcs) 1740 { 1741 RTGCPTR GCPtrDisp; 1742 VMXEXITINSTRINFO ExitInstrInfo; 1743 ExitInstrInfo.u = iemVmxGetExitInstrInfo(pVCpu, VMX_EXIT_VMPTRST, VMX_INSTR_ID_NONE, &GCPtrDisp); 1744 return iemVmxVmptrst(pVCpu, cbInstr, GCPtrVmcs, &ExitInstrInfo, GCPtrDisp); 1738 IEM_CIMPL_DEF_2(iemCImpl_vmptrst, uint8_t, iEffSeg, RTGCPTR, GCPtrVmcs) 1739 { 1740 return iemVmxVmptrst(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, NULL /* pExitInfo */); 1745 1741 } 1746 1742 … … 1749 1745 * Implements 'VMCLEAR'. 1750 1746 */ 1751 IEM_CIMPL_DEF_1(iemCImpl_vmclear, RTGCPTR, GCPtrVmcs) 1752 { 1753 RTGCPTR GCPtrDisp; 1754 VMXEXITINSTRINFO ExitInstrInfo; 1755 ExitInstrInfo.u = iemVmxGetExitInstrInfo(pVCpu, VMX_EXIT_VMCLEAR, VMX_INSTR_ID_NONE, &GCPtrDisp); 1756 return iemVmxVmclear(pVCpu, cbInstr, GCPtrVmcs, &ExitInstrInfo, GCPtrDisp); 1747 IEM_CIMPL_DEF_2(iemCImpl_vmclear, uint8_t, iEffSeg, RTGCPTR, GCPtrVmcs) 1748 { 1749 return iemVmxVmclear(pVCpu, cbInstr, iEffSeg, GCPtrVmcs, NULL /* pExitInfo */); 1757 1750 } 1758 1751 … … 1761 1754 * Implements 'VMWRITE' register. 1762 1755 */ 1763 IEM_CIMPL_DEF_2(iemCImpl_vmwrite_reg, uint32_t, u32VmcsFieldEnc, uint64_t, u64Val) 1764 { 1765 VMXEXITINSTRINFO ExitInstrInfo; 1766 ExitInstrInfo.u = iemVmxGetExitInstrInfo(pVCpu, VMX_EXIT_VMWRITE, VMX_INSTR_ID_NONE, NULL /* pGCPtrDisp */); 1767 return iemVmxVmwrite(pVCpu, cbInstr, u32VmcsFieldEnc, u64Val, &ExitInstrInfo, 0 /* GCPtrDisp */); 1756 IEM_CIMPL_DEF_2(iemCImpl_vmwrite_reg, uint64_t, u64Val, uint32_t, uFieldEnc) 1757 { 1758 return iemVmxVmwrite(pVCpu, cbInstr, UINT8_MAX /*iEffSeg*/, IEMMODE_64BIT /* N/A */, u64Val, uFieldEnc, NULL /* pExitInfo */); 1768 1759 } 1769 1760 … … 1772 1763 * Implements 'VMWRITE' memory. 1773 1764 */ 1774 IEM_CIMPL_DEF_2(iemCImpl_vmwrite_mem, uint32_t, u32VmcsFieldEnc, RTGCUINTPTR64, GCPtrVal) 1775 { 1776 RTGCPTR GCPtrDisp; 1777 VMXEXITINSTRINFO ExitInstrInfo; 1778 ExitInstrInfo.u = iemVmxGetExitInstrInfo(pVCpu, VMX_EXIT_VMWRITE, VMX_INSTR_ID_NONE, &GCPtrDisp); 1779 return iemVmxVmwrite(pVCpu, cbInstr, u32VmcsFieldEnc, GCPtrVal, &ExitInstrInfo, GCPtrDisp); 1765 IEM_CIMPL_DEF_4(iemCImpl_vmwrite_mem, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrVal, uint32_t, uFieldEnc) 1766 { 1767 return iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, GCPtrVal, uFieldEnc, NULL /* pExitInfo */); 1780 1768 } 1781 1769 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r73937 r73959 4304 4304 { 4305 4305 IEM_MC_BEGIN(2, 0); 4306 IEM_MC_ARG(uint64_t, u64Enc, 0); 4307 IEM_MC_ARG(uint64_t, u64Val, 1); 4306 IEM_MC_ARG(uint64_t, u64Val, 0); 4307 IEM_MC_ARG(uint64_t, u64Enc, 1); 4308 IEM_MC_FETCH_GREG_U64(u64Val, (bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB); 4308 4309 IEM_MC_FETCH_GREG_U64(u64Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4309 IEM_MC_FETCH_GREG_U64(u64Val, (bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB); 4310 IEM_MC_CALL_CIMPL_2(iemCImpl_vmwrite_reg, u64Enc, u64Val); 4310 IEM_MC_CALL_CIMPL_2(iemCImpl_vmwrite_reg, u64Val, u64Enc); 4311 4311 IEM_MC_END(); 4312 4312 } … … 4314 4314 { 4315 4315 IEM_MC_BEGIN(2, 0); 4316 IEM_MC_ARG(uint32_t, u32Enc, 0); 4317 IEM_MC_ARG(uint32_t, u32Val, 1); 4316 IEM_MC_ARG(uint32_t, u32Val, 0); 4317 IEM_MC_ARG(uint32_t, u32Enc, 1); 4318 IEM_MC_FETCH_GREG_U32(u32Val, (bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB); 4318 4319 IEM_MC_FETCH_GREG_U32(u32Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4319 IEM_MC_FETCH_GREG_U32(u32Val, (bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB); 4320 IEM_MC_CALL_CIMPL_2(iemCImpl_vmwrite_reg, u32Enc, u32Val); 4320 IEM_MC_CALL_CIMPL_2(iemCImpl_vmwrite_reg, u32Val, u32Enc); 4321 4321 IEM_MC_END(); 4322 4322 } … … 4329 4329 if (enmEffOpSize == IEMMODE_64BIT) 4330 4330 { 4331 IEM_MC_BEGIN(2, 0); 4332 IEM_MC_ARG(uint64_t, u64Enc, 0); 4333 IEM_MC_ARG(RTGCPTR, GCPtrVal, 1); 4331 IEM_MC_BEGIN(4, 0); 4332 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4333 IEM_MC_ARG_CONST(IEMMODE, enmEffAddrMode,/*=*/pVCpu->iem.s.enmEffAddrMode, 1); 4334 IEM_MC_ARG(RTGCPTR, GCPtrVal, 2); 4335 IEM_MC_ARG(uint64_t, u64Enc, 3); 4334 4336 IEM_MC_CALC_RM_EFF_ADDR(GCPtrVal, bRm, 0); 4335 4337 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 4336 4338 IEM_MC_FETCH_GREG_U64(u64Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4337 IEM_MC_CALL_CIMPL_2(iemCImpl_vmwrite_mem, u64Enc, GCPtrVal); 4339 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 4340 IEM_MC_CALL_CIMPL_4(iemCImpl_vmwrite_mem, iEffSeg, enmEffAddrMode, GCPtrVal, u64Enc); 4338 4341 IEM_MC_END(); 4339 4342 } 4340 4343 else 4341 4344 { 4342 IEM_MC_BEGIN(2, 0); 4343 IEM_MC_ARG(uint32_t, u32Enc, 0); 4344 IEM_MC_ARG(RTGCPTR, GCPtrVal, 1); 4345 IEM_MC_BEGIN(4, 0); 4346 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4347 IEM_MC_ARG_CONST(IEMMODE, enmEffAddrMode,/*=*/pVCpu->iem.s.enmEffAddrMode, 1); 4348 IEM_MC_ARG(RTGCPTR, GCPtrVal, 2); 4349 IEM_MC_ARG(uint32_t, u32Enc, 3); 4345 4350 IEM_MC_CALC_RM_EFF_ADDR(GCPtrVal, bRm, 0); 4346 4351 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 4347 4352 IEM_MC_FETCH_GREG_U32(u32Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4348 IEM_MC_CALL_CIMPL_2(iemCImpl_vmwrite_mem, u32Enc, GCPtrVal); 4353 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 4354 IEM_MC_CALL_CIMPL_4(iemCImpl_vmwrite_mem, iEffSeg, enmEffAddrMode, GCPtrVal, u32Enc); 4349 4355 IEM_MC_END(); 4350 4356 } … … 8501 8507 IEMOP_HLP_IN_VMX_OPERATION(); 8502 8508 IEMOP_HLP_VMX_INSTR(); 8503 IEM_MC_BEGIN(1, 0); 8504 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 0); 8509 IEM_MC_BEGIN(2, 0); 8510 IEM_MC_ARG(uint8_t, iEffSeg, 0); 8511 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 1); 8505 8512 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 8506 8513 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 8507 IEM_MC_CALL_CIMPL_1(iemCImpl_vmptrld, GCPtrEffSrc); 8514 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 8515 IEM_MC_CALL_CIMPL_2(iemCImpl_vmptrld, iEffSeg, GCPtrEffSrc); 8508 8516 IEM_MC_END(); 8509 8517 return VINF_SUCCESS; … … 8520 8528 IEMOP_HLP_IN_VMX_OPERATION(); 8521 8529 IEMOP_HLP_VMX_INSTR(); 8522 IEM_MC_BEGIN(1, 0); 8523 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 0); 8530 IEM_MC_BEGIN(2, 0); 8531 IEM_MC_ARG(uint8_t, iEffSeg, 0); 8532 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 1); 8524 8533 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 8525 8534 IEMOP_HLP_DONE_DECODING(); 8526 IEM_MC_CALL_CIMPL_1(iemCImpl_vmclear, GCPtrEffDst); 8535 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 8536 IEM_MC_CALL_CIMPL_2(iemCImpl_vmclear, iEffSeg, GCPtrEffDst); 8527 8537 IEM_MC_END(); 8528 8538 return VINF_SUCCESS; … … 8538 8548 IEMOP_MNEMONIC(vmxon, "vmxon"); 8539 8549 IEMOP_HLP_VMX_INSTR(); 8540 IEM_MC_BEGIN(1, 0); 8541 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 0); 8550 IEM_MC_BEGIN(2, 0); 8551 IEM_MC_ARG(uint8_t, iEffSeg, 0); 8552 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 1); 8542 8553 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 8543 8554 IEMOP_HLP_DONE_DECODING(); 8544 IEM_MC_CALL_CIMPL_1(iemCImpl_vmxon, GCPtrEffSrc); 8555 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 8556 IEM_MC_CALL_CIMPL_2(iemCImpl_vmxon, iEffSeg, GCPtrEffSrc); 8545 8557 IEM_MC_END(); 8546 8558 return VINF_SUCCESS; … … 8557 8569 IEMOP_HLP_IN_VMX_OPERATION(); 8558 8570 IEMOP_HLP_VMX_INSTR(); 8559 IEM_MC_BEGIN(1, 0); 8560 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 0); 8571 IEM_MC_BEGIN(2, 0); 8572 IEM_MC_ARG(uint8_t, iEffSeg, 0); 8573 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 1); 8561 8574 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 8562 8575 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 8563 IEM_MC_CALL_CIMPL_1(iemCImpl_vmptrst, GCPtrEffDst); 8576 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 8577 IEM_MC_CALL_CIMPL_2(iemCImpl_vmptrst, iEffSeg, GCPtrEffDst); 8564 8578 IEM_MC_END(); 8565 8579 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r73943 r73959 13498 13498 } 13499 13499 13500 rcStrict = IEMExecDecodedVmxon(pVCpu, pVmxTransient->cbInstr, GCPtrVmxon, pExitInstrInfo->u, GCPtrDisp); 13500 VMXVEXITINFO ExitInfo; 13501 RT_ZERO(ExitInfo); 13502 ExitInfo.ExitInstrInfo.u = pExitInstrInfo->u; 13503 ExitInfo.u64ExitQual = GCPtrDisp; 13504 uint8_t const iEffSeg = pExitInstrInfo->VmreadVmwrite.iSegReg; 13505 rcStrict = IEMExecDecodedVmxon(pVCpu, pVmxTransient->cbInstr, iEffSeg, GCPtrVmxon, &ExitInfo); 13501 13506 if (RT_LIKELY(rcStrict == VINF_SUCCESS)) 13502 13507 ASMAtomicUoOrU64(&pVCpu->hm.s.fCtxChanged, HM_CHANGED_GUEST_RIP | HM_CHANGED_GUEST_RFLAGS | HM_CHANGED_GUEST_HWVIRT);
Note:
See TracChangeset
for help on using the changeset viewer.