VirtualBox

Changeset 49225 in vbox


Ignore:
Timestamp:
Oct 22, 2013 9:01:37 AM (11 years ago)
Author:
vboxsync
Message:

VMM/HMSVMR0: Fix TSC Aux MSR passthru.

File:
1 edited

Legend:

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

    r49159 r49225  
    29202920    AssertMsg(!VMCPU_HMCF_VALUE(pVCpu), ("fContextUseFlags=%#RX32\n", VMCPU_HMCF_VALUE(pVCpu)));
    29212921
    2922     /* If VMCB Clean Bits isn't supported by the CPU, simply mark all state-bits as dirty, indicating (re)load-from-VMCB. */
    2923     if (!(pVM->hm.s.svm.u32Features & AMD_CPUID_SVM_FEATURE_EDX_VMCB_CLEAN))
    2924         pVmcb->ctrl.u64VmcbCleanBits = 0;
    2925 
    29262922    /* Setup TSC offsetting. */
    29272923    if (   pSvmTransient->fUpdateTscOffsetting
     
    29672963        && !(pVmcb->ctrl.u32InterceptCtrl2 & SVM_CTRL2_INTERCEPT_RDTSCP))
    29682964    {
     2965        hmR0SvmSetMsrPermission(pVCpu, MSR_K8_TSC_AUX, SVMMSREXIT_PASSTHRU_READ, SVMMSREXIT_PASSTHRU_WRITE);
    29692966        pVCpu->hm.s.u64HostTscAux = ASMRdMsr(MSR_K8_TSC_AUX);
    29702967        uint64_t u64GuestTscAux = 0;
     
    29722969        AssertRC(rc2);
    29732970        if (u64GuestTscAux != pVCpu->hm.s.u64HostTscAux)
    2974         {
    29752971            ASMWrMsr(MSR_K8_TSC_AUX, u64GuestTscAux);
    2976             pSvmTransient->fRestoreTscAuxMsr = true;
    2977         }
    2978     }
     2972        pSvmTransient->fRestoreTscAuxMsr = true;
     2973    }
     2974    else
     2975        hmR0SvmSetMsrPermission(pVCpu, MSR_K8_TSC_AUX, SVMMSREXIT_INTERCEPT_READ, SVMMSREXIT_INTERCEPT_WRITE);
     2976
     2977    /* If VMCB Clean Bits isn't supported by the CPU, simply mark all state-bits as dirty, indicating (re)load-from-VMCB. */
     2978    if (!(pVM->hm.s.svm.u32Features & AMD_CPUID_SVM_FEATURE_EDX_VMCB_CLEAN))
     2979        pVmcb->ctrl.u64VmcbCleanBits = 0;
    29792980}
    29802981
     
    43594360            && pCtx->ecx <= MSR_IA32_X2APIC_END)
    43604361        {
    4361             /* We've already saved the APIC related guest-state (TPR) in hmR0SvmPostRunGuest(). When full APIC register
     4362            /*
     4363             * We've already saved the APIC related guest-state (TPR) in hmR0SvmPostRunGuest(). When full APIC register
    43624364             * virtualization is implemented we'll have to make sure APIC state is saved from the VMCB before
    4363                EMInterpretWrmsr() changes it. */
     4365             * EMInterpretWrmsr() changes it.
     4366             */
    43644367            VMCPU_HMCF_SET(pVCpu, HM_CHANGED_SVM_GUEST_APIC_STATE);
    43654368        }
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