VirtualBox

Ignore:
Timestamp:
Apr 19, 2013 5:19:29 PM (12 years ago)
Author:
vboxsync
Message:

VMMR0/HMVMXR0: Fix single-stepping over STI during guest debugging and inadvertently intercepting #DB recursively.

File:
1 edited

Legend:

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

    r45648 r45650  
    59415941            if (pMixedCtx->eflags.Bits.u1TF)    /* We don't have any IA32_DEBUGCTL MSR for guests. Treat as all bits 0. */
    59425942            {
    5943                 /* This field is cleared on all VM-exits except (VMX_EXIT_TPR_BELOW_THRESHOLD, VMX_EXIT_APIC_WRITE,
    5944                    VMX_EXIT_VIRTUALIZED_EOI, VMX_EXIT_MTF). See Intel spec. 27.3.4 "Saving Non-Register State". */
    5945                 rc2 = VMXWriteVmcsGstN(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, VMX_VMCS_GUEST_DEBUG_EXCEPTIONS_BS);
     5943                /*
     5944                 * The pending-debug exceptions field is cleared on all VM-exits except VMX_EXIT_TPR_BELOW_THRESHOLD, VMX_EXIT_MTF
     5945                 * VMX_EXIT_APIC_WRITE, VMX_EXIT_VIRTUALIZED_EOI. See Intel spec. 27.3.4 "Saving Non-Register State".
     5946                 */
     5947#ifndef HMVMX_TRAP_ALL_EXCEPTIONS
     5948                /* Don't intercept the #DB resulting from the pending-debug exception. */
     5949                pVCpu->hm.s.vmx.u32XcptBitmap &= ~RT_BIT(X86_XCPT_DB);
     5950                rc2  = VMXWriteVmcs32(VMX_VMCS32_CTRL_EXCEPTION_BITMAP, pVCpu->hm.s.vmx.u32XcptBitmap);
     5951#endif
     5952                rc2 |= VMXWriteVmcsGstN(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, VMX_VMCS_GUEST_DEBUG_EXCEPTIONS_BS);
    59465953            }
    59475954        }
     
    85098516        rc |= VMXWriteVmcsGstN(VMX_VMCS_GUEST_DR7, pMixedCtx->dr[7]);
    85108517        AssertRCReturn(rc,rc);
    8511     }
    8512 
    8513     /*
    8514      * If the #DB exception was meant for the guest, reflect it to the guest upon VM-reentry. If our hypervisor is
    8515      * simultaneously single-stepping with the guest, return to the debugger but also reflect #DB to the guest upon VM-reentry.
    8516      */
    8517     if (   rc == VINF_EM_RAW_GUEST_TRAP
    8518         || rc == VINF_EM_DBG_STEPPED)
    8519     {
     8518
    85208519        int rc2 = hmR0VmxReadExitIntrInfoVmcs(pVCpu, pVmxTransient);
    85218520        rc2 |= hmR0VmxReadExitInstrLenVmcs(pVCpu, pVmxTransient);
     
    85248523        hmR0VmxSetPendingEvent(pVCpu, VMX_VMCS_CTRL_ENTRY_IRQ_INFO_FROM_EXIT_INT_INFO(pVmxTransient->uExitIntrInfo),
    85258524                               pVmxTransient->cbInstr, pVmxTransient->uExitIntrErrorCode, 0 /* GCPtrFaultAddress */);
    8526         if (rc == VINF_EM_RAW_GUEST_TRAP)
    8527             rc = VINF_SUCCESS;
    8528     }
     8525        rc = VINF_SUCCESS;
     8526    }
     8527
    85298528    return rc;
    85308529}
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