2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-11 07:04:04 +08:00
linux-next/drivers/hv
Vitaly Kuznetsov 3716a49a81 hv_utils: implement Hyper-V PTP source
With TimeSync version 4 protocol support we started updating system time
continuously through the whole lifetime of Hyper-V guests. Every 5 seconds
there is a time sample from the host which triggers do_settimeofday[64]().
While the time from the host is very accurate such adjustments may cause
issues:
- Time is jumping forward and backward, some applications may misbehave.
- In case an NTP server runs in parallel and uses something else for time
  sync (network, PTP,...) system time will never converge.
- Systemd starts annoying you by printing "Time has been changed" every 5
  seconds to the system log.

Instead of doing in-kernel time adjustments offload the work to an
NTP client by exposing TimeSync messages as a PTP device. Users may now
decide what they want to use as a source.

I tested the solution with chrony, the config was:

 refclock PHC /dev/ptp0 poll 3 dpoll -2 offset 0

The result I'm seeing is accurate enough, the time delta between the guest
and the host is almost always within [-10us, +10us], the in-kernel solution
was giving us comparable results.

I also tried implementing PPS device instead of PTP by using not currently
used Hyper-V synthetic timers (we use only one of four for clockevent) but
with PPS source only chrony wasn't able to give me the required accuracy,
the delta often more that 100us.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-10 15:40:19 +01:00
..
channel_mgmt.c Drivers: hv: vmbus: Use all supported IC versions to negotiate 2017-01-31 11:05:59 +01:00
channel.c Drivers: hv: vmbus: Fix a rescind handling bug 2017-01-10 21:46:41 +01:00
connection.c Drivers: hv: vmbus: Move the extracting of Hypervisor version information 2017-01-20 14:48:03 +01:00
hv_balloon.c Drivers: hv: balloon: add a fall through comment to hv_memory_notifier() 2017-01-31 11:05:58 +01:00
hv_fcopy.c Drivers: hv: Log the negotiated IC versions. 2017-01-31 11:05:59 +01:00
hv_kvp.c Drivers: hv: Log the negotiated IC versions. 2017-01-31 11:05:59 +01:00
hv_snapshot.c Drivers: hv: Log the negotiated IC versions. 2017-01-31 11:05:59 +01:00
hv_util.c hv_utils: implement Hyper-V PTP source 2017-02-10 15:40:19 +01:00
hv_utils_transport.c Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv_utils_transport.h Drivers: hv: utils: fix a race on userspace daemons registration 2016-08-31 13:05:41 +02:00
hv.c Drivers: hv: restore hypervcall page cleanup before kexec 2017-01-31 11:05:58 +01:00
hyperv_vmbus.h Drivers: hv: restore hypervcall page cleanup before kexec 2017-01-31 11:05:58 +01:00
Kconfig x86: Make Linux guest support optional 2013-03-04 13:14:25 -08:00
Makefile Drivers: hv: util: introduce hv_utils_transport abstraction 2015-05-24 12:17:41 -07:00
ring_buffer.c Merge 4.10-rc7 into char-misc-next 2017-02-06 09:39:13 +01:00
vmbus_drv.c Drivers: hv: restore hypervcall page cleanup before kexec 2017-01-31 11:05:58 +01:00