On Fri, 2026-07-17 at 06:59 +0000, Arthur Kiyanovski wrote:
> Implement the gettimexattrs64 and getcrosststampattrs callbacks in the
> ptp_vmclock driver to provide clock quality attributes through the new
> PTP_SYS_OFFSET_EXTENDED_ATTRS and PTP_SYS_OFFSET_PRECISE_ATTRS ioctls.
>
> The ptp_vmclock device exposes:
> - error_bound: Derived from time_maxerror_nanosec, accumulated with
>   counter frequency error (counter_period_maxerror_rate_frac_sec) over
>   elapsed counter ticks
> - clock_status: Mapped from the device's clock_status field
> - timescale: Always reports TAI (UTC sources are converted by tai_adjust()
>   before the attributes are populated)
>
> The legacy ioctls return -EINVAL when clock_status is UNRELIABLE since
> they have no way to communicate clock state to userspace. The attrs
> ioctls have a status field for this purpose, so they treat UNRELIABLE
> as success and let userspace check the status field.
>
> To avoid a race where the hypervisor could update clock_status between
> the timestamp call and the UNRELIABLE check, the clock state is captured
> inside the seq_count loop for a consistent snapshot with the timestamp.
>
> Signed-off-by: Arthur Kiyanovski <[email protected]>

Reviewed-by: David Woodhouse <[email protected]>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to