VirtualBox

Changeset 64773 in vbox


Ignore:
Timestamp:
Dec 1, 2016 3:17:33 PM (8 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: Fix INT3 based breakpoint intercept exits.

File:
1 edited

Legend:

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

    r64771 r64773  
    307307static FNSVMEXITHANDLER hmR0SvmExitXcptDB;
    308308static FNSVMEXITHANDLER hmR0SvmExitXcptAC;
     309static FNSVMEXITHANDLER hmR0SvmExitXcptBP;
    309310/** @} */
    310311
     
    35723573            return hmR0SvmExitXcptAC(pVCpu, pCtx, pSvmTransient);
    35733574
     3575        case SVM_EXIT_EXCEPTION_3:  /* X86_XCPT_BP */
     3576            return hmR0SvmExitXcptBP(pVCpu, pCtx, pSvmTransient);
     3577
    35743578        case SVM_EXIT_MONITOR:
    35753579            return hmR0SvmExitMonitor(pVCpu, pCtx, pSvmTransient);
     
    36753679                /*   SVM_EXIT_EXCEPTION_1: */          /* X86_XCPT_DB - Handled above. */
    36763680                case SVM_EXIT_EXCEPTION_2:             /* X86_XCPT_NMI */
    3677                 case SVM_EXIT_EXCEPTION_3:             /* X86_XCPT_BP */
     3681                /* case SVM_EXIT_EXCEPTION_3: */       /* X86_XCPT_BP - Handled above. */
    36783682                case SVM_EXIT_EXCEPTION_4:             /* X86_XCPT_OF */
    36793683                case SVM_EXIT_EXCEPTION_5:             /* X86_XCPT_BR */
     
    37083712                        case X86_XCPT_DE:
    37093713                            STAM_COUNTER_INC(&pVCpu->hm.s.StatExitGuestDE);
    3710                             break;
    3711 
    3712                         case X86_XCPT_BP:
    3713                             /** Saves the wrong EIP on the stack (pointing to the int3) instead of the
    3714                              *  next instruction. */
    3715                             /** @todo Investigate this later. */
    3716                             STAM_COUNTER_INC(&pVCpu->hm.s.StatExitGuestBP);
    37173714                            break;
    37183715
     
    56435640}
    56445641
     5642
     5643/**
     5644 * \#VMEXIT handler for breakpoint exceptions (SVM_EXIT_EXCEPTION_3).
     5645 * Conditional \#VMEXIT.
     5646 */
     5647HMSVM_EXIT_DECL hmR0SvmExitXcptBP(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient)
     5648{
     5649    HMSVM_VALIDATE_EXIT_HANDLER_PARAMS();
     5650
     5651    HMSVM_CHECK_EXIT_DUE_TO_EVENT_DELIVERY();
     5652
     5653    int rc = DBGFRZTrap03Handler(pVCpu->CTX_SUFF(pVM), pVCpu, CPUMCTX2CORE(pCtx));
     5654    if (rc == VINF_EM_RAW_GUEST_TRAP)
     5655    {
     5656        SVMEVENT Event;
     5657        Event.u          = 0;
     5658        Event.n.u1Valid  = 1;
     5659        Event.n.u3Type   = SVM_EVENT_EXCEPTION;
     5660        Event.n.u8Vector = X86_XCPT_BP;
     5661        Event.n.u1ErrorCodeValid = 0;
     5662        hmR0SvmSetPendingEvent(pVCpu, &Event, 0 /* GCPtrFaultAddress */);
     5663    }
     5664
     5665    Assert(rc == VINF_SUCCESS || rc == VINF_EM_RAW_GUEST_TRAP || rc == VINF_EM_DBG_BREAKPOINT);
     5666    return rc;
     5667}
     5668
    56455669/** @} */
    56465670
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