[RFC: 0/2] patch for QEMU HPET periodic timer emulation to alleviate time drift

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am observing severe backward time drift in a MS Windows Vista(tm)
guest running on a Fedora 14 KVM host. I can reproduce the problem
with the following steps:

1. Use 'vncviewer' to connect to the guest's desktop.
2. Click on the menu title bar of a window on the guest's desktop.
3. Move that window around on the guest's desktop.

While I keep on moving the window around for one minute, the guest
time falls up to 15 seconds behind host time.

The problem is caused by delayed callbacks of hpet_timer(). A timer
interrupt is injected into the guest during each callback. However,
interrupts are lost if delays are greater than a comparator period.


This is an RFC through which I would like to get feedback on how the
idea of a patch to compensate those lost interrupts would be received:

The patch determines the number of lost timer interrupts based on the
number of elapsed comparator periods. Lost interrupts are compensated
by gradually injecting additional interrupts during the subsequent
timer intervals, starting at a rate of one additional interrupt per
interval. If further interrupts are lost while compensation is still
in progress, the rate is increased. The algorithm imposes a limit on
the rate and on the 'backlog' of lost interrupts to be injected. The
patch can be enabled via a qemu command line option.

  -hpet [device=none|present][,driftfix=none|slew]

The 'device=none' option is equivalent to the '-no-hpet' option, and
the 'driftfix=slew' option enables the patch (similar to RTC).


The second and third part of this series of email contain the patch:

- Code part 1 introduces the qemu command line option.
- Code part 2 implements compensation of lost interrupts.

Please review and please comment.


With the patch enabled, I'm not observing any drift after one minute
of testing (as outlined above). I'm not using a fine grained method
to check the drift, just looking at the hrs:min:sec of the guest's
and the host's clock. If there is still some drift, it's apparently
less than a second.


Regards,

Uli Obergfell
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux