Changeset 50270 in vbox for trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
- Timestamp:
- Jan 29, 2014 2:20:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r49992 r50270 7078 7078 } 7079 7079 7080 /* Delivery pending debug exception if the guest is single-stepping. Evaluate and set the BS bit. */ 7081 if ( !pVCpu->hm.s.fSingleInstruction 7082 && !DBGFIsStepping(pVCpu)) 7083 { 7084 int rc2 = hmR0VmxSaveGuestRflags(pVCpu, pMixedCtx); 7085 AssertRCReturn(rc2, rc2); 7086 if (pMixedCtx->eflags.Bits.u1TF) /* We don't have any IA32_DEBUGCTL MSR for guests. Treat as all bits 0. */ 7080 /* Deliver pending debug exception if the guest is single-stepping. Evaluate and set the BS bit. */ 7081 if ( fBlockSti 7082 || fBlockMovSS) 7083 { 7084 if ( !pVCpu->hm.s.fSingleInstruction 7085 && !DBGFIsStepping(pVCpu)) 7086 { 7087 int rc2 = hmR0VmxSaveGuestRflags(pVCpu, pMixedCtx); 7088 AssertRCReturn(rc2, rc2); 7089 if (pMixedCtx->eflags.Bits.u1TF) /* We don't have any IA32_DEBUGCTL MSR for guests. Treat as all bits 0. */ 7090 { 7091 /* 7092 * The pending-debug exceptions field is cleared on all VM-exits except VMX_EXIT_TPR_BELOW_THRESHOLD, 7093 * VMX_EXIT_MTF, VMX_EXIT_APIC_WRITE and VMX_EXIT_VIRTUALIZED_EOI. 7094 * See Intel spec. 27.3.4 "Saving Non-Register State". 7095 */ 7096 rc2 = VMXWriteVmcs32(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, VMX_VMCS_GUEST_DEBUG_EXCEPTIONS_BS); 7097 AssertRCReturn(rc2, rc2); 7098 } 7099 } 7100 else if (pMixedCtx->eflags.Bits.u1TF) 7087 7101 { 7088 7102 /* 7089 * The pending-debug exceptions field is cleared on all VM-exits except VMX_EXIT_TPR_BELOW_THRESHOLD, 7090 * VMX_EXIT_MTF, VMX_EXIT_APIC_WRITE and VMX_EXIT_VIRTUALIZED_EOI. 7091 * See Intel spec. 27.3.4 "Saving Non-Register State". 7103 * We are single-stepping in the hypervisor debugger using EFLAGS.TF. Clear interrupt inhibition as setting the 7104 * BS bit would mean delivering a #DB to the guest upon VM-entry when it shouldn't be. 7092 7105 */ 7093 rc2 = VMXWriteVmcs32(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, VMX_VMCS_GUEST_DEBUG_EXCEPTIONS_BS); 7094 AssertRCReturn(rc2, rc2); 7095 } 7096 } 7097 else 7098 { 7099 /* We are single-stepping in the hypervisor debugger, clear interrupt inhibition as setting the BS bit would mean 7100 delivering a #DB to the guest upon VM-entry when it shouldn't be. */ 7101 uIntrState = 0; 7106 Assert(!(pVCpu->CTX_SUFF(pVM)->hm.s.vmx.Msrs.VmxProcCtls.n.allowed1 & VMX_VMCS_CTRL_PROC_EXEC_MONITOR_TRAP_FLAG)); 7107 uIntrState = 0; 7108 } 7102 7109 } 7103 7110 … … 8600 8607 int rc = hmR0VmxReadExitInstrLenVmcs(pVmxTransient); 8601 8608 rc |= hmR0VmxSaveGuestRip(pVCpu, pMixedCtx); 8609 rc |= hmR0VmxSaveGuestRflags(pVCpu, pMixedCtx); 8602 8610 AssertRCReturn(rc, rc); 8603 8611 8604 8612 pMixedCtx->rip += pVmxTransient->cbInstr; 8605 8613 HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_RIP); 8614 8615 /* Deliver pending debug exception if the guest is single-stepping. */ 8616 if (pMixedCtx->eflags.Bits.u1TF) 8617 { 8618 rc = VMXWriteVmcs32(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, VMX_VMCS_GUEST_DEBUG_EXCEPTIONS_BS); 8619 AssertRCReturn(rc, rc); 8620 } 8621 8606 8622 return rc; 8607 8623 }
Note:
See TracChangeset
for help on using the changeset viewer.