- Timestamp:
- Aug 4, 2017 11:49:23 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r68293 r68301 4327 4327 Assert(pSvmTransient->u64ExitCode <= SVM_EXIT_MAX); 4328 4328 4329 #define HM_SVM_HANDLE_XCPT_EXIT_NESTED(a_uXcpt, a_XcptExitFn) \ 4330 do \ 4331 { \ 4332 if (pVmcbNstGstCache->u32InterceptXcpt & RT_BIT(a_uXcpt)) \ 4333 return hmR0SvmExecVmexit(pVCpu, pCtx); \ 4334 return a_XcptExitFn(pVCpu, pCtx, pSvmTransient); \ 4335 } while (0) \ 4336 4329 4337 /* 4330 4338 * For all the #VMEXITs here we primarily figure out if the #VMEXIT is expected … … 4363 4371 return hmR0SvmExecVmexit(pVCpu, pCtx); 4364 4372 return hmR0SvmExitRdtscp(pVCpu, pCtx, pSvmTransient); 4373 } 4374 4375 4376 case SVM_EXIT_MONITOR: 4377 { 4378 if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_MONITOR) 4379 return hmR0SvmExecVmexit(pVCpu, pCtx); 4380 return hmR0SvmExitMonitor(pVCpu, pCtx, pSvmTransient); 4381 } 4382 4383 case SVM_EXIT_MWAIT: 4384 { 4385 if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_MWAIT) 4386 return hmR0SvmExecVmexit(pVCpu, pCtx); 4387 return hmR0SvmExitMwait(pVCpu, pCtx, pSvmTransient); 4388 } 4389 4390 case SVM_EXIT_HLT: 4391 { 4392 if (pVmcbNstGstCache->u64InterceptCtrl & SVM_CTRL_INTERCEPT_HLT) 4393 return hmR0SvmExecVmexit(pVCpu, pCtx); 4394 return hmR0SvmExitHlt(pVCpu, pCtx, pSvmTransient); 4365 4395 } 4366 4396 … … 4415 4445 } 4416 4446 4417 /** @todo Exceptions. */4418 4447 case SVM_EXIT_EXCEPTION_14: /* X86_XCPT_PF */ 4419 return hmR0SvmExitXcptPF(pVCpu, pCtx, pSvmTransient); 4448 { 4449 Assert(!pVmcbNstGstCtrl->NestedPaging.n.u1NestedPaging); 4450 return hmR0SvmExecVmexit(pVCpu, pCtx); 4451 } 4420 4452 4421 4453 case SVM_EXIT_EXCEPTION_7: /* X86_XCPT_NM */ 4422 return hmR0SvmExitXcptNM(pVCpu, pCtx, pSvmTransient);4454 HM_SVM_HANDLE_XCPT_EXIT_NESTED(X86_XCPT_NM, hmR0SvmExitXcptNM); 4423 4455 4424 4456 case SVM_EXIT_EXCEPTION_6: /* X86_XCPT_UD */ 4425 return hmR0SvmExitXcptUD(pVCpu, pCtx, pSvmTransient);4457 HM_SVM_HANDLE_XCPT_EXIT_NESTED(X86_XCPT_UD, hmR0SvmExitXcptUD); 4426 4458 4427 4459 case SVM_EXIT_EXCEPTION_16: /* X86_XCPT_MF */ 4428 return hmR0SvmExitXcptMF(pVCpu, pCtx, pSvmTransient);4460 HM_SVM_HANDLE_XCPT_EXIT_NESTED(X86_XCPT_MF, hmR0SvmExitXcptMF); 4429 4461 4430 4462 case SVM_EXIT_EXCEPTION_1: /* X86_XCPT_DB */ 4431 return hmR0SvmExitXcptDB(pVCpu, pCtx, pSvmTransient);4463 HM_SVM_HANDLE_XCPT_EXIT_NESTED(X86_XCPT_DB, hmR0SvmExitXcptDB); 4432 4464 4433 4465 case SVM_EXIT_EXCEPTION_17: /* X86_XCPT_AC */ 4434 return hmR0SvmExitXcptAC(pVCpu, pCtx, pSvmTransient);4466 HM_SVM_HANDLE_XCPT_EXIT_NESTED(X86_XCPT_AC, hmR0SvmExitXcptAC); 4435 4467 4436 4468 case SVM_EXIT_EXCEPTION_3: /* X86_XCPT_BP */ 4437 return hmR0SvmExitXcptBP(pVCpu, pCtx, pSvmTransient); 4438 4439 case SVM_EXIT_MONITOR: 4440 return hmR0SvmExitMonitor(pVCpu, pCtx, pSvmTransient); 4441 4442 case SVM_EXIT_MWAIT: 4443 return hmR0SvmExitMwait(pVCpu, pCtx, pSvmTransient); 4444 4445 case SVM_EXIT_HLT: 4446 return hmR0SvmExitHlt(pVCpu, pCtx, pSvmTransient); 4469 HM_SVM_HANDLE_XCPT_EXIT_NESTED(X86_XCPT_BP, hmR0SvmExitXcptBP); 4447 4470 4448 4471 case SVM_EXIT_READ_CR0: 4449 4472 case SVM_EXIT_READ_CR3: 4450 4473 case SVM_EXIT_READ_CR4: 4474 { 4475 if (pVmcbNstGstCache->u16InterceptRdCRx & (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_READ_CR0))) 4476 hmR0SvmExecVmexit(pVCpu, pCtx); 4451 4477 return hmR0SvmExitReadCRx(pVCpu, pCtx, pSvmTransient); 4478 } 4452 4479 4453 4480 case SVM_EXIT_WRITE_CR0: … … 4455 4482 case SVM_EXIT_WRITE_CR4: 4456 4483 case SVM_EXIT_WRITE_CR8: 4484 { 4485 if (pVmcbNstGstCache->u16InterceptWrCRx & (1U << (uint16_t)(pSvmTransient->u64ExitCode - SVM_EXIT_WRITE_CR0))) 4486 hmR0SvmExecVmexit(pVCpu, pCtx); 4457 4487 return hmR0SvmExitWriteCRx(pVCpu, pCtx, pSvmTransient); 4488 } 4458 4489 4459 4490 case SVM_EXIT_PAUSE: … … 4624 4655 } 4625 4656 /* not reached */ 4657 4658 #undef HM_SVM_HANDLE_XCPT_EXIT_NESTED 4626 4659 } 4627 4660 #endif
Note:
See TracChangeset
for help on using the changeset viewer.