VirtualBox

Changeset 66868 in vbox


Ignore:
Timestamp:
May 10, 2017 2:44:26 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115349
Message:

SVM: Attempt to fix CR2 corruption (bugref:7243).

File:
1 edited

Legend:

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

    r66859 r66868  
    40434043        IEMXCPTRAISEINFO fRaiseInfo;
    40444044        bool const       fExitIsHwXcpt  = pSvmTransient->u64ExitCode - SVM_EXIT_EXCEPTION_0 <= SVM_EXIT_EXCEPTION_31;
     4045        uint8_t const    uIdtVector     = pVmcb->ctrl.ExitIntInfo.n.u8Vector;
    40454046        if (fExitIsHwXcpt)
    40464047        {
    4047             uint8_t  const uIdtVector       = pVmcb->ctrl.ExitIntInfo.n.u8Vector;
    40484048            uint8_t  const uExitVector      = pSvmTransient->u64ExitCode - SVM_EXIT_EXCEPTION_0;
    40494049            uint32_t const fIdtVectorFlags  = hmR0SvmGetIemXcptFlags(&pVmcb->ctrl.ExitIntInfo);
     
    40694069                if (!(fRaiseInfo & IEMXCPTRAISEINFO_SOFT_INT_XCPT))
    40704070                {
     4071                    RTGCUINTPTR GCPtrFaultAddress = 0;
     4072
    40714073                    /* Determine a vectoring #PF condition, see comment in hmR0SvmExitXcptPF(). */
    40724074                    if (fRaiseInfo & (IEMXCPTRAISEINFO_EXT_INT_PF | IEMXCPTRAISEINFO_NMI_PF))
     
    40764078                        if (fRaiseInfo & IEMXCPTRAISEINFO_NMI_XCPT)
    40774079                            VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_BLOCK_NMIS);
     4080                    } else if (uIdtVector == X86_XCPT_PF) {
     4081                        /* If the previous exception was a #PF, we need to recover the CR2 value.
     4082                         * This can't happen with shadow paging.
     4083                         */
     4084                        GCPtrFaultAddress = pCtx->cr2;
    40784085                    }
    40794086
    40804087                    Assert(pVmcb->ctrl.ExitIntInfo.n.u3Type != SVM_EVENT_SOFTWARE_INT);
    40814088                    STAM_COUNTER_INC(&pVCpu->hm.s.StatInjectPendingReflect);
    4082                     hmR0SvmSetPendingEvent(pVCpu, &pVmcb->ctrl.ExitIntInfo, 0 /* GCPtrFaultAddress */);
    4083 
     4089                    hmR0SvmSetPendingEvent(pVCpu, &pVmcb->ctrl.ExitIntInfo, GCPtrFaultAddress);
     4090
     4091                    /** @todo r=michaln: The comment makes no sense with nested paging on! */
    40844092                    /* If uExitVector is #PF, CR2 value will be updated from the VMCB if it's a guest #PF. See hmR0SvmExitXcptPF(). */
    4085                     Log4(("IDT: Pending vectoring event %#RX64 ErrValid=%RTbool Err=%#RX32\n", pVmcb->ctrl.ExitIntInfo.u,
    4086                           !!pVmcb->ctrl.ExitIntInfo.n.u1ErrorCodeValid, pVmcb->ctrl.ExitIntInfo.n.u32ErrorCode));
     4093                    Log4(("IDT: Pending vectoring event %#RX64 ErrValid=%RTbool Err=%#RX32 GCPtrFaultAddress=%#RX64\n", pVmcb->ctrl.ExitIntInfo.u,
     4094                          !!pVmcb->ctrl.ExitIntInfo.n.u1ErrorCodeValid, pVmcb->ctrl.ExitIntInfo.n.u32ErrorCode, GCPtrFaultAddress));
    40874095                }
    40884096                break;
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