VirtualBox

Changeset 2062 in vbox


Ignore:
Timestamp:
Apr 13, 2007 8:33:44 AM (18 years ago)
Author:
vboxsync
Message:

TSC offset initialized on entry.

Location:
trunk/src/VBox/VMM/VMMR0
Files:
2 edited

Legend:

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

    r1585 r2062  
    484484    pVMCB->ctrl.TLBCtrl.n.u32ASID = 1;
    485485
    486     /** @todo TSC offset. */
    487     pVMCB->ctrl.u64TSCOffset = 0;
     486    /** TSC offset. */
     487    pVMCB->ctrl.u64TSCOffset = TMCpuTickGetOffset(pVM);
    488488
    489489    /** @todo 64 bits stuff (?):
  • trunk/src/VBox/VMM/VMMR0/HWVMXR0.cpp

    r1793 r2062  
    188188    /* Init TSC offset to zero. */
    189189    rc  = VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_FULL, 0);
     190#if HC_ARCH_BITS == 32
    190191    rc |= VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_HIGH, 0);
     192#endif
    191193    AssertRC(rc);
    192194
     
    744746    AssertRC(rc);
    745747
    746     /** @todo TSC offset. */
     748    /** TSC offset. */
     749    uint64_t u64TSCOffset = TMCpuTickGetOffset(pVM);
     750
     751#if HC_ARCH_BITS == 64
     752    rc  = VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_FULL, u64TSCOffset);
     753#else
     754    rc  = VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_FULL, (uint32_t)u64TSCOffset);
     755    rc |= VMXWriteVMCS(VMX_VMCS_CTRL_TSC_OFFSET_HIGH, (uint32_t)(u64TSCOffset >> 32ULL));
     756#endif
     757    AssertRC(rc);
     758
    747759
    748760    /* Done. */
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