VirtualBox

Ignore:
Timestamp:
Oct 4, 2018 6:07:20 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
125486
Message:

VMM/IEM, HM: Nested VMX: bugref:9180 VM-exit bits; LMSW intercept. Separated VINF_HM_INTERCEPT_NOT_ACTIVE into VMX and SVM
specific codes. Adjusted IEMExecDecodedLmsw to supply the additional memory operand parameter from the VMCS guest-linear address
field.

File:
1 edited

Legend:

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

    r74592 r74603  
    57435743 *
    57445744 * @param   u16NewMsw       The new value.
    5745  */
    5746 IEM_CIMPL_DEF_1(iemCImpl_lmsw, uint16_t, u16NewMsw)
     5745 * @param   GCPtrEffDst     The guest-linear address of the source operand in case
     5746 *                          of a memory operand. For register operand, pass
     5747 *                          NIL_RTGCPTR.
     5748 */
     5749IEM_CIMPL_DEF_2(iemCImpl_lmsw, uint16_t, u16NewMsw, RTGCPTR, GCPtrEffDst)
    57475750{
    57485751    if (pVCpu->iem.s.uCpl != 0)
    57495752        return iemRaiseGeneralProtectionFault0(pVCpu);
    57505753    Assert(!pVCpu->cpum.GstCtx.eflags.Bits.u1VM);
     5754    IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_CR0);
     5755
     5756#ifdef VBOX_WITH_NESTED_HWVIRT_VMX
     5757    /* Check nested-guest VMX intercept and get updated MSW if there's no VM-exit. */
     5758    if (IEM_VMX_IS_NON_ROOT_MODE(pVCpu))
     5759    {
     5760        VBOXSTRICTRC rcStrict = iemVmxVmexitInstrLmsw(pVCpu, pVCpu->cpum.GstCtx.cr0, &u16NewMsw, GCPtrEffDst, cbInstr);
     5761        if (rcStrict != VINF_VMX_INTERCEPT_NOT_ACTIVE)
     5762            return rcStrict;
     5763    }
     5764#else
     5765    RT_NOREF_PV(GCPtrEffDst);
     5766#endif
    57515767
    57525768    /*
    57535769     * Compose the new CR0 value and call common worker.
    57545770     */
    5755     IEM_CTX_ASSERT(pVCpu, CPUMCTX_EXTRN_CR0);
    5756     uint64_t uNewCr0 = pVCpu->cpum.GstCtx.cr0     & ~(X86_CR0_MP | X86_CR0_EM | X86_CR0_TS);
     5771    uint64_t uNewCr0 = pVCpu->cpum.GstCtx.cr0  & ~(X86_CR0_MP | X86_CR0_EM | X86_CR0_TS);
    57575772    uNewCr0 |= u16NewMsw & (X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS);
    57585773    return IEM_CIMPL_CALL_4(iemCImpl_load_CrX, /*cr*/ 0, uNewCr0, IEMACCESSCRX_LMSW, UINT8_MAX /* iGReg */);
     
    63706385        if (rcStrict == VINF_SVM_VMEXIT)
    63716386            return VINF_SUCCESS;
    6372         if (rcStrict != VINF_HM_INTERCEPT_NOT_ACTIVE)
     6387        if (rcStrict != VINF_SVM_INTERCEPT_NOT_ACTIVE)
    63736388        {
    63746389            Log(("IEM: SVM intercepted rdmsr(%#x) failed. rc=%Rrc\n", pVCpu->cpum.GstCtx.ecx, VBOXSTRICTRC_VAL(rcStrict)));
     
    64466461        if (rcStrict == VINF_SVM_VMEXIT)
    64476462            return VINF_SUCCESS;
    6448         if (rcStrict != VINF_HM_INTERCEPT_NOT_ACTIVE)
     6463        if (rcStrict != VINF_SVM_INTERCEPT_NOT_ACTIVE)
    64496464        {
    64506465            Log(("IEM: SVM intercepted rdmsr(%#x) failed. rc=%Rrc\n", pVCpu->cpum.GstCtx.ecx, VBOXSTRICTRC_VAL(rcStrict)));
     
    65266541        if (rcStrict == VINF_SVM_VMEXIT)
    65276542            return VINF_SUCCESS;
    6528         if (rcStrict != VINF_HM_INTERCEPT_NOT_ACTIVE)
     6543        if (rcStrict != VINF_SVM_INTERCEPT_NOT_ACTIVE)
    65296544        {
    65306545            Log(("iemCImpl_in: iemSvmHandleIOIntercept failed (u16Port=%#x, cbReg=%u) rc=%Rrc\n", u16Port, cbReg,
     
    66196634        if (rcStrict == VINF_SVM_VMEXIT)
    66206635            return VINF_SUCCESS;
    6621         if (rcStrict != VINF_HM_INTERCEPT_NOT_ACTIVE)
     6636        if (rcStrict != VINF_SVM_INTERCEPT_NOT_ACTIVE)
    66226637        {
    66236638            Log(("iemCImpl_out: iemSvmHandleIOIntercept failed (u16Port=%#x, cbReg=%u) rc=%Rrc\n", u16Port, cbReg,
Note: See TracChangeset for help on using the changeset viewer.

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