Changeset 53235 in vbox for trunk/src/VBox/VMM/VMMR0
- Timestamp:
- Nov 5, 2014 12:56:17 PM (10 years ago)
- Location:
- trunk/src/VBox/VMM/VMMR0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HMSVMR0.cpp
r53197 r53235 2262 2262 uint64_t u64CurTSC = ASMReadTSC(); 2263 2263 uint64_t u64LastTick = TMCpuTickGetLastSeen(pVCpu); 2264 if (fParavirtTsc)2265 {2266 #if 02267 if (u64CurTSC - pVmcb->ctrl.u64TSCOffset < u64LastTick)2268 {2269 pVmcb->ctrl.u64TSCOffset = u64CurTSC - u64LastTick;2270 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffsetAdjusted);2271 }2272 int rc = GIMR0UpdateParavirtTsc(pVCpu->CTX_SUFF(pVM), pVmcb->ctrl.u64TSCOffset);2273 AssertRC(rc);2274 #endif2275 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscParavirt);2276 }2277 2264 2278 2265 if (u64CurTSC - pVmcb->ctrl.u64TSCOffset >= TMCpuTickGetLastSeen(pVCpu)) … … 2295 2282 pVmcb->ctrl.u32InterceptCtrl2 |= SVM_CTRL2_INTERCEPT_RDTSCP; 2296 2283 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscIntercept); 2284 } 2285 2286 if (fParavirtTsc) 2287 { 2288 int rc = GIMR0UpdateParavirtTsc(pVCpu->CTX_SUFF(pVM), 0 /* u64Offset */); 2289 AssertRC(rc); 2290 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscParavirt); 2297 2291 } 2298 2292 -
trunk/src/VBox/VMM/VMMR0/HMVMXR0.cpp
r53200 r53235 5622 5622 if (fParavirtTsc) 5623 5623 { 5624 /** @todo this is a hack until TM switches to pure-offsetting mode. */ 5625 uint64_t const u64CurTsc = ASMReadTSC(); 5626 uint64_t const u64LastTick = TMCpuTickGetLastSeen(pVCpu); 5627 if (u64CurTsc - pVCpu->hm.s.vmx.u64TSCOffset < u64LastTick) 5628 { 5629 pVCpu->hm.s.vmx.u64TSCOffset = u64CurTsc - u64LastTick; 5630 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscOffsetAdjusted); 5631 } 5632 5633 Assert(u64CurTsc - pVCpu->hm.s.vmx.u64TSCOffset >= u64LastTick); 5634 rc = GIMR0UpdateParavirtTsc(pVM, pVCpu->hm.s.vmx.u64TSCOffset); 5624 rc = GIMR0UpdateParavirtTsc(pVM, 0 /* u64Offset */); 5635 5625 AssertRC(rc); 5636 /* Note: VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT takes precedence over TSC_OFFSET, applies to RDTSCP too. */5637 rc = VMXWriteVmcs64(VMX_VMCS64_CTRL_TSC_OFFSET_FULL, 0); AssertRC(rc);5638 5639 pVCpu->hm.s.vmx.u32ProcCtls &= ~VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT;5640 rc = VMXWriteVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, pVCpu->hm.s.vmx.u32ProcCtls); AssertRC(rc);5641 5626 STAM_COUNTER_INC(&pVCpu->hm.s.StatTscParavirt); 5642 5627 } 5643 else if (fOffsettedTsc) 5628 5629 if (fOffsettedTsc) 5644 5630 { 5645 5631 uint64_t u64CurTSC = ASMReadTSC();
Note:
See TracChangeset
for help on using the changeset viewer.