VirtualBox

Changeset 67024 in vbox for trunk


Ignore:
Timestamp:
May 23, 2017 6:35:38 AM (8 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Don't go back to IEM for injecting secondary/final exception, also removed superfluous updates of CR2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp

    r66987 r67024  
    59275927                             uExitVectorType), VERR_VMX_IPE_5);
    59285928            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            }
    59295936        }
    59305937        else
     
    59625969        {
    59635970            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
    59645978            case IEMXCPTRAISE_PREV_EVENT:
    59655979            {
    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 
    59705980                uint32_t u32ErrCode;
    59715981                if (VMX_IDT_VECTORING_INFO_ERROR_CODE_IS_VALID(pVmxTransient->uIdtVectoringInfo))
     
    1157111581        case VMX_EXIT_INTERRUPTION_INFO_TYPE_HW_XCPT:
    1157211582        {
     11583#if 0
    1157311584            /*
    1157411585             * If there's any exception caused as a result of event injection, go back to
     
    1158811599                break;
    1158911600            }
     11601#endif
    1159011602
    1159111603            switch (uVector)
     
    1290112913        if (VMX_IDT_VECTORING_INFO_VALID(pVmxTransient->uIdtVectoringInfo))
    1290212914        {
    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);
    1291412920            if (fErrorCodeValid)
    12915                 pVCpu->hm.s.Event.u32ErrCode = pVmxTransient->uIdtVectoringErrorCode;
     12921            {
     12922                rc = hmR0VmxReadIdtVectoringErrorCodeVmcs(pVmxTransient);
     12923                AssertRCReturn(rc, rc);
     12924                uErrCode = pVmxTransient->uIdtVectoringErrorCode;
     12925            }
    1291612926            else
    12917                 pVCpu->hm.s.Event.u32ErrCode = 0;
     12927                uErrCode = 0;
     12928
    1291812929            if (   uIntType == VMX_IDT_VECTORING_INFO_TYPE_HW_XCPT
    1291912930                && 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);
    1292312937
    1292412938            Log4(("Pending event on TaskSwitch uIntType=%#x uVector=%#x\n", uIntType, uVector));
     
    1385113865        if (RT_LIKELY(!pVmxTransient->fVectoringDoublePF))
    1385213866        {
    13853             pMixedCtx->cr2 = pVmxTransient->uExitQualification;  /* Update here in case we go back to ring-3 before injection. */
    1385413867            hmR0VmxSetPendingEvent(pVCpu, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntInfo),
    1385513868                                   0 /* cbInstr */, pVmxTransient->uExitIntErrorCode, pVmxTransient->uExitQualification);
     
    1391513928            TRPMResetTrap(pVCpu);
    1391613929            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. */
    1391813930            hmR0VmxSetPendingEvent(pVCpu, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntInfo),
    1391913931                                   0 /* cbInstr */, uGstErrorCode, pVmxTransient->uExitQualification);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette