All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [0.14+master][PATCH 0/3] Let RTC follow backward jumps of host clock immediately
@ 2011-02-02  9:38 Jan Kiszka
  2011-02-02  9:38 ` [Qemu-devel] [0.14+master][PATCH 1/3] qemu-timer: Consolidate qemu_get_clock and qemu_get_clock_ns Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Kiszka @ 2011-02-02  9:38 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori; +Cc: Zachary Amsden, Gleb Natapov

By default, we base the mc146818 RTC on the host clock (CLOCK_REALTIME).
This works fine if only the frequency of the host clock is tuned (e.g.
by NTP) or if it is set to a future time. However, if the host is tuned
backward, e.g. because NTP obtained the correct time after the guest was
already started or the admin decided to tune the local time, we see an
unpleasant effect in the guest: The RTC will stall for the period the
host clock is set back. We identified that one prominent guest affected
by this is Windows which relies on the periodic RTC interrupt for time
keeping.

This series address the issue by detecting those warps and providing a
callback mechanism to device models. The RTC is enabled to update its
timers and register content immediately. Tested successfully both with
hwclock in a Linux guest and by monitoring the Windows clock while
fiddling with the host time.

Note that if this kind of RTC adjustment is not wanted, the user is
still free to decouple the RTC from the host clock and base it on the
VM clock - just like before.



Jan Kiszka (3):
  qemu-timer: Consolidate qemu_get_clock and qemu_get_clock_ns
  qemu-timer: Introduce warp callback
  mc146818rtc: Handle host clock warps

 hw/mc146818rtc.c |   17 ++++++++++++
 qemu-timer.c     |   77 ++++++++++++++++++++++++++++++++++++++++++++----------
 qemu-timer.h     |    5 +++
 3 files changed, 85 insertions(+), 14 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-02 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02  9:38 [Qemu-devel] [0.14+master][PATCH 0/3] Let RTC follow backward jumps of host clock immediately Jan Kiszka
2011-02-02  9:38 ` [Qemu-devel] [0.14+master][PATCH 1/3] qemu-timer: Consolidate qemu_get_clock and qemu_get_clock_ns Jan Kiszka
2011-02-02  9:38 ` [Qemu-devel] [0.14+master][PATCH 2/3] qemu-timer: Introduce warp callback Jan Kiszka
2011-02-02  9:38 ` [Qemu-devel] [0.14+master][PATCH 3/3] mc146818rtc: Handle host clock warps Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.