From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6B8CAC3DA42 for ; Wed, 10 Jul 2024 16:03:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRZlb-0000ik-EH; Wed, 10 Jul 2024 12:02:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRZlW-0000RE-Sg for qemu-devel@nongnu.org; Wed, 10 Jul 2024 12:02:00 -0400 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRZlM-0006kr-FX for qemu-devel@nongnu.org; Wed, 10 Jul 2024 12:01:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=MIME-Version:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=eplSV73khOiY/zErC2RfWtqZv2+3hffFi04ZOCrnPyE=; b=KVWVK3iVAE4c4ztGeKrKUjY2/A 48Cn2xyY4b9hEezL6CCFUGeyXppEgbgpxvvxTt8Ts/xgSQe0JwNakKhmquqLPY46YUSO1WlwiwhHz GyZsRoKvYFR0xyS9ajItcrA8x/B/MGxWgV3oE7tjcSkVBH2/czVv3g4hFXhpqcDdFF2DCk/hjR4dg AasaZfHSMWv7EWRGNk7iZfn+Atc4zQzlmKNA7KrnAEYCaavoekC9PMw8plue9eafhe0OhB4ZRaJ8G Zc5iZYWKf7JF75sIbwdZuk3pQ5kISUMYSmcyETQ4YbJze8j2HuucSTV/Je85heN78aCBLU8ismITi JDBAthhQ==; Received: from [2001:8b0:10b:5:daed:e261:1c9e:7a77] (helo=u3832b3a9db3152.ant.amazon.com) by casper.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRZkz-00000009TLW-2GTR; Wed, 10 Jul 2024 16:01:25 +0000 Message-ID: <98b20feebf4e7a11870dca725c03ee4e411b1aa3.camel@infradead.org> Subject: Re: [RFC PATCH v4] ptp: Add vDSO-style vmclock support From: David Woodhouse To: Peter Hilber , linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org, "Ridoux, Julien" , virtio-dev@lists.linux.dev, "Luu, Ryan" , "Chashper, David" Cc: "Christopher S . Hall" , Jason Wang , John Stultz , "Michael S . Tsirkin" , netdev@vger.kernel.org, Richard Cochran , Stephen Boyd , Thomas Gleixner , Xuan Zhuo , Marc Zyngier , Mark Rutland , Daniel Lezcano , Alessandro Zummo , Alexandre Belloni , qemu-devel , Simon Horman Date: Wed, 10 Jul 2024 17:01:24 +0100 In-Reply-To: <060f392c-7ba9-4ff6-be82-c64f542abaa1@opensynergy.com> References: <20240708092924.1473461-1-dwmw2@infradead.org> <060f392c-7ba9-4ff6-be82-c64f542abaa1@opensynergy.com> Content-Type: multipart/signed; micalg="sha-256"; protocol="application/pkcs7-signature"; boundary="=-yUWFqTuP5PMeC0M77fXs" User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Received-SPF: none client-ip=2001:8b0:10b:1236::1; envelope-from=BATV+179270d1b3693ee586b2+7626+infradead.org+dwmw2@casper.srs.infradead.org; helo=casper.infradead.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --=-yUWFqTuP5PMeC0M77fXs Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2024-07-10 at 15:07 +0200, Peter Hilber wrote: > On 08.07.24 11:27, David Woodhouse wrote: > > From: David Woodhouse > >=20 > > The vmclock "device" provides a shared memory region with precision clo= ck > > information. By using shared memory, it is safe across Live Migration. > >=20 > > Like the KVM PTP clock, this can convert TSC-based cross timestamps int= o > > KVM clock values. Unlike the KVM PTP clock, it does so only when such i= s > > actually helpful. > >=20 > > The memory region of the device is also exposed to userspace so it can = be > > read or memory mapped by application which need reliable notification o= f > > clock disruptions. > >=20 > > Signed-off-by: David Woodhouse >=20 > [...] >=20 > > + > > +struct vmclock_abi { > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* CONSTANT FIELDS */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint32_t magic; > > +#define VMCLOCK_MAGIC=C2=A0=C2=A00x4b4c4356 /* "VCLK" */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint32_t size;=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Size of region containin= g this structure */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint16_t version;=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* 1 */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint8_t counter_id; /* Match= es VIRTIO_RTC_COUNTER_xxx except INVALID */ > > +#define VMCLOCK_COUNTER_ARM_VCNT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A00 > > +#define VMCLOCK_COUNTER_X86_TSC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A01 > > +#define VMCLOCK_COUNTER_INVALID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A00xff > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint8_t time_type; /* Matche= s VIRTIO_RTC_TYPE_xxx */ > > +#define VMCLOCK_TIME_UTC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A00=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Since 1970-= 01-01 00:00:00z */ > > +#define VMCLOCK_TIME_TAI=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A01=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Since 1970-= 01-01 00:00:00z */ > > +#define VMCLOCK_TIME_MONOTONIC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A02=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Since undefined epoch */ > > +#define VMCLOCK_TIME_INVALID_SMEARED=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A03=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0/* Not supported */ > > +#define VMCLOCK_TIME_INVALID_MAYBE_SMEARED=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A04=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Not supported */ > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* NON-CONSTANT FIELDS PROTE= CTED BY SEQCOUNT LOCK */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint32_t seq_count;=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0/* Low bit means an update is in progress */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * This field changes to ano= ther non-repeating value when the CPU > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * counter is disrupted, for= example on live migration. This lets > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * the guest know that it sh= ould discard any calibration it has > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * performed of the counter = against external sources (NTP/PTP/etc.). > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint64_t disruption_marker; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint64_t flags; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Indicates that the tai_of= fset_sec field is valid */ > > +#define VMCLOCK_FLAG_TAI_OFFSET_VALID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0(1 << 0) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Optionally used to notify= guests of pending maintenance events. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * A guest which provides la= tency-sensitive services may wish to > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * remove itself from servic= e if an event is coming up. Two flags > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * indicate the approximate = imminence of the event. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > > +#define VMCLOCK_FLAG_DISRUPTION_SOON=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(1 << 1) /* About a day */ > > +#define VMCLOCK_FLAG_DISRUPTION_IMMINENT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0(1 << 2) /* About an hour */ > > +#define VMCLOCK_FLAG_PERIOD_ESTERROR_VALID=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0(1 << 3) > > +#define VMCLOCK_FLAG_PERIOD_MAXERROR_VALID=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0(1 << 4) > > +#define VMCLOCK_FLAG_TIME_ESTERROR_VALID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0(1 << 5) > > +#define VMCLOCK_FLAG_TIME_MAXERROR_VALID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0(1 << 6) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Even regardless of leap s= econds, the time presented through this > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * mechanism may not be stri= ctly monotonic. If the counter slows down > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * and the host adapts to th= is discovery, the time calculated from > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * the value of the counter = immediately after an update to this > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * structure, may appear to = be *earlier* than a calculation just > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * before the update (while = the counter was believed to be running > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * faster than it now is). A= guest operating system will typically > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * *skew* its own system clo= ck back towards the reference clock > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * exposed here, rather than= following this clock directly. If, > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * however, this structure i= s being populated from such a system > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * clock which is already ha= ndled in such a fashion and the results > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * *are* guaranteed to be mo= notonic, such monotonicity can be > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * advertised by setting thi= s bit. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ >=20 > I wonder if this might be difficult to define in a standard. I'm sure we could do better than my attempt above, but surely it isn't *so* hard to define monotonicity? > Is there a need to define device and driver behavior in more detail? What > would happen if e.g. the device first decides how to update the clock, bu= t > is then slow to update the SHM? That's OK, isn't it? The key in the VMCLOCK_FLAG_TIME_MONOTONIC flag is that by setting it, the host guarantees that the time calculated according to this structure at any given moment, shall not appear to be later than the time calculated via the structure at any *later* moment. The kernel typically takes create care to ensure that time as seen by userspace (e.g. in the real vDSO) *is* monotonic. If the underlying counter is speeding up and the relationship from counter to real time is being adjusted, the kernel is careful to ensure that the latest time which can be calculated from one version of the data cannot appear later than the earliest time which can be calculated from the next version. However, that naturally means a loss of precision, as if the counter has been running faster than expected, the apparent time will be later than the true time, and the kernel has to *overcompensate* for the rate increase, running the apparent clock slower than the true counter period until the apparent time converges with true time again. The time exposed through this structure can be as *precise* as possible, or it can guarantee monotonicity. This flag allows the host to advertise the latter. It can be useful for the guest to know, because a non-monotonic clock is less suitable for *direct* use by client applications, and more suitable for feeding the guest kernel's own timekeeping.=20 > > +#define VMCLOCK_FLAG_TIME_MONOTONIC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(1 << 7) > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint8_t pad[2]; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint8_t clock_status; > > +#define VMCLOCK_STATUS_UNKNOWN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A00 > > +#define VMCLOCK_STATUS_INITIALIZING=C2=A0=C2=A0=C2=A0=C2=A01 > > +#define VMCLOCK_STATUS_SYNCHRONIZED=C2=A0=C2=A0=C2=A0=C2=A02 > > +#define VMCLOCK_STATUS_FREERUNNING=C2=A0=C2=A0=C2=A0=C2=A0=C2=A03 > > +#define VMCLOCK_STATUS_UNRELIABLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A04 > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * The time exposed through = this device is never smeared. This field > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * corresponds to the 'subty= pe' field in virtio-rtc, which indicates > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * the smearing method. Howe= ver in this case it provides a *hint* to > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * the guest operating syste= m, such that *if* the guest OS wants to > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * provide its users with an= alternative clock which does not follow > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * the POSIX CLOCK_REALTIME = standard, it may do so in a fashion > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * consistent with the other= systems in the nearby environment. >=20 > AFAIU the POSIX.1-2017 standard does not mandate UTC, esp. not w.r.t. > leap seconds [1, A.4.16 Seconds Since the Epoch]: >=20 > > Those applications which do care about leap seconds can determine how t= o > > handle them in whatever way those applications feel is best. This was > > particularly emphasized because there was disagreement about what the b= est > > way of handling leap seconds might be. It is a practical impossibility = to > > mandate that a conforming implementation must have a fixed relationship= to > > any particular official clock (consider isolated systems, or systems > > performing "reruns" by setting the clock to some arbitrary time). >=20 > So the above comment should probably refer to UTC instead of POSIX > CLOCK_REALTIME. Ack, I'll fix that; thanks. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint8_t leap_second_smearing= _hint; /* Matches VIRTIO_RTC_SUBTYPE_xxx */ > > +#define VMCLOCK_SMEARING_STRICT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A00 > > +#define VMCLOCK_SMEARING_NOON_LINEAR=C2=A0=C2=A0=C2=A01 > > +#define VMCLOCK_SMEARING_UTC_SLS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A02 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0int16_t tai_offset_sec; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uint8_t leap_indicator; /* B= ased on VIRTIO_RTC_LEAP_xxx */ > > +#define VMCLOCK_LEAP_NONE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A00=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* No known nearby leap second */ > > +#define VMCLOCK_LEAP_PRE_POS=C2=A0=C2=A0=C2=A01=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0/* Leap second + at end of month */ >=20 > A positive leap second usually means stepping the clock backwards, so > `Leap second +` is somewhat confusing. I was trying to avoid hitting 80 characters. I'll rework it; thanks. > > +#define VMCLOCK_LEAP_PRE_NEG=C2=A0=C2=A0=C2=A02=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0/* Leap second - at end of month */ > > +#define VMCLOCK_LEAP_POS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A03=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Set during 23:59:60 second */ > > +#define VMCLOCK_LEAP_NEG=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A04=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* Not used in VMCLOCK */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * These values are not (yet= ) in virtio-rtc. They indicate that a > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * leap second *has* occurre= d at the start of the month. This allows > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * a guest to generate a sme= ared clock from the accurate clock which > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * this device provides, as = smearing may need to continue for up to a > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * period of time *after* th= e point of the leap second itself. Must > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * be cleared by the 15th da= y of the month. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > > +#define VMCLOCK_LEAP_POST_POS=C2=A0=C2=A05 > > +#define VMCLOCK_LEAP_POST_NEG=C2=A0=C2=A06 >=20 > I think it can still be discussed in the context of virtio-rtc whether we > should add dedicated identifiers for message-based smeared clock readouts= . Yeah, I think the only thing we really care about for SHM is the POST values I added there. As long as you'll let me have those, I think the structure is basically ready to be seriously proposed as an addition to --=-yUWFqTuP5PMeC0M77fXs Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCCEkQw ggYQMIID+KADAgECAhBNlCwQ1DvglAnFgS06KwZPMA0GCSqGSIb3DQEBDAUAMIGIMQswCQYDVQQG EwJVUzETMBEGA1UECBMKTmV3IEplcnNleTEUMBIGA1UEBxMLSmVyc2V5IENpdHkxHjAcBgNVBAoT FVRoZSBVU0VSVFJVU1QgTmV0d29yazEuMCwGA1UEAxMlVVNF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