Changeset 46869 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jun 28, 2013 3:37:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r46850 r46869 195 195 /** Whether the TSC offset mode needs to be updated. */ 196 196 bool fUpdateTscOffsetting; 197 /** Whether the TSC_AUX MSR needs restoring on #VMEXIT. */ 198 bool fRestoreTscAuxMsr; 197 199 } SVMTRANSIENT, *PSVMTRANSIENT; 198 200 /** @} */ … … 2620 2622 * This should be done -after- any RDTSCPs for obtaining the host timestamp (TM, STAM etc). 2621 2623 */ 2624 pSvmTransient->fRestoreTscAuxMsr = false; 2622 2625 if ( (pVM->hm.s.cpuid.u32AMDFeatureEDX & X86_CPUID_EXT_FEATURE_EDX_RDTSCP) 2623 2626 && !(pVmcb->ctrl.u32InterceptCtrl2 & SVM_CTRL2_INTERCEPT_RDTSCP)) … … 2627 2630 int rc2 = CPUMQueryGuestMsr(pVCpu, MSR_K8_TSC_AUX, &u64GuestTscAux); 2628 2631 AssertRC(rc2); 2629 ASMWrMsr(MSR_K8_TSC_AUX, u64GuestTscAux); 2632 if (u64GuestTscAux != pVCpu->hm.s.u64HostTscAux) 2633 { 2634 ASMWrMsr(MSR_K8_TSC_AUX, u64GuestTscAux); 2635 pSvmTransient->fRestoreTscAuxMsr = true; 2636 } 2630 2637 } 2631 2638 } … … 2684 2691 pVmcb->ctrl.u64VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL; /* Mark the VMCB-state cache as unmodified by VMM. */ 2685 2692 2693 if (pSvmTransient->fRestoreTscAuxMsr) 2694 ASMWrMsr(MSR_K8_TSC_AUX, pVCpu->hm.s.u64HostTscAux); 2695 2686 2696 if (!(pVmcb->ctrl.u32InterceptCtrl1 & SVM_CTRL1_INTERCEPT_RDTSC)) 2687 2697 { 2688 /* Restore host's TSC_AUX if required. */2689 if (pVM->hm.s.cpuid.u32AMDFeatureEDX & X86_CPUID_EXT_FEATURE_EDX_RDTSCP)2690 ASMWrMsr(MSR_K8_TSC_AUX, pVCpu->hm.s.u64HostTscAux);2691 2692 2698 /** @todo Find a way to fix hardcoding a guestimate. */ 2693 2699 TMCpuTickSetLastSeen(pVCpu, ASMReadTSC() + pVmcb->ctrl.u64TSCOffset - 0x400);
Note:
See TracChangeset
for help on using the changeset viewer.