Changeset 70005 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Dec 8, 2017 7:59:16 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r70004 r70005 335 335 static FNSVMEXITHANDLER hmR0SvmExitInvlpga; 336 336 static FNSVMEXITHANDLER hmR0SvmExitVmrun; 337 static FNSVMEXITHANDLER hmR0SvmExitXcptGeneric; 337 338 static FNSVMEXITHANDLER hmR0SvmNestedExitXcptDB; 338 339 static FNSVMEXITHANDLER hmR0SvmNestedExitXcptBP; … … 4891 4892 4892 4893 case SVM_EXIT_INTR: 4894 case SVM_EXIT_NMI: 4895 { 4896 /* We shouldn't direct physical interrupts, NMIs to the nested-guest. */ 4897 return hmR0SvmExitIntr(pVCpu, pCtx, pSvmTransient); 4898 } 4899 4893 4900 case SVM_EXIT_FERR_FREEZE: 4894 case SVM_EXIT_NMI:4895 {4896 /* We shouldn't direct physical interrupts, NMI, FERR to the nested-guest. */4901 { 4902 if (HMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx, SVM_CTRL_INTERCEPT_VINTR)) 4903 return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2); 4897 4904 return hmR0SvmExitIntr(pVCpu, pCtx, pSvmTransient); 4898 4905 } … … 4968 4975 if (HMIsGuestSvmXcptInterceptSet(pVCpu, pCtx, uVector)) 4969 4976 return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2); 4970 /** @todo Write hmR0SvmExitXcptGeneric! */ 4971 return VERR_NOT_IMPLEMENTED; 4977 return hmR0SvmExitXcptGeneric(pVCpu, pCtx, pSvmTransient); 4972 4978 } 4973 4979 … … 4998 5004 return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2); 4999 5005 return hmR0SvmExitShutdown(pVCpu, pCtx, pSvmTransient); 5000 }5001 5002 case SVM_EXIT_SMI:5003 {5004 if (HMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx, SVM_CTRL_INTERCEPT_SMI))5005 return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);5006 return hmR0SvmExitUnexpected(pVCpu, pCtx, pSvmTransient);5007 }5008 5009 case SVM_EXIT_INIT:5010 {5011 if (HMIsGuestSvmCtrlInterceptSet(pVCpu, pCtx, SVM_CTRL_INTERCEPT_INIT))5012 return HM_SVM_VMEXIT_NESTED(pVCpu, uExitCode, uExitInfo1, uExitInfo2);5013 return hmR0SvmExitUnexpected(pVCpu, pCtx, pSvmTransient);5014 5006 } 5015 5007 … … 5079 5071 } 5080 5072 5081 case SVM_EXIT_NPF: 5073 case SVM_EXIT_SMI: 5074 case SVM_EXIT_INIT: 5075 case SVM_EXIT_NPF: /* We don't yet support nested-paging for nested-guests, so this should never happen. */ 5082 5076 { 5083 /* We don't yet support nested-paging for nested-guests, so this should never really happen. */5084 5077 return hmR0SvmExitUnexpected(pVCpu, pCtx, pSvmTransient); 5085 5078 } … … 7492 7485 7493 7486 /** 7487 * \#VMEXIT handler for generic exceptions. Conditional \#VMEXIT. 7488 */ 7489 HMSVM_EXIT_DECL hmR0SvmExitXcptGeneric(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient) 7490 { 7491 HMSVM_VALIDATE_EXIT_HANDLER_PARAMS(); 7492 7493 /** @todo if triple-fault is returned in nested-guest scenario convert to a 7494 * shutdown VMEXIT. */ 7495 HMSVM_CHECK_EXIT_DUE_TO_EVENT_DELIVERY(); 7496 7497 PSVMVMCB pVmcb = hmR0SvmGetCurrentVmcb(pVCpu, pCtx); 7498 uint8_t const uVector = pVmcb->ctrl.u64ExitCode - SVM_EXIT_EXCEPTION_0; 7499 uint32_t const uErrCode = pVmcb->ctrl.u64ExitInfo1; 7500 Assert(pSvmTransient->u64ExitCode == pVmcb->ctrl.u64ExitCode); 7501 Assert(uVector <= X86_XCPT_LAST); 7502 7503 SVMEVENT Event; 7504 Event.u = 0; 7505 Event.n.u1Valid = 1; 7506 Event.n.u3Type = SVM_EVENT_EXCEPTION; 7507 Event.n.u8Vector = uVector; 7508 switch (uVector) 7509 { 7510 case X86_XCPT_PF: 7511 case X86_XCPT_DF: 7512 case X86_XCPT_TS: 7513 case X86_XCPT_NP: 7514 case X86_XCPT_SS: 7515 case X86_XCPT_GP: 7516 case X86_XCPT_AC: 7517 { 7518 Event.n.u1ErrorCodeValid = 1; 7519 Event.n.u32ErrorCode = uErrCode; 7520 break; 7521 } 7522 } 7523 7524 hmR0SvmSetPendingEvent(pVCpu, &Event, 0 /* GCPtrFaultAddress */); 7525 return VINF_SUCCESS; 7526 } 7527 7528 7529 /** 7494 7530 * Nested-guest \#VMEXIT handler for debug exceptions (SVM_EXIT_EXCEPTION_1). 7495 7531 * Unconditional \#VMEXIT.
Note:
See TracChangeset
for help on using the changeset viewer.