VirtualBox

Changeset 45846 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Apr 30, 2013 4:48:09 PM (12 years ago)
Author:
vboxsync
Message:

VMM/HMVMXR0: Restore TSC_AUX properly when not using auto-load/store MSR feature.

File:
1 edited

Legend:

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

    r45845 r45846  
    66326632    if (!(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT))
    66336633    {
     6634#ifndef VBOX_WITH_AUTO_MSR_LOAD_RESTORE
     6635        /* Restore host's TSC_AUX. */
     6636        if (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP)
     6637            ASMWrMsr(MSR_K8_TSC_AUX, pVCpu->hm.s.u64HostTscAux);
     6638#endif
    66346639        /** @todo Find a way to fix hardcoding a guestimate.  */
    66356640        TMCpuTickSetLastSeen(pVCpu, ASMReadTSC()
     
    66406645    Assert(!(ASMGetFlags() & X86_EFL_IF));
    66416646    VMCPU_SET_STATE(pVCpu, VMCPUSTATE_STARTED_HM);
    6642 
    6643 #ifndef VBOX_WITH_AUTO_MSR_LOAD_RESTORE
    6644     /*
    6645      * Save the current Host TSC_AUX and write the guest TSC_AUX to the host, so that
    6646      * RDTSCPs (that don't cause exits) reads the guest MSR. See @bugref{3324}.
    6647      */
    6648     if (    (pVCpu->hm.s.vmx.u32ProcCtls2 & VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP)
    6649         && !(pVCpu->hm.s.vmx.u32ProcCtls & VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT))
    6650     {
    6651         pVCpu->hm.s.u64HostTscAux = ASMRdMsr(MSR_K8_TSC_AUX);
    6652         uint64_t u64HostTscAux = 0;
    6653         int rc2 = CPUMQueryGuestMsr(pVCpu, MSR_K8_TSC_AUX, &u64HostTscAux);
    6654         AssertRC(rc2);
    6655         ASMWrMsr(MSR_K8_TSC_AUX, u64HostTscAux);
    6656     }
    6657 #endif
    66586647
    66596648    /* Restore the effects of TPR patching if any. */
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