Re: [PATCH] ptp: Add vDSO-style vmclock support

From: Daniel P. Berrangé
Date: Thu Jul 25 2024 - 07:32:18 EST


On Thu, Jul 25, 2024 at 10:56:05AM +0100, David Woodhouse wrote:
> Hi Michael, thanks for the review!
>
> On Thu, 2024-07-25 at 01:48 -0400, Michael S. Tsirkin wrote:
> > On Wed, Jul 24, 2024 at 06:16:37PM +0100, David Woodhouse wrote:
> > > From: David Woodhouse <dwmw@xxxxxxxxxxxx>
> > >
> > > The vmclock "device" provides a shared memory region with precision clock
> > > information. By using shared memory, it is safe across Live Migration.
> > >
> > > Like the KVM PTP clock, this can convert TSC-based cross timestamps into
> > > KVM clock values. Unlike the KVM PTP clock, it does so only when such is
> > > actually helpful.
> > >
> > > 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 of
> > > clock disruptions.
> > >
> > > Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
> > > ---
> > > QEMU implementation at
> > > https://git.infradead.org/users/dwmw2/qemu.git/shortlog/refs/heads/vmclock
> > >
> > > Although the ACPI device implemented in QEMU (and some other
> > > hypervisor) stands alone, most of the fields and values herein are
> > > aligned as much as possible with the nascent virtio-rtc specification,
> > > with the intent that a version of the same structure can be
> > > incorporated into that standard.
> >
> > Do you want to just help complete virtio-rtc then? Would be easier than
> > trying to keep two specs in sync.
>
> The ACPI version is much more lightweight and doesn't take up a
> valuable PCI slot#. (I know, you can do virtio without PCI but that's
> complex in other ways).

In general it shouldn't have to take up a PCI slot, that's just
a common default policy. virtio-devices only need a dedicated
slot if there's a need to do hotplug/unplug of them. There is a
set of core devices for which hotplug doesn't make sense, which
could all be put as functions in the same slot. ie virtio-rng,
virtio-balloon and virtio-rtc, could all live in one slot.

With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|