Changeset 55037 in vbox for trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
- Timestamp:
- Mar 31, 2015 2:09:10 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 99322
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r55001 r55037 296 296 static FNSVMEXITHANDLER hmR0SvmExitXcptPF; 297 297 static FNSVMEXITHANDLER hmR0SvmExitXcptNM; 298 static FNSVMEXITHANDLER hmR0SvmExitXcptUD; 298 299 static FNSVMEXITHANDLER hmR0SvmExitXcptMF; 299 300 static FNSVMEXITHANDLER hmR0SvmExitXcptDB; … … 669 670 Assert(pVM->hm.s.svm.fSupported); 670 671 672 pVM->hm.s.fTrapXcptUD = GIMShouldTrapXcptUD(pVM); 673 uint32_t const fGimXcptIntercepts = pVM->hm.s.fTrapXcptUD ? RT_BIT(X86_XCPT_UD) : 0; 671 674 for (VMCPUID i = 0; i < pVM->cCpus; i++) 672 675 { … … 783 786 pVmcb->ctrl.u32InterceptCtrl1 |= SVM_CTRL1_INTERCEPT_TASK_SWITCH; 784 787 #endif 788 789 /* Apply the exceptions intercepts needed by the GIM provider. */ 790 pVmcb->ctrl.u32InterceptException |= fGimXcptIntercepts; 785 791 786 792 /* … … 3476 3482 return hmR0SvmExitXcptNM(pVCpu, pCtx, pSvmTransient); 3477 3483 3484 case SVM_EXIT_EXCEPTION_6: /* X86_XCPT_UD */ 3485 return hmR0SvmExitXcptUD(pVCpu, pCtx, pSvmTransient); 3486 3478 3487 case SVM_EXIT_EXCEPTION_10: /* X86_XCPT_MF */ 3479 3488 return hmR0SvmExitXcptMF(pVCpu, pCtx, pSvmTransient); … … 3582 3591 case SVM_EXIT_EXCEPTION_4: /* X86_XCPT_OF */ 3583 3592 case SVM_EXIT_EXCEPTION_5: /* X86_XCPT_BR */ 3584 case SVM_EXIT_EXCEPTION_6: /* X86_XCPT_UD*/3593 /* case SVM_EXIT_EXCEPTION_6: */ /* X86_XCPT_UD - Handled above. */ 3585 3594 /* SVM_EXIT_EXCEPTION_7: */ /* X86_XCPT_NM - Handled above. */ 3586 3595 case SVM_EXIT_EXCEPTION_8: /* X86_XCPT_DF */ … … 3619 3628 /** @todo Investigate this later. */ 3620 3629 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitGuestBP); 3621 break;3622 3623 case X86_XCPT_UD:3624 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitGuestUD);3625 3630 break; 3626 3631 … … 4152 4157 { 4153 4158 PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb; 4159 Assert(pVmcb->ctrl.u64NextRIP - pCtx->rip == cb); 4154 4160 pCtx->rip = pVmcb->ctrl.u64NextRIP; 4155 4161 } … … 5003 5009 if (GIMAreHypercallsEnabled(pVCpu)) 5004 5010 rc = GIMHypercall(pVCpu, pCtx); 5005 } 5006 5007 if (rc != VINF_SUCCESS) 5011 5012 /* If the hypercall changes anything other than guest general-purpose registers, 5013 we would need to reload the guest changed bits on VM-reentry. */ 5014 } 5015 5016 if (RT_SUCCESS(rc)) 5017 hmR0SvmUpdateRip(pVCpu, pCtx, 3); 5018 else 5008 5019 hmR0SvmSetPendingXcptUD(pVCpu); 5009 5020 return VINF_SUCCESS; … … 5202 5213 5203 5214 /** 5215 * #VMEXIT handler for undefined opcode (SVM_EXIT_EXCEPTION_6). 5216 * Conditional #VMEXIT. 5217 */ 5218 HMSVM_EXIT_DECL hmR0SvmExitXcptUD(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient) 5219 { 5220 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); 5221 5222 HMSVM_CHECK_EXIT_DUE_TO_EVENT_DELIVERY(); 5223 5224 STAM_COUNTER_INC(&pVCpu->hm.s.StatExitGuestUD); 5225 5226 PVM pVM = pVCpu->CTX_SUFF(pVM); 5227 if ( pVM->hm.s.fTrapXcptUD 5228 && GIMAreHypercallsEnabled(pVCpu)) 5229 { 5230 int rc = GIMXcptUD(pVCpu, pCtx); 5231 if (RT_SUCCESS(rc)) 5232 { 5233 /* If the exception handler changes anything other than guest general-purpose registers, 5234 we would need to reload the guest changed bits on VM-reentry. */ 5235 hmR0SvmUpdateRip(pVCpu, pCtx, 3); 5236 return VINF_SUCCESS; 5237 } 5238 } 5239 5240 hmR0SvmSetPendingXcptUD(pVCpu); 5241 return VINF_SUCCESS; 5242 } 5243 5244 5245 /** 5204 5246 * #VMEXIT handler for math-fault exceptions (SVM_EXIT_EXCEPTION_10). 5205 5247 * Conditional #VMEXIT.
Note:
See TracChangeset
for help on using the changeset viewer.