VirtualBox

Changeset 66979 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 19, 2017 1:02:48 PM (8 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: Fixes to hmR0SvmCheckExitDueToEventDelivery while handling soft int. and NMIs.

File:
1 edited

Legend:

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

    r66961 r66979  
    40634063        {
    40644064            /*
    4065              * If event delivery caused an #VMEXIT that is not an exception (e.g. #NPF) then reflect the original
    4066              * exception to the guest after handling the #VMEXIT.
     4065             * If delivery of an event caused a #VMEXIT that is not an exception (e.g. #NPF) then we
     4066             * end up here.
     4067             *
     4068             * If the event was:
     4069             *   - a software interrupt, we can re-execute the instruction which will regenerate
     4070             *     the event.
     4071             *   - an NMI, we need to clear NMI blocking and re-inject the NMI.
     4072             *   - a hardware exception or external interrupt, we re-inject it.
    40674073             */
    4068             enmRaise   = IEMXCPTRAISE_PREV_EVENT;
    4069             fRaiseInfo = IEMXCPTRAISEINFO_NONE;
     4074            if (pVmcb->ctrl.ExitIntInfo.n.u3Type == SVM_EVENT_SOFTWARE_INT)
     4075            {
     4076                enmRaise   = IEMXCPTRAISE_REEXEC_INSTR;
     4077                fRaiseInfo = IEMXCPTRAISEINFO_NONE;
     4078            }
     4079            else if (pVmcb->ctrl.ExitIntInfo.n.u3Type == SVM_EVENT_NMI)
     4080            {
     4081                enmRaise   = IEMXCPTRAISE_PREV_EVENT;
     4082                fRaiseInfo = IEMXCPTRAISEINFO_SOFT_INT_XCPT;
     4083            }
     4084            else
     4085            {
     4086                enmRaise   = IEMXCPTRAISE_PREV_EVENT;
     4087                fRaiseInfo = IEMXCPTRAISEINFO_NONE;
     4088            }
    40704089        }
    40714090
     
    40874106                    if (fRaiseInfo & (IEMXCPTRAISEINFO_EXT_INT_PF | IEMXCPTRAISEINFO_NMI_PF))
    40884107                        pSvmTransient->fVectoringPF = true;
    4089                     else if (uIdtVector == X86_XCPT_PF)
     4108                    else if (   uIdtVector == X86_XCPT_PF
     4109                             && pVmcb->ctrl.ExitIntInfo.n.u3Type == SVM_EVENT_EXCEPTION)
    40904110                    {
    40914111                        /*
     
    41014121
    41024122                    /** @todo r=michaln: The comment makes no sense with nested paging on! */
    4103                     /* If uExitVector is #PF, CR2 value will be updated from the VMCB if it's a guest #PF. See hmR0SvmExitXcptPF(). */
    4104                     Log4(("IDT: Pending vectoring event %#RX64 ErrValid=%RTbool Err=%#RX32 GCPtrFaultAddress=%#RX64\n", pVmcb->ctrl.ExitIntInfo.u,
    4105                           !!pVmcb->ctrl.ExitIntInfo.n.u1ErrorCodeValid, pVmcb->ctrl.ExitIntInfo.n.u32ErrorCode, GCPtrFaultAddress));
     4123                    /* If uExitVector is #PF, CR2 value will be updated from the VMCB if it's a guest #PF,
     4124                       see hmR0SvmExitXcptPF(). */
     4125                    Log4(("IDT: Pending vectoring event %#RX64 ErrValid=%RTbool Err=%#RX32 GCPtrFaultAddress=%#RX64\n",
     4126                          pVmcb->ctrl.ExitIntInfo.u, RT_BOOL(pVmcb->ctrl.ExitIntInfo.n.u1ErrorCodeValid),
     4127                          pVmcb->ctrl.ExitIntInfo.n.u32ErrorCode, GCPtrFaultAddress));
    41064128                }
     4129                break;
     4130            }
     4131
     4132            case IEMXCPTRAISE_REEXEC_INSTR:
     4133            {
     4134                Assert(rc == VINF_SUCCESS);
    41074135                break;
    41084136            }
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