VirtualBox

Changeset 66758 in vbox


Ignore:
Timestamp:
May 3, 2017 1:20:36 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115168
Message:

VMM/HMSVMR0: Fixes while using the IEM event reflection logic.

File:
1 edited

Legend:

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

    r66754 r66758  
    39443944    {
    39453945        case SVM_EVENT_EXCEPTION:
     3946            /*
     3947             * Only INT3 and INTO instructions can raise #BP and #OF exceptions.
     3948             * See AMD spec. Table 8-1. "Interrupt Vector Source and Cause".
     3949             */
    39463950            if (pEvent->n.u8Vector == X86_XCPT_BP)
    39473951            {
     
    40384042        IEMXCPTRAISE     enmRaise;
    40394043        IEMXCPTRAISEINFO fRaiseInfo;
    4040         bool             fReflectingNmi = false;
    40414044        bool const       fExitIsHwXcpt  = pSvmTransient->u64ExitCode - SVM_EXIT_EXCEPTION_0 <= SVM_EXIT_EXCEPTION_31;
    40424045        if (fExitIsHwXcpt)
     
    40474050            uint32_t const fExitVectorFlags = IEM_XCPT_FLAGS_T_CPU_XCPT;
    40484051            enmRaise = IEMEvaluateRecursiveXcpt(pVCpu, fIdtVectorFlags, uIdtVector, fExitVectorFlags, uExitVector, &fRaiseInfo);
    4049 
    4050             if (fRaiseInfo & (IEMXCPTRAISEINFO_EXT_INT_PF | IEMXCPTRAISEINFO_NMI_PF))
    4051             {
    4052                 if (fRaiseInfo & IEMXCPTRAISEINFO_NMI_XCPT)
    4053                     fReflectingNmi = true;
    4054                 pSvmTransient->fVectoringPF = true;
    4055             }
    4056             else if (fRaiseInfo & IEMXCPTRAISEINFO_PF_PF)
    4057                 pSvmTransient->fVectoringDoublePF = true;
    40584052        }
    40594053        else
     
    40754069                if (!(fRaiseInfo & IEMXCPTRAISEINFO_SOFT_INT_XCPT))
    40764070                {
    4077                     /* If we are re-injecting the NMI, clear NMI blocking. */
    4078                     if (fReflectingNmi)
    4079                         VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS);
     4071                    /* Determine a vectoring #PF condition, see comment in hmR0SvmExitXcptPF(). */
     4072                    if (fRaiseInfo & (IEMXCPTRAISEINFO_EXT_INT_PF | IEMXCPTRAISEINFO_NMI_PF))
     4073                    {
     4074                        pSvmTransient->fVectoringPF = true;
     4075                        /* If we are re-injecting the NMI, clear NMI blocking. */
     4076                        if (fRaiseInfo & IEMXCPTRAISEINFO_NMI_XCPT)
     4077                            VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS);
     4078                    }
    40804079
    40814080                    Assert(pVmcb->ctrl.ExitIntInfo.n.u3Type != SVM_EVENT_SOFTWARE_INT);
     
    40924091            case IEMXCPTRAISE_DOUBLE_FAULT:
    40934092            {
    4094                 STAM_COUNTER_INC(&pVCpu->hm.s.StatInjectPendingReflect);
    4095                 hmR0SvmSetPendingXcptDF(pVCpu);
    4096                 rc = VINF_HM_DOUBLE_FAULT;
     4093                /*
     4094                 * Determing a vectoring double #PF condition. Used later, when PGM evaluates the
     4095                 * second #PF as a guest #PF (and not a shadow #PF) and needs to be converted into a #DF.
     4096                 */
     4097                if (fRaiseInfo & IEMXCPTRAISEINFO_PF_PF)
     4098                {
     4099                    pSvmTransient->fVectoringDoublePF = true;
     4100                    Assert(rc == VINF_SUCCESS);
     4101                }
     4102                else
     4103                {
     4104                    STAM_COUNTER_INC(&pVCpu->hm.s.StatInjectPendingReflect);
     4105                    hmR0SvmSetPendingXcptDF(pVCpu);
     4106                    rc = VINF_HM_DOUBLE_FAULT;
     4107                }
    40974108                break;
    40984109            }
Note: See TracChangeset for help on using the changeset viewer.

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