Changeset 70782 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jan 29, 2018 7:46:15 AM (7 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r70781 r70782 2715 2715 /** 2716 2716 * Applies the TSC offset of a nested-guest if any and returns the new TSC 2717 * value for the guest .2717 * value for the guest (or nested-guest). 2718 2718 * 2719 2719 * @returns The TSC offset after applying any nested-guest TSC offset. 2720 2720 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 2721 2721 * @param uTicks The guest TSC. 2722 * 2723 * @sa HMSvmNstGstApplyTscOffset. 2722 2724 */ 2723 2725 VMM_INT_DECL(uint64_t) CPUMApplyNestedGuestTscOffset(PVMCPU pVCpu, uint64_t uTicks) 2724 2726 { 2725 2727 #ifndef IN_RC 2726 PCCPUMCTX pCtx 2728 PCCPUMCTX pCtx = &pVCpu->cpum.s.Guest; 2727 2729 if (CPUMIsGuestInSvmNestedHwVirtMode(pCtx)) 2728 2730 { 2729 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 2730 return uTicks + pVmcb->ctrl.u64TSCOffset; 2731 if (!pCtx->hwvirt.svm.fHMCachedVmcb) 2732 { 2733 PCSVMVMCB pVmcb = pCtx->hwvirt.svm.CTX_SUFF(pVmcb); 2734 return uTicks + pVmcb->ctrl.u64TSCOffset; 2735 } 2736 return HMSvmNstGstApplyTscOffset(pVCpu, uTicks); 2731 2737 } 2732 2738 -
trunk/src/VBox/VMM/VMMAll/HMSVMAll.cpp
r70781 r70782 202 202 return HMIsEnabled(pVM) && fVGif && fUseVGif; 203 203 } 204 205 206 /** 207 * Applies the TSC offset of an SVM nested-guest if any and returns the new TSC 208 * value for the nested-guest. 209 * 210 * @returns The TSC offset after applying any nested-guest TSC offset. 211 * @param pVCpu The cross context virtual CPU structure of the calling EMT. 212 * @param uTicks The guest TSC. 213 * 214 * @remarks This function looks at the VMCB cache rather than directly at the 215 * nested-guest VMCB. The latter may have been modified for executing 216 * using hardware-assisted SVM. 217 * 218 * @sa CPUMApplyNestedGuestTscOffset. 219 */ 220 VMM_INT_DECL(uint64_t) HMSvmNstGstApplyTscOffset(PVMCPU pVCpu, uint64_t uTicks) 221 { 222 PCCPUMCTX pCtx = &pVCpu->cpum.GstCtx; 223 Assert(CPUMIsGuestInSvmNestedHwVirtMode(pCtx)); 224 Assert(pCtx->hwvirt.svm.fHMCachedVmcb); 225 NOREF(pCtx); 226 PCSVMNESTEDVMCBCACHE pVmcbNstGstCache = &pVCpu->hm.s.svm.NstGstVmcbCache; 227 return uTicks + pVmcbNstGstCache->u64TSCOffset; 228 } 204 229 #endif /* !IN_RC */ 205 230
Note:
See TracChangeset
for help on using the changeset viewer.