- Timestamp:
- May 23, 2017 6:35:38 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r66987 r67024 5927 5927 uExitVectorType), VERR_VMX_IPE_5); 5928 5928 enmRaise = IEMEvaluateRecursiveXcpt(pVCpu, fIdtVectorFlags, uIdtVector, fExitVectorFlags, uExitVector, &fRaiseInfo); 5929 5930 /* Determine a vectoring #PF condition, see comment in hmR0VmxExitXcptPF(). */ 5931 if (fRaiseInfo & (IEMXCPTRAISEINFO_EXT_INT_PF | IEMXCPTRAISEINFO_NMI_PF)) 5932 { 5933 pVmxTransient->fVectoringPF = true; 5934 enmRaise = IEMXCPTRAISE_PREV_EVENT; 5935 } 5929 5936 } 5930 5937 else … … 5962 5969 { 5963 5970 case IEMXCPTRAISE_CURRENT_XCPT: 5971 { 5972 Log4(("IDT: vcpu[%RU32] Pending secondary xcpt: uIdtVectoringInfo=%#RX64 uExitIntInfo=%#RX64\n", pVCpu->idCpu, 5973 pVmxTransient->uIdtVectoringInfo, pVmxTransient->uExitIntInfo)); 5974 Assert(rcStrict == VINF_SUCCESS); 5975 break; 5976 } 5977 5964 5978 case IEMXCPTRAISE_PREV_EVENT: 5965 5979 { 5966 /* Determine a vectoring #PF condition, see comment in hmR0VmxExitXcptPF(). */5967 if (fRaiseInfo & (IEMXCPTRAISEINFO_EXT_INT_PF | IEMXCPTRAISEINFO_NMI_PF))5968 pVmxTransient->fVectoringPF = true;5969 5970 5980 uint32_t u32ErrCode; 5971 5981 if (VMX_IDT_VECTORING_INFO_ERROR_CODE_IS_VALID(pVmxTransient->uIdtVectoringInfo)) … … 11571 11581 case VMX_EXIT_INTERRUPTION_INFO_TYPE_HW_XCPT: 11572 11582 { 11583 #if 0 11573 11584 /* 11574 11585 * If there's any exception caused as a result of event injection, go back to … … 11588 11599 break; 11589 11600 } 11601 #endif 11590 11602 11591 11603 switch (uVector) … … 12901 12913 if (VMX_IDT_VECTORING_INFO_VALID(pVmxTransient->uIdtVectoringInfo)) 12902 12914 { 12903 uint32_t uIntType = VMX_IDT_VECTORING_INFO_TYPE(pVmxTransient->uIdtVectoringInfo); 12904 12905 uint32_t uVector = VMX_IDT_VECTORING_INFO_VECTOR(pVmxTransient->uIdtVectoringInfo); 12906 bool fErrorCodeValid = VMX_IDT_VECTORING_INFO_ERROR_CODE_IS_VALID(pVmxTransient->uIdtVectoringInfo); 12907 12908 /* Save it as a pending event and it'll be converted to a TRPM event on the way out to ring-3. */ 12909 Assert(!pVCpu->hm.s.Event.fPending); 12910 pVCpu->hm.s.Event.fPending = true; 12911 pVCpu->hm.s.Event.u64IntInfo = pVmxTransient->uIdtVectoringInfo; 12912 rc = hmR0VmxReadIdtVectoringErrorCodeVmcs(pVmxTransient); 12913 AssertRCReturn(rc, rc); 12915 uint32_t uErrCode; 12916 RTGCUINTPTR GCPtrFaultAddress; 12917 uint32_t const uIntType = VMX_IDT_VECTORING_INFO_TYPE(pVmxTransient->uIdtVectoringInfo); 12918 uint32_t const uVector = VMX_IDT_VECTORING_INFO_VECTOR(pVmxTransient->uIdtVectoringInfo); 12919 bool const fErrorCodeValid = VMX_IDT_VECTORING_INFO_ERROR_CODE_IS_VALID(pVmxTransient->uIdtVectoringInfo); 12914 12920 if (fErrorCodeValid) 12915 pVCpu->hm.s.Event.u32ErrCode = pVmxTransient->uIdtVectoringErrorCode; 12921 { 12922 rc = hmR0VmxReadIdtVectoringErrorCodeVmcs(pVmxTransient); 12923 AssertRCReturn(rc, rc); 12924 uErrCode = pVmxTransient->uIdtVectoringErrorCode; 12925 } 12916 12926 else 12917 pVCpu->hm.s.Event.u32ErrCode = 0; 12927 uErrCode = 0; 12928 12918 12929 if ( uIntType == VMX_IDT_VECTORING_INFO_TYPE_HW_XCPT 12919 12930 && uVector == X86_XCPT_PF) 12920 { 12921 pVCpu->hm.s.Event.GCPtrFaultAddress = pMixedCtx->cr2; 12922 } 12931 GCPtrFaultAddress = pMixedCtx->cr2; 12932 else 12933 GCPtrFaultAddress = 0; 12934 12935 hmR0VmxSetPendingEvent(pVCpu, VMX_ENTRY_INT_INFO_FROM_EXIT_IDT_INFO(pVmxTransient->uIdtVectoringInfo), 12936 0 /* cbInstr */, uErrCode, GCPtrFaultAddress); 12923 12937 12924 12938 Log4(("Pending event on TaskSwitch uIntType=%#x uVector=%#x\n", uIntType, uVector)); … … 13851 13865 if (RT_LIKELY(!pVmxTransient->fVectoringDoublePF)) 13852 13866 { 13853 pMixedCtx->cr2 = pVmxTransient->uExitQualification; /* Update here in case we go back to ring-3 before injection. */13854 13867 hmR0VmxSetPendingEvent(pVCpu, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntInfo), 13855 13868 0 /* cbInstr */, pVmxTransient->uExitIntErrorCode, pVmxTransient->uExitQualification); … … 13915 13928 TRPMResetTrap(pVCpu); 13916 13929 pVCpu->hm.s.Event.fPending = false; /* In case it's a contributory #PF. */ 13917 pMixedCtx->cr2 = pVmxTransient->uExitQualification; /* Update here in case we go back to ring-3 before injection. */13918 13930 hmR0VmxSetPendingEvent(pVCpu, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntInfo), 13919 13931 0 /* cbInstr */, uGstErrorCode, pVmxTransient->uExitQualification);
Note:
See TracChangeset
for help on using the changeset viewer.