VirtualBox

Changeset 79600 in vbox


Ignore:
Timestamp:
Jul 8, 2019 4:11:15 PM (5 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 Caller provides all necessary valid info. for iemVmxVmexitTaskSwitchWithInfo. Assertions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r79573 r79600  
    25182518    }
    25192519
     2520    /* Paranoia. */
     2521    Assert(uExitReason != VMX_EXIT_XCPT_OR_NMI || VMX_EXIT_INT_INFO_IS_VALID(pVmcs->u32RoExitIntInfo));
     2522
    25202523    /*
    25212524     * Save the guest state back into the VMCS.
     
    34203423 *
    34213424 * @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.
    34253428 */
    34263429IEM_STATIC VBOXSTRICTRC iemVmxVmexitTaskSwitchWithInfo(PVMCPU pVCpu, PCVMXVEXITINFO pExitInfo,
    34273430                                                       PCVMXVEXITEVENTINFO pExitEventInfo)
    34283431{
    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);
    34763437}
    34773438
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette