VirtualBox

Changeset 74563 in vbox for trunk


Ignore:
Timestamp:
Oct 2, 2018 4:02:43 AM (6 years ago)
Author:
vboxsync
Message:

VMM/IEM: Nested VMX: bugref:9180 VM-exit bits; Added VMREAD, VMWRITE intercepts.

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

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

    r74541 r74563  
    62736273
    62746274    /*
    6275      * Do the job.
    6276      */
    6277     RTUINT64U uValue;
    6278     VBOXSTRICTRC rcStrict;
     6275     * Check nested-guest intercepts.
     6276     */
     6277#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     6278    if (   IEM_VMX_IS_NON_ROOT_MODE(pVCpu)
     6279        && iemVmxIsRdmsrWrmsrInterceptSet(pVCpu, VMX_EXIT_RDMSR, pVCpu->cpum.GstCtx.ecx))
     6280        IEM_VMX_VMEXIT_INSTR_RET(pVCpu, VMX_EXIT_RDMSR, cbInstr);
     6281#endif
     6282
    62796283#ifdef VBOX_WITH_NESTED_HWVIRT_SVM
    62806284    if (IEM_SVM_IS_CTRL_INTERCEPT_SET(pVCpu, SVM_CTRL_INTERCEPT_MSR_PROT))
    62816285    {
    6282         rcStrict = iemSvmHandleMsrIntercept(pVCpu, pVCpu->cpum.GstCtx.ecx, false /* fWrite */);
     6286        VBOXSTRICTRC rcStrict = iemSvmHandleMsrIntercept(pVCpu, pVCpu->cpum.GstCtx.ecx, false /* fWrite */);
    62836287        if (rcStrict == VINF_SVM_VMEXIT)
    62846288            return VINF_SUCCESS;
     
    62916295#endif
    62926296
     6297    /*
     6298     * Do the job.
     6299     */
     6300    RTUINT64U uValue;
    62936301    /** @todo make CPUMAllMsrs.cpp import the necessary MSR state. */
    62946302    IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_ALL_MSRS);
    62956303
    6296     rcStrict = CPUMQueryGuestMsr(pVCpu, pVCpu->cpum.GstCtx.ecx, &uValue.u);
     6304    VBOXSTRICTRC rcStrict = CPUMQueryGuestMsr(pVCpu, pVCpu->cpum.GstCtx.ecx, &uValue.u);
    62976305    if (rcStrict == VINF_SUCCESS)
    62986306    {
     
    63416349
    63426350    /*
     6351     * Check nested-guest intercepts.
     6352     */
     6353#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     6354    if (   IEM_VMX_IS_NON_ROOT_MODE(pVCpu)
     6355        && iemVmxIsRdmsrWrmsrInterceptSet(pVCpu, VMX_EXIT_WRMSR, pVCpu->cpum.GstCtx.ecx))
     6356        IEM_VMX_VMEXIT_INSTR_RET(pVCpu, VMX_EXIT_WRMSR, cbInstr);
     6357#endif
     6358
     6359#ifdef VBOX_WITH_NESTED_HWVIRT_SVM
     6360    if (IEM_SVM_IS_CTRL_INTERCEPT_SET(pVCpu, SVM_CTRL_INTERCEPT_MSR_PROT))
     6361    {
     6362        VBOXSTRICTRC rcStrict = iemSvmHandleMsrIntercept(pVCpu, pVCpu->cpum.GstCtx.ecx, true /* fWrite */);
     6363        if (rcStrict == VINF_SVM_VMEXIT)
     6364            return VINF_SUCCESS;
     6365        if (rcStrict != VINF_HM_INTERCEPT_NOT_ACTIVE)
     6366        {
     6367            Log(("IEM: SVM intercepted rdmsr(%#x) failed. rc=%Rrc\n", pVCpu->cpum.GstCtx.ecx, VBOXSTRICTRC_VAL(rcStrict)));
     6368            return rcStrict;
     6369        }
     6370    }
     6371#endif
     6372
     6373    /*
    63436374     * Do the job.
    63446375     */
     
    63476378    uValue.s.Hi = pVCpu->cpum.GstCtx.edx;
    63486379
    6349     VBOXSTRICTRC rcStrict;
    6350 #ifdef VBOX_WITH_NESTED_HWVIRT_SVM
    6351     if (IEM_SVM_IS_CTRL_INTERCEPT_SET(pVCpu, SVM_CTRL_INTERCEPT_MSR_PROT))
    6352     {
    6353         rcStrict = iemSvmHandleMsrIntercept(pVCpu, pVCpu->cpum.GstCtx.ecx, true /* fWrite */);
    6354         if (rcStrict == VINF_SVM_VMEXIT)
    6355             return VINF_SUCCESS;
    6356         if (rcStrict != VINF_HM_INTERCEPT_NOT_ACTIVE)
    6357         {
    6358             Log(("IEM: SVM intercepted rdmsr(%#x) failed. rc=%Rrc\n", pVCpu->cpum.GstCtx.ecx, VBOXSTRICTRC_VAL(rcStrict)));
    6359             return rcStrict;
    6360         }
    6361     }
    6362 #endif
    6363 
    63646380    /** @todo make CPUMAllMsrs.cpp import the necessary MSR state. */
    63656381    IEM_CTX_IMPORT_RET(pVCpu, CPUMCTX_EXTRN_ALL_MSRS);
    63666382
    6367     rcStrict = CPUMSetGuestMsr(pVCpu, pVCpu->cpum.GstCtx.ecx, uValue.u);
     6383    VBOXSTRICTRC rcStrict = CPUMSetGuestMsr(pVCpu, pVCpu->cpum.GstCtx.ecx, uValue.u);
    63686384    if (rcStrict == VINF_SUCCESS)
    63696385    {
  • trunk/src/VBox/VMM/VMMAll/IEMAllCImplVmxInstr.cpp.h

    r74562 r74563  
    3737 *  VMX_EXIT_MOV_DRX
    3838 *  VMX_EXIT_IO_INSTR
    39  *  VMX_EXIT_RDMSR
    40  *  VMX_EXIT_WRMSR
    4139 *  VMX_EXIT_MWAIT
    4240 *  VMX_EXIT_MTF
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