Changeset 45648 in vbox
- Timestamp:
- Apr 19, 2013 2:51:16 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r45647 r45648 5927 5927 5928 5928 /* 5929 * Delivery pending debug exception if the guest is single-stepping. The interruptibility-state could have been changed by 5930 * hmR0VmxInjectEventVmcs() (e.g. real-on-v86 injecting software interrupts), re-evaluate it and set the BS bit. 5931 */ 5932 fBlockMovSS = !!(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_MOVSS); 5933 fBlockSti = !!(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI); 5934 int rc2 = VINF_SUCCESS; 5935 if ( fBlockSti 5936 || fBlockMovSS) 5937 { 5938 if (!DBGFIsStepping(pVCpu)) 5939 { 5940 Assert(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RFLAGS); 5941 if (pMixedCtx->eflags.Bits.u1TF) /* We don't have any IA32_DEBUGCTL MSR for guests. Treat as all bits 0. */ 5942 { 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); 5946 } 5947 } 5948 else 5949 { 5950 /* We are single-stepping in the hypervisor debugger, clear interrupt inhibition as setting the BS bit would mean 5951 delivering a #DB to the guest upon VM-entry when it shouldn't be. */ 5952 uIntrState = 0; 5953 } 5954 } 5955 5956 /* 5929 5957 * There's no need to clear the VM entry-interruption information field here if we're not injecting anything. 5930 5958 * VT-x clears the valid bit on every VM-exit. See Intel spec. 24.8.3 "VM-Entry Controls for Event Injection". 5931 5959 */ 5932 int rc2 = hmR0VmxLoadGuestIntrState(pVCpu, uIntrState); 5933 5934 /* 5935 * Delivery pending debug exception if the guest is single-stepping. The interruptibility-state could have been changed by 5936 * hmR0VmxInjectEventVmcs() (e.g. real-on-v86 injecting software interrupts), re-evaluate it and set the BS bit. 5937 */ 5938 fBlockMovSS = !!(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_MOVSS); 5939 fBlockSti = !!(uIntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI); 5940 if ( fBlockSti 5941 || fBlockMovSS) 5942 { 5943 Assert(pVCpu->hm.s.vmx.fUpdatedGuestState & HMVMX_UPDATED_GUEST_RFLAGS); 5944 if (pMixedCtx->eflags.Bits.u1TF) /* We don't have any IA32_DEBUGCTL MSR for guests. Treat as all bits 0. */ 5945 { 5946 /* This field is cleared on all VM-exits except (VMX_EXIT_TPR_BELOW_THRESHOLD, VMX_EXIT_APIC_WRITE, 5947 VMX_EXIT_VIRTUALIZED_EOI, VMX_EXIT_MTF). See Intel spec. 27.3.4 "Saving Non-Register State". */ 5948 rc2 |= VMXWriteVmcsGstN(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, VMX_VMCS_GUEST_DEBUG_EXCEPTIONS_BS); 5949 } 5950 } 5951 5960 rc2 |= hmR0VmxLoadGuestIntrState(pVCpu, uIntrState); 5952 5961 AssertRC(rc2); 5962 5953 5963 Assert(rc == VINF_SUCCESS || rc == VINF_EM_RESET); 5954 5964 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.