VirtualBox

Changeset 51421 in vbox


Ignore:
Timestamp:
May 27, 2014 10:59:35 AM (11 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: Check single-step only on success and update HMCPU force-flags when continuing in ring-0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp

    r51230 r51421  
    44164416        {
    44174417            rc = VBOXSTRICTRC_TODO(EMInterpretInstruction(pVCpu, CPUMCTX2CORE(pCtx), 0 /* pvFault */));
    4418             if (RT_UNLIKELY(rc != VINF_SUCCESS))
     4418            if (RT_LIKELY(rc == VINF_SUCCESS))
     4419                HMSVM_CHECK_SINGLE_STEP(pVCpu, rc);     /* RIP updated by EMInterpretInstruction(). */
     4420            else
    44194421                AssertMsg(rc == VERR_EM_INTERPRETER, ("hmR0SvmExitMsr: WrMsr. EMInterpretInstruction failed rc=%Rrc\n", rc));
    4420             /* RIP updated by EMInterpretInstruction(). */
    4421             HMSVM_CHECK_SINGLE_STEP(pVCpu, rc);
    4422         }
    4423 
    4424         /* If this is an X2APIC WRMSR access, update the APIC state as well. */
    4425         if (   pCtx->ecx >= MSR_IA32_X2APIC_START
    4426             && pCtx->ecx <= MSR_IA32_X2APIC_END)
    4427         {
    4428             /*
    4429              * We've already saved the APIC related guest-state (TPR) in hmR0SvmPostRunGuest(). When full APIC register
    4430              * virtualization is implemented we'll have to make sure APIC state is saved from the VMCB before
    4431              * EMInterpretWrmsr() changes it.
    4432              */
    4433             HMCPU_CF_SET(pVCpu, HM_CHANGED_SVM_GUEST_APIC_STATE);
    4434         }
    4435         else if (pCtx->ecx == MSR_K6_EFER)
    4436             HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_EFER_MSR);
    4437         else if (pCtx->ecx == MSR_IA32_TSC)
    4438             pSvmTransient->fUpdateTscOffsetting = true;
     4422        }
     4423
     4424        if (rc == VINF_SUCCESS)
     4425        {
     4426            /* If this is an X2APIC WRMSR access, update the APIC state as well. */
     4427            if (   pCtx->ecx >= MSR_IA32_X2APIC_START
     4428                && pCtx->ecx <= MSR_IA32_X2APIC_END)
     4429            {
     4430                /*
     4431                 * We've already saved the APIC related guest-state (TPR) in hmR0SvmPostRunGuest(). When full APIC register
     4432                 * virtualization is implemented we'll have to make sure APIC state is saved from the VMCB before
     4433                 * EMInterpretWrmsr() changes it.
     4434                 */
     4435                HMCPU_CF_SET(pVCpu, HM_CHANGED_SVM_GUEST_APIC_STATE);
     4436            }
     4437            else if (pCtx->ecx == MSR_K6_EFER)
     4438                HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_EFER_MSR);
     4439            else if (pCtx->ecx == MSR_IA32_TSC)
     4440                pSvmTransient->fUpdateTscOffsetting = true;
     4441        }
    44394442    }
    44404443    else
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