- Timestamp:
- May 20, 2019 10:07:18 AM (6 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r78525 r78592 15984 15984 15985 15985 VBOXSTRICTRC rcStrict; 15986 uint8_t const cbInstr = pExitInfo->cbInstr; 15987 uint32_t const uFieldEnc = iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg2); 15986 uint8_t const cbInstr = pExitInfo->cbInstr; 15987 bool const fIs64BitMode = RT_BOOL(pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT); 15988 uint64_t const u64FieldEnc = fIs64BitMode 15989 ? iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg2) 15990 : iemGRegFetchU32(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg2); 15988 15991 if (pExitInfo->InstrInfo.VmreadVmwrite.fIsRegOperand) 15989 15992 { 15990 if ( pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT)15993 if (fIs64BitMode) 15991 15994 { 15992 15995 uint64_t *pu64Dst = iemGRegRefU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg1); 15993 rcStrict = iemVmxVmreadReg64(pVCpu, cbInstr, pu64Dst, u FieldEnc, pExitInfo);15996 rcStrict = iemVmxVmreadReg64(pVCpu, cbInstr, pu64Dst, u64FieldEnc, pExitInfo); 15994 15997 } 15995 15998 else 15996 15999 { 15997 16000 uint32_t *pu32Dst = iemGRegRefU32(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg1); 15998 rcStrict = iemVmxVmreadReg32(pVCpu, cbInstr, pu32Dst, u FieldEnc, pExitInfo);16001 rcStrict = iemVmxVmreadReg32(pVCpu, cbInstr, pu32Dst, u64FieldEnc, pExitInfo); 15999 16002 } 16000 16003 } 16001 16004 else 16002 16005 { 16003 RTGCPTR GCPtrDst = pExitInfo->GCPtrEffAddr; 16004 uint8_t iEffSeg = pExitInfo->InstrInfo.VmreadVmwrite.iSegReg; 16005 IEMMODE enmEffAddrMode = (IEMMODE)pExitInfo->InstrInfo.VmreadVmwrite.u3AddrSize; 16006 rcStrict = iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, GCPtrDst, uFieldEnc, pExitInfo); 16006 RTGCPTR const GCPtrDst = pExitInfo->GCPtrEffAddr; 16007 uint8_t const iEffSeg = pExitInfo->InstrInfo.VmreadVmwrite.iSegReg; 16008 rcStrict = iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, GCPtrDst, u64FieldEnc, pExitInfo); 16007 16009 } 16008 16010 Assert(!pVCpu->iem.s.cActiveMappings); … … 16029 16031 uint64_t u64Val; 16030 16032 uint8_t iEffSeg; 16031 IEMMODE enmEffAddrMode;16032 16033 if (pExitInfo->InstrInfo.VmreadVmwrite.fIsRegOperand) 16033 16034 { 16034 u64Val = iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg1); 16035 iEffSeg = UINT8_MAX; 16036 enmEffAddrMode = UINT8_MAX; 16035 u64Val = iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg1); 16036 iEffSeg = UINT8_MAX; 16037 16037 } 16038 16038 else 16039 16039 { 16040 u64Val = pExitInfo->GCPtrEffAddr; 16041 iEffSeg = pExitInfo->InstrInfo.VmreadVmwrite.iSegReg; 16042 enmEffAddrMode = (IEMMODE)pExitInfo->InstrInfo.VmreadVmwrite.u3AddrSize; 16043 } 16044 uint8_t const cbInstr = pExitInfo->cbInstr; 16045 uint32_t const uFieldEnc = iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg2); 16046 VBOXSTRICTRC rcStrict = iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, enmEffAddrMode, u64Val, uFieldEnc, pExitInfo); 16040 u64Val = pExitInfo->GCPtrEffAddr; 16041 iEffSeg = pExitInfo->InstrInfo.VmreadVmwrite.iSegReg; 16042 } 16043 uint8_t const cbInstr = pExitInfo->cbInstr; 16044 uint64_t const u64FieldEnc = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT 16045 ? iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg2) 16046 : iemGRegFetchU32(pVCpu, pExitInfo->InstrInfo.VmreadVmwrite.iReg2); 16047 VBOXSTRICTRC rcStrict = iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, u64Val, u64FieldEnc, pExitInfo); 16047 16048 Assert(!pVCpu->iem.s.cActiveMappings); 16048 16049 return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict); … … 16211 16212 uint8_t const cbInstr = pExitInfo->cbInstr; 16212 16213 RTGCPTR const GCPtrInvvpidDesc = pExitInfo->GCPtrEffAddr; 16213 uint64_t const u InvvpidType= pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT16214 uint64_t const u64InvvpidType = pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT 16214 16215 ? iemGRegFetchU64(pVCpu, pExitInfo->InstrInfo.Inv.iReg2) 16215 16216 : iemGRegFetchU32(pVCpu, pExitInfo->InstrInfo.Inv.iReg2); 16216 VBOXSTRICTRC rcStrict = iemVmxInvvpid(pVCpu, cbInstr, iEffSeg, GCPtrInvvpidDesc, u InvvpidType, pExitInfo);16217 VBOXSTRICTRC rcStrict = iemVmxInvvpid(pVCpu, cbInstr, iEffSeg, GCPtrInvvpidDesc, u64InvvpidType, pExitInfo); 16217 16218 Assert(!pVCpu->iem.s.cActiveMappings); 16218 16219 return iemUninitExecAndFiddleStatusAndMaybeReenter(pVCpu, rcStrict); -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r78525 r78592 1904 1904 IEM_VMX_VMEXIT_FAILED_RET(pVCpu, uExitReason, pszFailure, kVmxVDiag_Vmexit_MsrStoreCount); 1905 1905 1906 PVMXAUTOMSR pMsr = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pExitMsrStoreArea); 1906 /* 1907 * Optimization if the guest hypervisor is using the same guest-physical page for both 1908 * the VM-entry MSR-load area as well as the VM-exit MSR store area. 1909 */ 1910 PVMXAUTOMSR pMsrArea; 1911 RTGCPHYS const GCPhysVmEntryMsrLoadArea = pVmcs->u64AddrEntryMsrLoad.u; 1912 RTGCPHYS const GCPhysVmExitMsrStoreArea = pVmcs->u64AddrExitMsrStore.u; 1913 if (GCPhysVmEntryMsrLoadArea == GCPhysVmExitMsrStoreArea) 1914 pMsrArea = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pEntryMsrLoadArea); 1915 else 1916 { 1917 int rc = PGMPhysSimpleReadGCPhys(pVCpu->CTX_SUFF(pVM), (void *)pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pExitMsrStoreArea), 1918 GCPhysVmExitMsrStoreArea, cMsrs * sizeof(VMXAUTOMSR)); 1919 if (RT_SUCCESS(rc)) 1920 pMsrArea = pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pExitMsrStoreArea); 1921 else 1922 { 1923 AssertMsgFailed(("VM-exit: Failed to read MSR auto-store area at %#RGp, rc=%Rrc\n", GCPhysVmExitMsrStoreArea, rc)); 1924 IEM_VMX_VMEXIT_FAILED_RET(pVCpu, uExitReason, pszFailure, kVmxVDiag_Vmexit_MsrStorePtrReadPhys); 1925 } 1926 } 1927 1928 /* 1929 * Update VM-exit MSR store area. 1930 */ 1931 PVMXAUTOMSR pMsr = pMsrArea; 1907 1932 Assert(pMsr); 1908 1933 for (uint32_t idxMsr = 0; idxMsr < cMsrs; idxMsr++, pMsr++) … … 1936 1961 } 1937 1962 1938 RTGCPHYS const GCPhysVmExitMsrStoreArea = pVmcs->u64AddrExitMsrStore.u; 1939 int rc = PGMPhysSimpleWriteGCPhys(pVCpu->CTX_SUFF(pVM), GCPhysVmExitMsrStoreArea, 1940 pVCpu->cpum.GstCtx.hwvirt.vmx.CTX_SUFF(pExitMsrStoreArea), cMsrs * sizeof(VMXAUTOMSR)); 1963 /* 1964 * Commit the VM-exit MSR store are to guest memory. 1965 */ 1966 int rc = PGMPhysSimpleWriteGCPhys(pVCpu->CTX_SUFF(pVM), GCPhysVmExitMsrStoreArea, pMsrArea, cMsrs * sizeof(VMXAUTOMSR)); 1941 1967 if (RT_SUCCESS(rc)) 1942 { /* likely */ } 1943 else 1944 { 1945 AssertMsgFailed(("VM-exit: Failed to write MSR auto-store area at %#RGp, rc=%Rrc\n", GCPhysVmExitMsrStoreArea, rc)); 1946 IEM_VMX_VMEXIT_FAILED_RET(pVCpu, uExitReason, pszFailure, kVmxVDiag_Vmexit_MsrStorePtrWritePhys); 1947 } 1968 return VINF_SUCCESS; 1948 1969 1949 1970 NOREF(uExitReason); 1950 1971 NOREF(pszFailure); 1951 return VINF_SUCCESS; 1972 1973 AssertMsgFailed(("VM-exit: Failed to write MSR auto-store area at %#RGp, rc=%Rrc\n", GCPhysVmExitMsrStoreArea, rc)); 1974 IEM_VMX_VMEXIT_FAILED_RET(pVCpu, uExitReason, pszFailure, kVmxVDiag_Vmexit_MsrStorePtrWritePhys); 1952 1975 } 1953 1976 … … 2772 2795 } 2773 2796 2774 /* The following VMCS fields are unsupported since we don't injecting SMIs into a guest. */2797 /* The following VMCS fields should always be zero since we don't support injecting SMIs into a guest. */ 2775 2798 Assert(pVmcs->u64RoIoRcx.u == 0); 2776 2799 Assert(pVmcs->u64RoIoRsi.u == 0); … … 2864 2887 iemSetPassUpStatus(pVCpu, rcSched); 2865 2888 # endif 2866 return VINF_SUCCESS;2889 return rcStrict; 2867 2890 # endif 2868 2891 } … … 3982 4005 { 3983 4006 fIsHwXcpt = true; 4007 3984 4008 /* NMIs have a dedicated VM-execution control for causing VM-exits. */ 3985 4009 if (uVector == X86_XCPT_NMI) 3986 fIntercept = RT_BOOL(pVmcs->u32PinCtls & VMX_PIN_CTLS_NMI_EXIT); 4010 { 4011 if (pVmcs->u32PinCtls & VMX_PIN_CTLS_NMI_EXIT) 4012 fIntercept = true; 4013 } 3987 4014 else 3988 4015 { … … 3997 4024 } 3998 4025 3999 /* Consult the exception bitmap for all hardware exceptions (except NMI). */ 4026 /* Consult the exception bitmap for all other hardware exceptions. */ 4027 Assert(uVector <= X86_XCPT_LAST); 4000 4028 if (fXcptBitmap & RT_BIT(uVector)) 4001 4029 fIntercept = true; … … 7942 7970 * @param iEffSeg The effective segment register to use with @a u64Val. 7943 7971 * Pass UINT8_MAX if it is a register access. 7944 * @param enmEffAddrMode The effective addressing mode (only used with memory7945 * operand).7946 7972 * @param GCPtrDst The guest linear address to store the VMCS field's 7947 7973 * value. … … 7950 7976 * be NULL. 7951 7977 */ 7952 IEM_STATIC VBOXSTRICTRC iemVmxVmreadMem(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, IEMMODE enmEffAddrMode,7953 RTGCPTR GCPtrDst, uint64_t u64FieldEnc,PCVMXVEXITINFO pExitInfo)7978 IEM_STATIC VBOXSTRICTRC iemVmxVmreadMem(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPTR GCPtrDst, uint64_t u64FieldEnc, 7979 PCVMXVEXITINFO pExitInfo) 7954 7980 { 7955 7981 uint64_t u64Dst; … … 7959 7985 /* 7960 7986 * Write the VMCS field's value to the location specified in guest-memory. 7961 *7962 * The pointer size depends on the address size (address-size prefix allowed).7963 * The operand size depends on IA-32e mode (operand-size prefix not allowed).7964 7987 */ 7965 static uint64_t const s_auAddrSizeMasks[] = { UINT64_C(0xffff), UINT64_C(0xffffffff), UINT64_C(0xffffffffffffffff) };7966 Assert(enmEffAddrMode < RT_ELEMENTS(s_auAddrSizeMasks));7967 GCPtrDst &= s_auAddrSizeMasks[enmEffAddrMode];7968 7969 7988 if (pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT) 7970 7989 rcStrict = iemMemStoreDataU64(pVCpu, iEffSeg, GCPtrDst, u64Dst); … … 7995 8014 * @param iEffSeg The effective segment register to use with @a u64Val. 7996 8015 * Pass UINT8_MAX if it is a register access. 7997 * @param enmEffAddrMode The effective addressing mode (only used with memory7998 * operand).7999 8016 * @param u64Val The value to write (or guest linear address to the 8000 8017 * value), @a iEffSeg will indicate if it's a memory … … 8004 8021 * be NULL. 8005 8022 */ 8006 IEM_STATIC VBOXSTRICTRC iemVmxVmwrite(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, IEMMODE enmEffAddrMode, uint64_t u64Val,8007 uint64_t u64FieldEnc,PCVMXVEXITINFO pExitInfo)8023 IEM_STATIC VBOXSTRICTRC iemVmxVmwrite(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, uint64_t u64Val, uint64_t u64FieldEnc, 8024 PCVMXVEXITINFO pExitInfo) 8008 8025 { 8009 8026 /* Nested-guest intercept. */ … … 8056 8073 if (!fIsRegOperand) 8057 8074 { 8058 static uint64_t const s_auAddrSizeMasks[] = { UINT64_C(0xffff), UINT64_C(0xffffffff), UINT64_C(0xffffffffffffffff) };8059 Assert(enmEffAddrMode < RT_ELEMENTS(s_auAddrSizeMasks));8060 RTGCPTR const GCPtrVal = u64Val & s_auAddrSizeMasks[enmEffAddrMode];8061 8062 8075 /* Read the value from the specified guest memory location. */ 8063 VBOXSTRICTRC rcStrict; 8076 VBOXSTRICTRC rcStrict; 8077 RTGCPTR const GCPtrVal = u64Val; 8064 8078 if (pVCpu->iem.s.enmCpuMode == IEMMODE_64BIT) 8065 8079 rcStrict = iemMemFetchDataU64(pVCpu, &u64Val, iEffSeg, GCPtrVal); … … 8519 8533 * @param iEffSeg The segment of the invvpid descriptor. 8520 8534 * @param GCPtrInvvpidDesc The address of invvpid descriptor. 8521 * @param u InvvpidTypeThe invalidation type.8535 * @param u64InvvpidType The invalidation type. 8522 8536 * @param pExitInfo Pointer to the VM-exit information struct. Optional, 8523 8537 * can be NULL. … … 8527 8541 */ 8528 8542 IEM_STATIC VBOXSTRICTRC iemVmxInvvpid(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPTR GCPtrInvvpidDesc, 8529 uint64_t u InvvpidType, PCVMXVEXITINFO pExitInfo)8543 uint64_t u64InvvpidType, PCVMXVEXITINFO pExitInfo) 8530 8544 { 8531 8545 /* Check if INVVPID instruction is supported, otherwise raise #UD. */ … … 8551 8565 * Validate INVVPID invalidation type. 8552 8566 * 8553 * Each of the types have a supported bit in IA32_VMX_EPT_VPID_CAP MSR. 8554 * In theory, it's possible for a CPU to not support flushing individual addresses 8555 * but all the other types or any other combination. 8567 * The instruction specifies exactly ONE of the supported invalidation types. 8568 * 8569 * Each of the types has a bit in IA32_VMX_EPT_VPID_CAP MSR specifying if it is 8570 * supported. In theory, it's possible for a CPU to not support flushing individual 8571 * addresses but all the other types or any other combination. We do not take any 8572 * shortcuts here by assuming the types we currently expose to the guest. 8556 8573 */ 8557 8574 uint64_t const fCaps = pVCpu->cpum.GstCtx.hwvirt.vmx.Msrs.u64EptVpidCaps; … … 8560 8577 uint8_t const fTypeAllCtx = RT_BF_GET(fCaps, VMX_BF_EPT_VPID_CAP_INVVPID_ALL_CTX); 8561 8578 uint8_t const fTypeSingleCtxRetainGlobals = RT_BF_GET(fCaps, VMX_BF_EPT_VPID_CAP_INVVPID_SINGLE_CTX_RETAIN_GLOBALS); 8562 if ( (fTypeIndivAddr && u InvvpidType == VMXTLBFLUSHVPID_INDIV_ADDR)8563 || (fTypeSingleCtx && u InvvpidType == VMXTLBFLUSHVPID_SINGLE_CONTEXT)8564 || (fTypeAllCtx && u InvvpidType == VMXTLBFLUSHVPID_ALL_CONTEXTS)8565 || (fTypeSingleCtxRetainGlobals && u InvvpidType == VMXTLBFLUSHVPID_SINGLE_CONTEXT_RETAIN_GLOBALS))8579 if ( (fTypeIndivAddr && u64InvvpidType == VMXTLBFLUSHVPID_INDIV_ADDR) 8580 || (fTypeSingleCtx && u64InvvpidType == VMXTLBFLUSHVPID_SINGLE_CONTEXT) 8581 || (fTypeAllCtx && u64InvvpidType == VMXTLBFLUSHVPID_ALL_CONTEXTS) 8582 || (fTypeSingleCtxRetainGlobals && u64InvvpidType == VMXTLBFLUSHVPID_SINGLE_CONTEXT_RETAIN_GLOBALS)) 8566 8583 { /* likely */ } 8567 8584 else 8568 8585 { 8569 Log(("invvpid: invalid/un recognized invvpid type %#x -> VMFail\n", uInvvpidType));8586 Log(("invvpid: invalid/unsupported invvpid type %#x -> VMFail\n", u64InvvpidType)); 8570 8587 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Invvpid_TypeInvalid; 8571 8588 iemVmxVmFail(pVCpu, VMXINSTRERR_INVEPT_INVVPID_INVALID_OPERAND); … … 8597 8614 uint8_t const uVpid = uDesc.s.Lo & UINT64_C(0xfff); 8598 8615 uint64_t const uCr3 = pVCpu->cpum.GstCtx.cr3; 8599 switch (u InvvpidType)8616 switch (u64InvvpidType) 8600 8617 { 8601 8618 case VMXTLBFLUSHVPID_INDIV_ADDR: … … 8619 8636 else 8620 8637 { 8621 Log(("invvpid: invalid VPID %#x for invalidation type %u -> VMFail\n", uVpid, u InvvpidType));8638 Log(("invvpid: invalid VPID %#x for invalidation type %u -> VMFail\n", uVpid, u64InvvpidType)); 8622 8639 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Invvpid_Type0InvalidVpid; 8623 8640 iemVmxVmFail(pVCpu, VMXINSTRERR_INVEPT_INVVPID_INVALID_OPERAND); … … 8637 8654 else 8638 8655 { 8639 Log(("invvpid: invalid VPID %#x for invalidation type %u -> VMFail\n", uVpid, u InvvpidType));8656 Log(("invvpid: invalid VPID %#x for invalidation type %u -> VMFail\n", uVpid, u64InvvpidType)); 8640 8657 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Invvpid_Type1InvalidVpid; 8641 8658 iemVmxVmFail(pVCpu, VMXINSTRERR_INVEPT_INVVPID_INVALID_OPERAND); … … 8664 8681 else 8665 8682 { 8666 Log(("invvpid: invalid VPID %#x for invalidation type %u -> VMFail\n", uVpid, u InvvpidType));8683 Log(("invvpid: invalid VPID %#x for invalidation type %u -> VMFail\n", uVpid, u64InvvpidType)); 8667 8684 pVCpu->cpum.GstCtx.hwvirt.vmx.enmDiag = kVmxVDiag_Invvpid_Type3InvalidVpid; 8668 8685 iemVmxVmFail(pVCpu, VMXINSTRERR_INVEPT_INVVPID_INVALID_OPERAND); … … 9014 9031 IEM_CIMPL_DEF_2(iemCImpl_vmwrite_reg, uint64_t, u64Val, uint64_t, u64FieldEnc) 9015 9032 { 9016 return iemVmxVmwrite(pVCpu, cbInstr, UINT8_MAX /* iEffSeg */, IEMMODE_64BIT /* N/A */, u64Val, u64FieldEnc, 9017 NULL /* pExitInfo */); 9033 return iemVmxVmwrite(pVCpu, cbInstr, UINT8_MAX /* iEffSeg */, u64Val, u64FieldEnc, NULL /* pExitInfo */); 9018 9034 } 9019 9035 … … 9022 9038 * Implements 'VMWRITE' memory. 9023 9039 */ 9024 IEM_CIMPL_DEF_ 4(iemCImpl_vmwrite_mem, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrVal, uint32_t, u64FieldEnc)9025 { 9026 return iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, enmEffAddrMode,GCPtrVal, u64FieldEnc, NULL /* pExitInfo */);9040 IEM_CIMPL_DEF_3(iemCImpl_vmwrite_mem, uint8_t, iEffSeg, RTGCPTR, GCPtrVal, uint32_t, u64FieldEnc) 9041 { 9042 return iemVmxVmwrite(pVCpu, cbInstr, iEffSeg, GCPtrVal, u64FieldEnc, NULL /* pExitInfo */); 9027 9043 } 9028 9044 … … 9049 9065 * Implements 'VMREAD' memory, 64-bit register. 9050 9066 */ 9051 IEM_CIMPL_DEF_ 4(iemCImpl_vmread_mem_reg64, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrDst, uint32_t, u64FieldEnc)9052 { 9053 return iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, enmEffAddrMode,GCPtrDst, u64FieldEnc, NULL /* pExitInfo */);9067 IEM_CIMPL_DEF_3(iemCImpl_vmread_mem_reg64, uint8_t, iEffSeg, RTGCPTR, GCPtrDst, uint32_t, u64FieldEnc) 9068 { 9069 return iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, GCPtrDst, u64FieldEnc, NULL /* pExitInfo */); 9054 9070 } 9055 9071 … … 9058 9074 * Implements 'VMREAD' memory, 32-bit register. 9059 9075 */ 9060 IEM_CIMPL_DEF_ 4(iemCImpl_vmread_mem_reg32, uint8_t, iEffSeg, IEMMODE, enmEffAddrMode, RTGCPTR, GCPtrDst, uint32_t, u32FieldEnc)9061 { 9062 return iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, enmEffAddrMode,GCPtrDst, u32FieldEnc, NULL /* pExitInfo */);9076 IEM_CIMPL_DEF_3(iemCImpl_vmread_mem_reg32, uint8_t, iEffSeg, RTGCPTR, GCPtrDst, uint32_t, u32FieldEnc) 9077 { 9078 return iemVmxVmreadMem(pVCpu, cbInstr, iEffSeg, GCPtrDst, u32FieldEnc, NULL /* pExitInfo */); 9063 9079 } 9064 9080 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r76652 r78592 4347 4347 if (enmEffOpSize == IEMMODE_64BIT) 4348 4348 { 4349 IEM_MC_BEGIN( 4, 0);4349 IEM_MC_BEGIN(3, 0); 4350 4350 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4351 IEM_MC_ARG_CONST(IEMMODE, enmEffAddrMode,/*=*/pVCpu->iem.s.enmEffAddrMode, 1); 4352 IEM_MC_ARG(RTGCPTR, GCPtrVal, 2); 4353 IEM_MC_ARG(uint64_t, u64Enc, 3); 4351 IEM_MC_ARG(RTGCPTR, GCPtrVal, 1); 4352 IEM_MC_ARG(uint64_t, u64Enc, 2); 4354 4353 IEM_MC_CALC_RM_EFF_ADDR(GCPtrVal, bRm, 0); 4355 4354 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 4356 4355 IEM_MC_FETCH_GREG_U64(u64Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4357 4356 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 4358 IEM_MC_CALL_CIMPL_ 4(iemCImpl_vmread_mem_reg64, iEffSeg, enmEffAddrMode, GCPtrVal, u64Enc);4357 IEM_MC_CALL_CIMPL_3(iemCImpl_vmread_mem_reg64, iEffSeg, GCPtrVal, u64Enc); 4359 4358 IEM_MC_END(); 4360 4359 } 4361 4360 else 4362 4361 { 4363 IEM_MC_BEGIN( 4, 0);4362 IEM_MC_BEGIN(3, 0); 4364 4363 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4365 IEM_MC_ARG_CONST(IEMMODE, enmEffAddrMode,/*=*/pVCpu->iem.s.enmEffAddrMode, 1); 4366 IEM_MC_ARG(RTGCPTR, GCPtrVal, 2); 4367 IEM_MC_ARG(uint32_t, u32Enc, 3); 4364 IEM_MC_ARG(RTGCPTR, GCPtrVal, 1); 4365 IEM_MC_ARG(uint32_t, u32Enc, 2); 4368 4366 IEM_MC_CALC_RM_EFF_ADDR(GCPtrVal, bRm, 0); 4369 4367 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 4370 4368 IEM_MC_FETCH_GREG_U32(u32Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4371 4369 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 4372 IEM_MC_CALL_CIMPL_ 4(iemCImpl_vmread_mem_reg32, iEffSeg, enmEffAddrMode, GCPtrVal, u32Enc);4370 IEM_MC_CALL_CIMPL_3(iemCImpl_vmread_mem_reg32, iEffSeg, GCPtrVal, u32Enc); 4373 4371 IEM_MC_END(); 4374 4372 } … … 4429 4427 if (enmEffOpSize == IEMMODE_64BIT) 4430 4428 { 4431 IEM_MC_BEGIN( 4, 0);4429 IEM_MC_BEGIN(3, 0); 4432 4430 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4433 IEM_MC_ARG_CONST(IEMMODE, enmEffAddrMode,/*=*/pVCpu->iem.s.enmEffAddrMode, 1); 4434 IEM_MC_ARG(RTGCPTR, GCPtrVal, 2); 4435 IEM_MC_ARG(uint64_t, u64Enc, 3); 4431 IEM_MC_ARG(RTGCPTR, GCPtrVal, 1); 4432 IEM_MC_ARG(uint64_t, u64Enc, 2); 4436 4433 IEM_MC_CALC_RM_EFF_ADDR(GCPtrVal, bRm, 0); 4437 4434 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 4438 4435 IEM_MC_FETCH_GREG_U64(u64Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4439 4436 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 4440 IEM_MC_CALL_CIMPL_ 4(iemCImpl_vmwrite_mem, iEffSeg, enmEffAddrMode, GCPtrVal, u64Enc);4437 IEM_MC_CALL_CIMPL_3(iemCImpl_vmwrite_mem, iEffSeg, GCPtrVal, u64Enc); 4441 4438 IEM_MC_END(); 4442 4439 } 4443 4440 else 4444 4441 { 4445 IEM_MC_BEGIN( 4, 0);4442 IEM_MC_BEGIN(3, 0); 4446 4443 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4447 IEM_MC_ARG_CONST(IEMMODE, enmEffAddrMode,/*=*/pVCpu->iem.s.enmEffAddrMode, 1); 4448 IEM_MC_ARG(RTGCPTR, GCPtrVal, 2); 4449 IEM_MC_ARG(uint32_t, u32Enc, 3); 4444 IEM_MC_ARG(RTGCPTR, GCPtrVal, 1); 4445 IEM_MC_ARG(uint32_t, u32Enc, 2); 4450 4446 IEM_MC_CALC_RM_EFF_ADDR(GCPtrVal, bRm, 0); 4451 4447 IEMOP_HLP_DONE_DECODING_NO_SIZE_OP_REPZ_OR_REPNZ_PREFIXES(); 4452 4448 IEM_MC_FETCH_GREG_U32(u32Enc, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg); 4453 4449 IEM_MC_ASSIGN(iEffSeg, pVCpu->iem.s.iEffSeg); 4454 IEM_MC_CALL_CIMPL_ 4(iemCImpl_vmwrite_mem, iEffSeg, enmEffAddrMode, GCPtrVal, u32Enc);4450 IEM_MC_CALL_CIMPL_3(iemCImpl_vmwrite_mem, iEffSeg, GCPtrVal, u32Enc); 4455 4451 IEM_MC_END(); 4456 4452 }
Note:
See TracChangeset
for help on using the changeset viewer.