On Thu, Dec 19, 2024 at 09:42:03PM +0100, Peter Hilber wrote:
Ioctl PTP_SYS_OFFSET_PRECISE2 provides cross-timestamping of device time and system time. This can be used for virtualization where (virtualization) host and guest refer to the same clocksource. It may be preferred to indicate UTC time, rather than TAI. It is then useful to indicate when and how the host processes UTC leap seconds (stepping or smearing on leap seconds),
If the VM host provides TAI, then the guest may freely derive UTC and leap seconds on its own. Whether to smear leap seconds or not is properly an administrative configuration choice in the VM guest.
Leap seconds are scheduled to be deleted in 2036. If, between now and then, another one occurs, it will be global event, not determined by a VM host. The way you find out about leap seconds is through networking using the NTP (or even just downloading the published list once in a while). VM clients typically have networking, and so they can learn about a leap second all by themselves.
in particular if the guest is not guaranteed to have an up-to-date Time Zone Database or similar.
Time zones are not connected to leap seconds.
Also, a host may have a notion of how accurate its clock is w.r.t. the hosts' reference clocks.
I'm opposed to having device drivers try to claim any kind of clock quality. All of the clock control, servos, statistics, etc, are done in user space, and so only user space software can generate meaningful clock quality metrics. Putting some kind of hand wavy values into kernel drivers is just plain wrong IMO.
Thanks, Richard