Skip to content

xen: maintain an accurate persistent clock in more cases

David Vrabel lkml xen-devel 11 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest posting 2/25 patches 47 repliesIn review
  2. v6 posting 1/20 of 5 patches 0 repliesSuperseded
  3. v5 posting 2/24 patches 31 repliesSuperseded
Earlier versions · 8
VersionPostedPatchesRepliesStatus
v5 posting 1/20 of 4 patches2 repliesSuperseded
v4 posting 2/24 patches18 repliesSuperseded
v4 posting 1/20 of 4 patches0 repliesSuperseded
v3 posting 2/22 patches12 repliesSuperseded
v3 posting 1/20 of 2 patches0 repliesSuperseded
v2 posting 2/22 patches22 repliesSuperseded
v2 posting 1/20 of 2 patches0 repliesSuperseded
v13 patches61 repliesSuperseded

Patches in v6 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5hrtimers: support resuming with two or more CPUs online (but stopped)drivers/xen/manage.c kernel/hrtimer.c+12 -60 replies
1/5hrtimers: support resuming with two or more CPUs online (but stopped)drivers/xen/manage.c kernel/hrtimer.c+12 -622 replies
2/5time: pass flags instead of multiple bools to timekeeping_update()kernel/time/timekeeping.c+12 -90 replies
2/5time: pass flags instead of multiple bools to timekeeping_update()kernel/time/timekeeping.c+12 -92 replies
3/5time: indicate that the clock was set in the pvclock gtod notifier chaininclude/linux/pvclock_gtod.h kernel/time/timekeeping.c+25 -124 replies
4/5x86/xen: sync the wallclock when the system time is setarch/x86/xen/time.c+28 -00 replies
4/5x86/xen: sync the wallclock when the system time is setarch/x86/xen/time.c+28 -00 replies
5/5x86/xen: sync the CMOS RTC as well as the Xen wallclockarch/x86/xen/time.c+16 -160 replies
5/5x86/xen: sync the CMOS RTC as well as the Xen wallclockarch/x86/xen/time.c+16 -1610 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.

Read the v6 thread

Cover letter [PATCHv6 0/5] xen: maintain an accurate persistent clock in more cases

Xen guests use the Xen wallclock as their persistent clock. This is a software only clock in the hypervisor that is used by guests instead of a real hardware RTC.

The kernel has limited support for updating the persistent clock or RTC when NTP is synced. This has the following limitations:

* The persistent clock is not updated on step changes. This leaves a window where it will be incorrect (while NTP resyncs).

* Xen guests use the Xen wallclock as their persistent clock. dom0 maintains this clock so it is persistent for domUs but not dom0 itself.

These limitations mean that guests started before NTP is synchronized will start with an incorrect wallclock time and the hardware RTC will not be updated (as on bare metal).

These series fixes the above limitations and depends on "x86: increase precision of x86_platform.get/set_wallclock()" which was previously posted.

Changes in v6:

Fix hrtimers_resume() to handle resuming with two or more online CPUs instead of adding a hrtimers_late_resume(). Add a flag to the pvclock_gtod notififcations for the clock being set and go back to using this to sync the Xen wallclock.

Changes in v5:

Dropped the change to disable non-boot CPUs during suspend on Xen as migration downtime was too poor. Instead, provide hrtimers_late_resume() for use by Xen's resume code to replace the call of clock_was_set(). Fix two unused variable warnings.

Changes in v4:

Add a new clock_was_set notifier chain. Use this instead of direct calls to clock_was_set() from the timekeeping code. Use this notifier and a new timer to synchronize the Xen wallclock.

Changes in v3:

Don't peek at the timekeeper internals (use __current_kernel_time() instead). Use the native set_wallclock hook in dom0.

Changes in v2:

Reworked to use the pvclock_gtod notifier to sync the wallclock (this looked similar to what a KVM host does). update_persistent_clock() will now only update the CMOS RTC.

David