Changeset 79600 in vbox
- Timestamp:
- Jul 8, 2019 4:11:15 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h
r79573 r79600 2518 2518 } 2519 2519 2520 /* Paranoia. */ 2521 Assert(uExitReason != VMX_EXIT_XCPT_OR_NMI || VMX_EXIT_INT_INFO_IS_VALID(pVmcs->u32RoExitIntInfo)); 2522 2520 2523 /* 2521 2524 * Save the guest state back into the VMCS. … … 3420 3423 * 3421 3424 * @returns VBox strict status code. 3422 * @param pVCpu The cross context virtual CPU structure.3423 * @param pExitInfo Pointer to the VM-exit information.3424 * @param pExitEventInfo Pointer to the VM-exit event information.3425 * @param pVCpu The cross context virtual CPU structure. 3426 * @param pExitInfo Pointer to the VM-exit information. 3427 * @param pExitEventInfo Pointer to the VM-exit event information. 3425 3428 */ 3426 3429 IEM_STATIC VBOXSTRICTRC iemVmxVmexitTaskSwitchWithInfo(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo, 3427 3430 PCVMXVEXITEVENTINFO pExitEventInfo) 3428 3431 { 3429 /* The Exit qualification is mandatory for all task-switch VM-exits. */ 3430 uint64_t const u64ExitQual = pExitInfo->u64Qual; 3431 iemVmxVmcsSetExitQual(pVCpu, u64ExitQual); 3432 3433 /* 3434 * Figure out if an instruction was the source of the task switch. 3435 * 3436 * If the task-switch was due to CALL/IRET/JMP instruction or due to the delivery 3437 * of an event generated by a software interrupt (INT-N), privileged software 3438 * interrupt (INT1/ICEBP) or software exception (INT3/INTO) then the CPU provides 3439 * the instruction length. 3440 */ 3441 bool fHasInstrLen; 3442 if (VMX_EXIT_QUAL_TASK_SWITCH_TYPE(u64ExitQual) == VMX_EXIT_QUAL_TASK_SWITCH_TYPE_IDT) 3443 { 3444 /* Check if an event delivery through IDT caused a task switch VM-exit. */ 3445 uint32_t const uIdtVectInfo = pExitEventInfo->uIdtVectoringInfo; 3446 bool const fIdtVectInfoValid = VMX_IDT_VECTORING_INFO_IS_VALID(uIdtVectInfo); 3447 if (fIdtVectInfoValid) 3448 { 3449 iemVmxVmcsSetIdtVectoringInfo(pVCpu, uIdtVectInfo); 3450 if (VMX_IDT_VECTORING_INFO_IS_ERROR_CODE_VALID(uIdtVectInfo)) 3451 iemVmxVmcsSetIdtVectoringErrCode(pVCpu, pExitEventInfo->uIdtVectoringErrCode); 3452 3453 uint8_t const fIdtVectType = VMX_IDT_VECTORING_INFO_TYPE(uIdtVectInfo); 3454 if ( fIdtVectType == VMX_IDT_VECTORING_INFO_TYPE_SW_INT 3455 || fIdtVectType == VMX_IDT_VECTORING_INFO_TYPE_PRIV_SW_XCPT 3456 || fIdtVectType == VMX_IDT_VECTORING_INFO_TYPE_SW_XCPT) 3457 fHasInstrLen = true; 3458 else 3459 fHasInstrLen = false; 3460 } 3461 else 3462 fHasInstrLen = false; 3463 } 3464 else 3465 { 3466 /* CALL, IRET or JMP instruction caused the task switch VM-exit. */ 3467 fHasInstrLen = true; 3468 } 3469 3470 if (fHasInstrLen) 3471 { 3472 Assert(pExitInfo->cbInstr > 0); 3473 iemVmxVmcsSetExitInstrLen(pVCpu, pExitInfo->cbInstr); 3474 } 3475 return iemVmxVmexit(pVCpu, VMX_EXIT_TASK_SWITCH, u64ExitQual); 3432 Assert(pExitInfo->uReason == VMX_EXIT_TASK_SWITCH); 3433 iemVmxVmcsSetExitInstrLen(pVCpu, pExitInfo->cbInstr); 3434 iemVmxVmcsSetIdtVectoringInfo(pVCpu, pExitEventInfo->uIdtVectoringInfo); 3435 iemVmxVmcsSetIdtVectoringErrCode(pVCpu, pExitEventInfo->uIdtVectoringErrCode); 3436 return iemVmxVmexit(pVCpu, VMX_EXIT_TASK_SWITCH, pExitInfo->u64Qual); 3476 3437 } 3477 3438
Note:
See TracChangeset
for help on using the changeset viewer.

