Changeset 78638 in vbox for trunk/src/VBox
- Timestamp:
- May 21, 2019 4:15:58 PM (6 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r78592 r78638 15934 15934 * @returns Strict VBox status code. 15935 15935 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15936 * @param pExitInfo Pointer to the VM-exit information struct.15936 * @param pExitInfo Pointer to the VM-exit information. 15937 15937 * @thread EMT(pVCpu) 15938 15938 */ … … 15954 15954 * @returns Strict VBox status code. 15955 15955 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15956 * @param pExitInfo The VM-exit reason.15956 * @param pExitInfo Pointer to the VM-exit information. 15957 15957 * @param cbInstr The instruction length in bytes. 15958 15958 * @thread EMT(pVCpu) … … 15968 15968 15969 15969 /** 15970 * Interface for HM and EM to emulate the VMREAD instruction.15970 * Interface for HM and EM to emulate a VM-exit due to a task switch. 15971 15971 * 15972 15972 * @returns Strict VBox status code. 15973 15973 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15974 * @param pExitInfo Pointer to the VM-exit information struct. 15974 * @param pExitInfo Pointer to the VM-exit information. 15975 * @param pExitEventInfo Pointer to the VM-exit event information. 15976 * @thread EMT(pVCpu) 15977 */ 15978 VMM_INT_DECL(VBOXSTRICTRC) IEMExecVmxVmexitTaskSwitch(PVMCPU pVCpu, PVMXVEXITINFO pExitInfo, PVMXVEXITEVENTINFO pExitEventInfo) 15979 { 15980 VBOXSTRICTRC rcStrict = iemVmxVmexitTaskSwitchWithInfo(pVCpu, pExitInfo, pExitEventInfo); 15981 if (pVCpu->iem.s.cActiveMappings) 15982 iemMemRollback(pVCpu); 15983 return iemExecStatusCodeFiddling(pVCpu, rcStrict); 15984 } 15985 15986 15987 /** 15988 * Interface for HM and EM to emulate the VMREAD instruction. 15989 * 15990 * @returns Strict VBox status code. 15991 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 15992 * @param pExitInfo Pointer to the VM-exit information. 15975 15993 * @thread EMT(pVCpu) 15976 15994 */ … … 16018 16036 * @returns Strict VBox status code. 16019 16037 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 16020 * @param pExitInfo Pointer to the VM-exit information struct.16038 * @param pExitInfo Pointer to the VM-exit information. 16021 16039 * @thread EMT(pVCpu) 16022 16040 */ … … 16056 16074 * @returns Strict VBox status code. 16057 16075 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 16058 * @param pExitInfo Pointer to the VM-exit information struct.16076 * @param pExitInfo Pointer to the VM-exit information. 16059 16077 * @thread EMT(pVCpu) 16060 16078 */ … … 16081 16099 * @returns Strict VBox status code. 16082 16100 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 16083 * @param pExitInfo Pointer to the VM-exit information struct.16101 * @param pExitInfo Pointer to the VM-exit information. 16084 16102 * @thread EMT(pVCpu) 16085 16103 */ … … 16106 16124 * @returns Strict VBox status code. 16107 16125 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 16108 * @param pExitInfo Pointer to the VM-exit information struct.16126 * @param pExitInfo Pointer to the VM-exit information. 16109 16127 * @thread EMT(pVCpu) 16110 16128 */ … … 16153 16171 * @returns Strict VBox status code. 16154 16172 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 16155 * @param pExitInfo Pointer to the VM-exit information struct.16173 * @param pExitInfo Pointer to the VM-exit information. 16156 16174 * @thread EMT(pVCpu) 16157 16175 */ … … 16198 16216 * @returns Strict VBox status code. 16199 16217 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 16200 * @param pExitInfo Pointer to the VM-exit information struct.16218 * @param pExitInfo Pointer to the VM-exit information. 16201 16219 * @thread EMT(pVCpu) 16202 16220 */ -
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r78621 r78638 2791 2791 bool const fInEventDelivery = IEMGetCurrentXcpt(pVCpu, &uVector, &fFlags, &uErrCode, NULL /* uCr2 */); 2792 2792 if (!fInEventDelivery) 2793 { 2793 2794 iemVmxVmcsSetIdtVectoringInfo(pVCpu, 0); 2795 iemVmxVmcsSetIdtVectoringErrCode(pVCpu, 0); /* Not strictly needed but do it for consistency. */ 2796 } 2794 2797 /* else: Caller would have updated IDT-vectoring information already, see iemVmxVmexitEvent(). */ 2795 2798 } … … 2900 2903 * @returns Strict VBox status code. 2901 2904 * @param pVCpu The cross context virtual CPU structure. 2902 * @param pExitInfo Pointer to the VM-exit in struction information struct.2905 * @param pExitInfo Pointer to the VM-exit information. 2903 2906 */ 2904 2907 IEM_STATIC VBOXSTRICTRC iemVmxVmexitInstrWithInfo(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo) … … 3739 3742 iemVmxVmcsSetExitQual(pVCpu, uExitQual); 3740 3743 iemVmxVmcsSetExitInstrLen(pVCpu, cbInstr); 3744 return iemVmxVmexit(pVCpu, VMX_EXIT_TASK_SWITCH); 3745 } 3746 3747 3748 /** 3749 * VMX VM-exit handler for VM-exits due to task switches. 3750 * 3751 * This is intended for task switches where the caller provides all the relevant 3752 * VM-exit information. 3753 * 3754 * @returns VBox strict status code. 3755 * @param pVCpu The cross context virtual CPU structure. 3756 * @param pExitInfo Pointer to the VM-exit information. 3757 * @param pExitEventInfo Pointer to the VM-exit event information. 3758 */ 3759 IEM_STATIC VBOXSTRICTRC iemVmxVmexitTaskSwitchWithInfo(PVMCPU pVCpu, PVMXVEXITINFO pExitInfo, PVMXVEXITEVENTINFO pExitEventInfo) 3760 { 3761 Assert(pExitInfo); 3762 Assert(pExitEventInfo); 3763 3764 /* The VM-exit qualification is mandatory for all task-switch VM-exits. */ 3765 uint64_t const u64ExitQual = pExitInfo->u64Qual; 3766 iemVmxVmcsSetExitQual(pVCpu, u64ExitQual); 3767 3768 /* 3769 * Figure out if an instruction was the source of the task switch. 3770 * 3771 * If the task-switch was due to CALL/IRET/JMP instruction or due to the delivery 3772 * of an event generated by a software interrupt (INT-N), privileged software 3773 * interrupt (INT1/ICEBP) or software exception (INT3/INTO) then the CPU provides 3774 * the instruction length. 3775 */ 3776 bool fHasInstrLen; 3777 if (VMX_EXIT_QUAL_TASK_SWITCH_TYPE(u64ExitQual) == VMX_EXIT_QUAL_TASK_SWITCH_TYPE_IDT) 3778 { 3779 /* Check if an event delivery through IDT caused a task switch VM-exit. */ 3780 uint32_t const uIdtVectInfo = pExitEventInfo->uIdtVectoringInfo; 3781 bool const fIdtVectInfoValid = VMX_IDT_VECTORING_INFO_IS_VALID(uIdtVectInfo); 3782 if (fIdtVectInfoValid) 3783 { 3784 iemVmxVmcsSetIdtVectoringInfo(pVCpu, uIdtVectInfo); 3785 if (VMX_IDT_VECTORING_INFO_IS_ERROR_CODE_VALID(uIdtVectInfo)) 3786 iemVmxVmcsSetIdtVectoringErrCode(pVCpu, pExitEventInfo->uIdtVectoringErrCode); 3787 3788 uint8_t const fIdtVectType = VMX_IDT_VECTORING_INFO_TYPE(uIdtVectInfo); 3789 if ( fIdtVectType == VMX_IDT_VECTORING_INFO_TYPE_SW_INT 3790 || fIdtVectType == VMX_IDT_VECTORING_INFO_TYPE_PRIV_SW_XCPT 3791 || fIdtVectType == VMX_IDT_VECTORING_INFO_TYPE_SW_XCPT) 3792 fHasInstrLen = true; 3793 else 3794 fHasInstrLen = false; 3795 } 3796 else 3797 fHasInstrLen = false; 3798 } 3799 else 3800 { 3801 /* CALL, IRET or JMP instruction caused the task switch VM-exit. */ 3802 fHasInstrLen = true; 3803 } 3804 3805 if (fHasInstrLen) 3806 { 3807 Assert(pExitInfo->cbInstr > 0); 3808 iemVmxVmcsSetExitInstrLen(pVCpu, pExitInfo->cbInstr); 3809 } 3741 3810 return iemVmxVmexit(pVCpu, VMX_EXIT_TASK_SWITCH); 3742 3811 } … … 7802 7871 * VINF_SUCCESS is returned). 7803 7872 * @param u64FieldEnc The VMCS field encoding. 7804 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can7805 * beNULL.7873 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 7874 * NULL. 7806 7875 */ 7807 7876 IEM_STATIC VBOXSTRICTRC iemVmxVmreadCommon(PVMCPU pVCpu, uint8_t cbInstr, uint64_t *pu64Dst, uint64_t u64FieldEnc, … … 7916 7985 * @param pu64Dst Where to store the VMCS field's value. 7917 7986 * @param u64FieldEnc The VMCS field encoding. 7918 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can7919 * beNULL.7987 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 7988 * NULL. 7920 7989 */ 7921 7990 IEM_STATIC VBOXSTRICTRC iemVmxVmreadReg64(PVMCPU pVCpu, uint8_t cbInstr, uint64_t *pu64Dst, uint64_t u64FieldEnc, … … 7942 8011 * @param pu32Dst Where to store the VMCS field's value. 7943 8012 * @param u32FieldEnc The VMCS field encoding. 7944 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can7945 * beNULL.8013 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8014 * NULL. 7946 8015 */ 7947 8016 IEM_STATIC VBOXSTRICTRC iemVmxVmreadReg32(PVMCPU pVCpu, uint8_t cbInstr, uint32_t *pu32Dst, uint64_t u32FieldEnc, … … 7973 8042 * value. 7974 8043 * @param u64FieldEnc The VMCS field encoding. 7975 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can7976 * beNULL.8044 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8045 * NULL. 7977 8046 */ 7978 8047 IEM_STATIC VBOXSTRICTRC iemVmxVmreadMem(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, RTGCPTR GCPtrDst, uint64_t u64FieldEnc, … … 8018 8087 * operand. 8019 8088 * @param u64FieldEnc The VMCS field encoding. 8020 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can8021 * beNULL.8089 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8090 * NULL. 8022 8091 */ 8023 8092 IEM_STATIC VBOXSTRICTRC iemVmxVmwrite(PVMCPU pVCpu, uint8_t cbInstr, uint8_t iEffSeg, uint64_t u64Val, uint64_t u64FieldEnc, … … 8170 8239 * @param iEffSeg The effective segment register to use with @a GCPtrVmcs. 8171 8240 * @param GCPtrVmcs The linear address of the VMCS pointer. 8172 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can8173 * beNULL.8241 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8242 * NULL. 8174 8243 * 8175 8244 * @remarks Common VMX instruction checks are already expected to by the caller, … … 8301 8370 * @param GCPtrVmcs The linear address of where to store the current VMCS 8302 8371 * pointer. 8303 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can8304 * beNULL.8372 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8373 * NULL. 8305 8374 * 8306 8375 * @remarks Common VMX instruction checks are already expected to by the caller, … … 8353 8422 * @param cbInstr The instruction length in bytes. 8354 8423 * @param GCPtrVmcs The linear address of the current VMCS pointer. 8355 * @param pExitInfo Pointer to the VM-exit information struct. Optional, can8356 * beNULL.8424 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8425 * NULL. 8357 8426 * 8358 8427 * @remarks Common VMX instruction checks are already expected to by the caller, … … 8534 8603 * @param GCPtrInvvpidDesc The address of invvpid descriptor. 8535 8604 * @param u64InvvpidType The invalidation type. 8536 * @param pExitInfo Pointer to the VM-exit information struct. Optional,8537 * can beNULL.8605 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8606 * NULL. 8538 8607 * 8539 8608 * @remarks Common VMX instruction checks are already expected to by the caller, … … 8704 8773 * GCPtrVmxon. 8705 8774 * @param GCPtrVmxon The linear address of the VMXON pointer. 8706 * @param pExitInfo Pointer to the VM-exit in struction information struct.8707 * Optional, can beNULL.8775 * @param pExitInfo Pointer to the VM-exit information. Optional, can be 8776 * NULL. 8708 8777 * 8709 8778 * @remarks Common VMX instruction checks are already expected to by the caller,
Note:
See TracChangeset
for help on using the changeset viewer.