Negative ping times in Windows VM’s – whats up?


Just a quick blog post that might help you resolve an issue that some customers have seen running under Hyper-V VM’s.  The issue is negative ping times on multi-processor guests.


If you see negative ping times in multiprocessor W2k3 guest OSes you might consider setting the /usepmtimer in the boot.ini file. 


The root issue comes about from the Win32 QueryPerformanceCounter function.  By default it uses a time source called the TSC.  This is a CPU time source that essentially counts CPU cycles.  The TSC for each (virtual) processor can be different so there is no guarantee that reading TSC on one processor has anything to do with reading TSC on another processor.  This means back to back reads of TSC on different VP’s can actually go backwards.  Hyper-V guarantees that TSC will not go backwards on a single VP.


So here the problem with negative ping times is the time source is using QueryPerformanceCounter which is using TSC.  By using the /usepmtimer boot.ini flag you change the time source for QueryPerformanceCounter from TSC to the PM timer which is a global time source.


  – Tony Voellm

Comments (10)

  1. eranb says:

    Hi,

    Is the PMTIMer virtualized per guest or is it routed (Via hyper-call) to a root partition reliable time source. If that is the case, what is the root partition time source (HPET,PMTimer,TSC,…)

    Thanks,

    Eran.

  2. eranb says:

    Hi,

    Is the PMTIMer virtualized per guest or is it routed (Via hyper-call) to a root partition reliable time source. If that is the case, what is the root partition time source (HPET,PMTimer,TSC,…)

    Thanks,

    Eran.

  3. A friend of mine from the Visual Studio group just came to me with an issue they’re having on some Windows

  4. There have been a number of issues with time in W2k3 guests, the first of which was covered in http://blogs.msdn.com/tvoellm/archive/2008/06/05/negative-ping-times-in-windows-vm-s-whats-up.aspx

  5. If you’re running Windows Server 2003 in a Hyper-V VM and have the VM configured to use multiple virtual

  6. Greg Martin says:

    This is a problem with Win2k3 domain member servers.  Since ping is used to detect domain controllers, you get a Userenv event 1054 which stop Group policy processing

  7. Troy says:

    Hello,

    I just bought a new Quad Core PC and am observing the same problem. Processor is Intel Core2 Quad CPU (Q9400 @ 2.66GHz). It has 4 cores.

    I read about AMD requiring this fix and am not sure if Intel processors require the same fix.

    Also, can changing to PM Timer have any side effects on performance?

    Thanks!

  8. Tony says:

    Does this problem exist with Windows Server 2008? We are noticing this problem on the Amazon EC instances with Windows Server 2008

     [Tony’s reply]  This issue does not exist with Windows 2008 on Hyper-V.  Amazon EC2 does not use Hyper-V do I cant really speak to the core issue.

  9. Bryce says:

    I'm seeing this issue on a Windows Server 2008 R2 host machine running a Windows XP guest with 2 virtual processors.  Anyone know if this has a hotfix from Microsoft?

  10. vijay says:

    hi my vmware virtual machine ( win2k3 sp2) its shows uptime in neagtive.