Changeset 46655 in vbox
- Timestamp:
- Jun 19, 2013 12:46:36 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/VBox/err.h (modified) (2 diffs)
-
src/VBox/VMM/VMMR0/HMVMXR0.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/err.h
r46508 r46655 1907 1907 /** Undefined VM exit code. */ 1908 1908 #define VERR_VMX_UNDEFINED_EXIT_CODE (-4019) 1909 /** Resume guest execution after injecting a double-fault. */1910 #define VINF_VMX_DOUBLE_FAULT 40201911 1909 /** VMPTRLD failed; possibly because of invalid VMCS launch-state. */ 1912 1910 #define VERR_VMX_VMPTRLD_FAILED (-4021) … … 1979 1977 /** Invalid HM64ON32OP value. */ 1980 1978 #define VERR_HM_INVALID_HM64ON32OP (-4116) 1979 /** Resume guest execution after injecting a double-fault. */ 1980 #define VINF_HM_DOUBLE_FAULT 4117 1981 1981 /** @} */ 1982 1982 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r46596 r46655 4750 4750 * @returns VBox status code (informational error codes included). 4751 4751 * @retval VINF_SUCCESS if we should continue handling the VM-exit. 4752 * @retval VINF_ VMX_DOUBLE_FAULT if a #DF condition was detected and we ought to4752 * @retval VINF_HM_DOUBLE_FAULT if a #DF condition was detected and we ought to 4753 4753 * continue execution of the guest which will delivery the #DF. 4754 4754 * @retval VINF_EM_RESET if we detected a triple-fault condition. … … 4785 4785 /* See Intel spec. 30.7.1.1 "Reflecting Exceptions to Guest Software". */ 4786 4786 VMXREFLECTXCPT enmReflect = VMXREFLECTXCPT_NONE; 4787 if (uIntType == VMX_IDT_VECTORING_INFO_TYPE_HW_XCPT) 4788 { 4789 enmReflect = VMXREFLECTXCPT_XCPT; 4787 if (VMX_EXIT_INTERRUPTION_INFO_IS_VALID(pVmxTransient->uExitIntrInfo)) 4788 { 4789 if (uIntType == VMX_IDT_VECTORING_INFO_TYPE_HW_XCPT) 4790 { 4791 enmReflect = VMXREFLECTXCPT_XCPT; 4790 4792 #ifdef VBOX_STRICT 4791 if ( hmR0VmxIsContributoryXcpt(uIdtVector) 4792 && uExitVector == X86_XCPT_PF) 4793 if ( hmR0VmxIsContributoryXcpt(uIdtVector) 4794 && uExitVector == X86_XCPT_PF) 4795 { 4796 Log4(("IDT: Contributory #PF uCR2=%#RX64\n", pMixedCtx->cr2)); 4797 } 4798 #endif 4799 if ( uExitVector == X86_XCPT_PF 4800 && uIdtVector == X86_XCPT_PF) 4801 { 4802 pVmxTransient->fVectoringPF = true; 4803 Log4(("IDT: Vectoring #PF uCR2=%#RX64\n", pMixedCtx->cr2)); 4804 } 4805 else if ( (pVCpu->hm.s.vmx.u32XcptBitmap & HMVMX_CONTRIBUTORY_XCPT_MASK) 4806 && hmR0VmxIsContributoryXcpt(uExitVector) 4807 && ( hmR0VmxIsContributoryXcpt(uIdtVector) 4808 || uIdtVector == X86_XCPT_PF)) 4809 { 4810 enmReflect = VMXREFLECTXCPT_DF; 4811 } 4812 else if (uIdtVector == X86_XCPT_DF) 4813 enmReflect = VMXREFLECTXCPT_TF; 4814 } 4815 else if ( uIntType != VMX_IDT_VECTORING_INFO_TYPE_SW_INT 4816 && uIntType != VMX_IDT_VECTORING_INFO_TYPE_SW_XCPT 4817 && uIntType != VMX_IDT_VECTORING_INFO_TYPE_PRIV_SW_XCPT) 4793 4818 { 4794 Log4(("IDT: Contributory #PF uCR2=%#RX64\n", pMixedCtx->cr2)); 4819 /* 4820 * Ignore software interrupts (INT n), software exceptions (#BP, #OF) and privileged software exception 4821 * (whatever they are) as they reoccur when restarting the instruction. 4822 */ 4823 enmReflect = VMXREFLECTXCPT_XCPT; 4795 4824 } 4796 #endif 4797 if ( uExitVector == X86_XCPT_PF 4798 && uIdtVector == X86_XCPT_PF) 4799 { 4800 pVmxTransient->fVectoringPF = true; 4801 Log4(("IDT: Vectoring #PF uCR2=%#RX64\n", pMixedCtx->cr2)); 4802 } 4803 else if ( (pVCpu->hm.s.vmx.u32XcptBitmap & HMVMX_CONTRIBUTORY_XCPT_MASK) 4804 && hmR0VmxIsContributoryXcpt(uExitVector) 4805 && ( hmR0VmxIsContributoryXcpt(uIdtVector) 4806 || uIdtVector == X86_XCPT_PF)) 4807 { 4808 enmReflect = VMXREFLECTXCPT_DF; 4809 } 4810 else if (uIdtVector == X86_XCPT_DF) 4811 enmReflect = VMXREFLECTXCPT_TF; 4812 } 4813 else if ( uIntType != VMX_IDT_VECTORING_INFO_TYPE_SW_INT 4814 && uIntType != VMX_IDT_VECTORING_INFO_TYPE_SW_XCPT 4815 && uIntType != VMX_IDT_VECTORING_INFO_TYPE_PRIV_SW_XCPT) 4825 } 4826 else 4816 4827 { 4817 4828 /* 4818 * Ignore software interrupts (INT n), software exceptions (#BP, #OF) and privileged software exception 4819 * (whatever they are) as they reoccur when restarting the instruction. 4829 * If event delivery caused an EPT violation/misconfig or APIC access VM-exit, then the VM-exit 4830 * interruption-information will not be valid and we end up here. In such cases, it is sufficient to reflect the 4831 * original exception to the guest after handling the VM-exit. 4820 4832 */ 4821 4833 enmReflect = VMXREFLECTXCPT_XCPT; … … 4839 4851 rc = VINF_SUCCESS; 4840 4852 Log4(("IDT: Pending vectoring event %#RX64 Err=%#RX32\n", pVCpu->hm.s.Event.u64IntrInfo, 4841 pVCpu->hm.s.Event.u32ErrCode));4853 pVCpu->hm.s.Event.u32ErrCode)); 4842 4854 break; 4843 4855 } … … 4846 4858 { 4847 4859 hmR0VmxSetPendingXcptDF(pVCpu, pMixedCtx); 4848 rc = VINF_ VMX_DOUBLE_FAULT;4860 rc = VINF_HM_DOUBLE_FAULT; 4849 4861 Log4(("IDT: Pending vectoring #DF %#RX64 uIdtVector=%#x uExitVector=%#x\n", pVCpu->hm.s.Event.u64IntrInfo, 4850 uIdtVector, uExitVector));4862 uIdtVector, uExitVector)); 4851 4863 break; 4852 4864 } … … 4854 4866 case VMXREFLECTXCPT_TF: 4855 4867 { 4868 rc = VINF_EM_RESET; 4856 4869 Log4(("IDT: Pending vectoring triple-fault uIdt=%#x uExit=%#x\n", uIdtVector, uExitVector)); 4857 rc = VINF_EM_RESET;4858 4870 break; 4859 4871 } … … 4864 4876 } 4865 4877 } 4866 Assert(rc == VINF_SUCCESS || rc == VINF_ VMX_DOUBLE_FAULT || rc == VINF_EM_RESET);4878 Assert(rc == VINF_SUCCESS || rc == VINF_HM_DOUBLE_FAULT || rc == VINF_EM_RESET); 4867 4879 return rc; 4868 4880 } … … 7237 7249 /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */ 7238 7250 rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient); 7239 if (RT_UNLIKELY(rc == VINF_ VMX_DOUBLE_FAULT))7251 if (RT_UNLIKELY(rc == VINF_HM_DOUBLE_FAULT)) 7240 7252 { 7241 7253 STAM_PROFILE_ADV_STOP(&pVCpu->hm.s.StatExitXcptNmi, y3); … … 8400 8412 /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */ 8401 8413 int rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient); 8402 if (RT_UNLIKELY(rc == VINF_ VMX_DOUBLE_FAULT))8414 if (RT_UNLIKELY(rc == VINF_HM_DOUBLE_FAULT)) 8403 8415 return VINF_SUCCESS; 8404 8416 else if (RT_UNLIKELY(rc == VINF_EM_RESET)) … … 8554 8566 /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */ 8555 8567 int rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient); 8556 if (RT_UNLIKELY(rc == VINF_ VMX_DOUBLE_FAULT))8568 if (RT_UNLIKELY(rc == VINF_HM_DOUBLE_FAULT)) 8557 8569 return VINF_SUCCESS; 8558 8570 else if (RT_UNLIKELY(rc == VINF_EM_RESET)) … … 8607 8619 /* If this VM-exit occurred while delivering an event through the guest IDT, handle it accordingly. */ 8608 8620 int rc = hmR0VmxCheckExitDueToEventDelivery(pVCpu, pMixedCtx, pVmxTransient); 8609 if (RT_UNLIKELY(rc == VINF_ VMX_DOUBLE_FAULT))8621 if (RT_UNLIKELY(rc == VINF_HM_DOUBLE_FAULT)) 8610 8622 return VINF_SUCCESS; 8611 8623 else if (RT_UNLIKELY(rc == VINF_EM_RESET)) … … 9089 9101 if (pVM->hm.s.fNestedPaging) 9090 9102 { 9103 pVCpu->hm.s.Event.fPending = false; /* In case it's a contributory or vectoring #PF. */ 9091 9104 if (RT_LIKELY(!pVmxTransient->fVectoringPF)) 9092 9105 { 9093 pVCpu->hm.s.Event.fPending = false; /* In case it's a contributory #PF. */9094 9106 pMixedCtx->cr2 = pVmxTransient->uExitQualification; /* Update here in case we go back to ring-3 before injection. */ 9095 9107 hmR0VmxSetPendingEvent(pVCpu, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntrInfo), 9096 9108 0 /* cbInstr */, pVmxTransient->uExitIntrErrorCode, pVmxTransient->uExitQualification); 9097 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitGuestPF);9098 9109 } 9099 9110 else 9100 9111 { 9101 9112 /* A guest page-fault occurred during delivery of a page-fault. Inject #DF. */ 9102 pVCpu->hm.s.Event.fPending = false; /* A vectoring #PF. */9103 9113 hmR0VmxSetPendingXcptDF(pVCpu, pMixedCtx); 9104 9114 Log4(("Pending #DF due to vectoring #PF. NP\n")); … … 9149 9159 /* A guest page-fault occurred during delivery of a page-fault. Inject #DF. */ 9150 9160 TRPMResetTrap(pVCpu); 9151 pVCpu->hm.s.Event.fPending = false; /* Clear pending #PF forreplace it with #DF. */9161 pVCpu->hm.s.Event.fPending = false; /* Clear pending #PF to replace it with #DF. */ 9152 9162 hmR0VmxSetPendingXcptDF(pVCpu, pMixedCtx); 9153 9163 Log4(("#PF: Pending #DF due to vectoring #PF\n"));
Note:
See TracChangeset
for help on using the changeset viewer.

