Changeset 79880 in vbox
- Timestamp:
- Jul 19, 2019 10:08:07 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132282
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r79875 r79880 6149 6149 int rc = VMXWriteVmcs32(VMX_VMCS_GUEST_DR7, CPUMGetGuestDR7(pVCpu)); 6150 6150 AssertRCReturn(rc, rc); 6151 6152 /* Always intercept Mov DRx accesses for the nested-guest for now. */ 6153 pVmcsInfo->u32ProcCtls |= VMX_PROC_CTLS_MOV_DR_EXIT; 6154 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVmcsInfo->u32ProcCtls); 6155 AssertRCReturn(rc, rc); 6151 6156 return VINF_SUCCESS; 6152 6157 } … … 10911 10916 */ 10912 10917 PVMXVMCSINFO pVmcsInfoNstGst = &pVCpu->hm.s.vmx.VmcsInfoNstGst; 10913 RTHCPHYS HCPhysVirtApic;10914 uint32_t u32TprThreshold;10918 RTHCPHYS HCPhysVirtApic; 10919 uint32_t u32TprThreshold; 10915 10920 if (u32ProcCtls & VMX_PROC_CTLS_USE_TPR_SHADOW) 10916 10921 { … … 16320 16325 { 16321 16326 HMVMX_VALIDATE_EXIT_HANDLER_PARAMS(pVCpu, pVmxTransient); 16322 16323 /* We should -not- get this VM-exit if the guest's debug registers were active. */16324 if (pVmxTransient->fWasGuestDebugStateActive)16325 {16326 AssertMsgFailed(("Unexpected MOV DRx exit\n"));16327 HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient->uExitReason);16328 }16329 16330 16327 PVMXVMCSINFO pVmcsInfo = pVmxTransient->pVmcsInfo; 16331 if ( !pVCpu->hm.s.fSingleInstruction 16332 && !pVmxTransient->fWasHyperDebugStateActive) 16333 { 16334 Assert(!DBGFIsStepping(pVCpu)); 16335 Assert(pVmcsInfo->u32XcptBitmap & RT_BIT(X86_XCPT_DB)); 16336 16337 /* Don't intercept MOV DRx any more. */ 16338 pVmcsInfo->u32ProcCtls &= ~VMX_PROC_CTLS_MOV_DR_EXIT; 16339 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVmcsInfo->u32ProcCtls); 16340 AssertRCReturn(rc, rc); 16341 16342 /* We're playing with the host CPU state here, make sure we can't preempt or longjmp. */ 16343 VMMRZCallRing3Disable(pVCpu); 16344 HM_DISABLE_PREEMPT(pVCpu); 16345 16346 /* Save the host & load the guest debug state, restart execution of the MOV DRx instruction. */ 16347 CPUMR0LoadGuestDebugState(pVCpu, true /* include DR6 */); 16348 Assert(CPUMIsGuestDebugStateActive(pVCpu) || HC_ARCH_BITS == 32); 16349 16350 HM_RESTORE_PREEMPT(); 16351 VMMRZCallRing3Enable(pVCpu); 16328 16329 /* We might get this VM-exit if the nested-guest is not intercepting MOV DRx accesses. */ 16330 if (!pVmxTransient->fIsNestedGuest) 16331 { 16332 /* We should -not- get this VM-exit if the guest's debug registers were active. */ 16333 if (pVmxTransient->fWasGuestDebugStateActive) 16334 { 16335 AssertMsgFailed(("Unexpected MOV DRx exit\n")); 16336 HMVMX_UNEXPECTED_EXIT_RET(pVCpu, pVmxTransient->uExitReason); 16337 } 16338 16339 if ( !pVCpu->hm.s.fSingleInstruction 16340 && !pVmxTransient->fWasHyperDebugStateActive) 16341 { 16342 Assert(!DBGFIsStepping(pVCpu)); 16343 Assert(pVmcsInfo->u32XcptBitmap & RT_BIT(X86_XCPT_DB)); 16344 16345 /* Don't intercept MOV DRx any more. */ 16346 pVmcsInfo->u32ProcCtls &= ~VMX_PROC_CTLS_MOV_DR_EXIT; 16347 int rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVmcsInfo->u32ProcCtls); 16348 AssertRCReturn(rc, rc); 16349 16350 /* We're playing with the host CPU state here, make sure we can't preempt or longjmp. */ 16351 VMMRZCallRing3Disable(pVCpu); 16352 HM_DISABLE_PREEMPT(pVCpu); 16353 16354 /* Save the host & load the guest debug state, restart execution of the MOV DRx instruction. */ 16355 CPUMR0LoadGuestDebugState(pVCpu, true /* include DR6 */); 16356 Assert(CPUMIsGuestDebugStateActive(pVCpu) || HC_ARCH_BITS == 32); 16357 16358 HM_RESTORE_PREEMPT(); 16359 VMMRZCallRing3Enable(pVCpu); 16352 16360 16353 16361 #ifdef VBOX_WITH_STATISTICS 16354 rc = hmR0VmxReadExitQualVmcs(pVCpu, pVmxTransient);16355 AssertRCReturn(rc, rc);16356 if (VMX_EXIT_QUAL_DRX_DIRECTION(pVmxTransient->uExitQual) == VMX_EXIT_QUAL_DRX_DIRECTION_WRITE)16357 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitDRxWrite);16358 else16359 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitDRxRead);16362 rc = hmR0VmxReadExitQualVmcs(pVCpu, pVmxTransient); 16363 AssertRCReturn(rc, rc); 16364 if (VMX_EXIT_QUAL_DRX_DIRECTION(pVmxTransient->uExitQual) == VMX_EXIT_QUAL_DRX_DIRECTION_WRITE) 16365 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitDRxWrite); 16366 else 16367 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitDRxRead); 16360 16368 #endif 16361 STAM_COUNTER_INC(&pVCpu->hm.s.StatDRxContextSwitch); 16362 return VINF_SUCCESS; 16369 STAM_COUNTER_INC(&pVCpu->hm.s.StatDRxContextSwitch); 16370 return VINF_SUCCESS; 16371 } 16363 16372 } 16364 16373
Note:
See TracChangeset
for help on using the changeset viewer.