qemu/include/standard-headers/linux
David Woodhouse 3634039b93 hw/acpi: Add vmclock device
The vmclock device addresses the problem of live migration with
precision clocks. The tolerances of a hardware counter (e.g. TSC) are
typically around ±50PPM. A guest will use NTP/PTP/PPS to discipline that
counter against an external source of 'real' time, and track the precise
frequency of the counter as it changes with environmental conditions.

When a guest is live migrated, anything it knows about the frequency of
the underlying counter becomes invalid. It may move from a host where
the counter running at -50PPM of its nominal frequency, to a host where
it runs at +50PPM. There will also be a step change in the value of the
counter, as the correctness of its absolute value at migration is
limited by the accuracy of the source and destination host's time
synchronization.

The device exposes a shared memory region to guests, which can be mapped
all the way to userspace. In the first phase, this merely advertises a
'disruption_marker', which indicates that the guest should throw away any
NTP synchronization it thinks it has, and start again.

Because the region can be exposed all the way to userspace, applications
can still use time from a fast vDSO 'system call', and check the
disruption marker to be sure that their timestamp is indeed truthful.

The structure also allows for the precise time, as known by the host, to
be exposed directly to guests so that they don't have to wait for NTP to
resync from scratch.

The values and fields are based on the nascent virtio-rtc specification,
and the intent is that a version (hopefully precisely this version) of
this structure will be included as an optional part of that spec. In the
meantime, a simple ACPI device along the lines of VMGENID is perfectly
sufficient and is compatible with what's being shipped in certain
commercial hypervisors.

Linux guest support was merged into the 6.13-rc1 kernel:
https://git.kernel.org/torvalds/c/205032724226

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Paul Durrant <paul@xen.org>
Message-Id: <07fd5e2f529098ad4d7cab1423fe9f4a03a9cc14.camel@infradead.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2025-01-15 17:43:24 -05:00
..
const.h linux-headers: Update to Linux v6.12-rc5 2024-11-02 15:20:41 +08:00
ethtool.h linux-headers: Update to Linux 6.13-rc1 2024-12-11 09:18:38 +01:00
fuse.h linux-headers: Update to Linux v6.12-rc5 2024-11-02 15:20:41 +08:00
if_ether.h include: import virtio headers from linux 4.0 2015-02-26 12:42:21 +01:00
input-event-codes.h linux-headers: Update to Linux v6.12-rc5 2024-11-02 15:20:41 +08:00
input.h Update linux headers to v6.0-rc4 2022-09-26 17:23:47 +02:00
kernel.h Update linux headers to 5.11-rc2 2021-01-21 11:19:45 +01:00
kvm_para.h update-linux-headers: import linux/kvm_para.h header 2024-06-05 11:01:06 +02:00
pci_regs.h linux-headers: Update to Linux 6.13-rc1 2024-12-11 09:18:38 +01:00
qemu_fw_cfg.h fw_cfg: import & use linux/qemu_fw_cfg.h 2018-08-23 18:46:25 +02:00
sysinfo.h scripts/update-linux-headers: add ethtool.h and update to 4.16.0-rc4 2018-03-13 23:09:49 +02:00
types.h update Linux headers to 4.6 2016-04-05 11:46:52 +02:00
udmabuf.h headers: Add udmabuf.h 2021-05-27 12:06:37 +02:00
vhost_types.h linux-headers: Update to Linux v6.7-rc5 2024-01-10 18:47:47 +10:00
virtio_9p.h Update linux headers to v6.0-rc4 2022-09-26 17:23:47 +02:00
virtio_balloon.h linux-headers: Update to Linux v6.12-rc5 2024-11-02 15:20:41 +08:00
virtio_blk.h linux-headers: update to v6.5-rc1 2023-07-10 09:52:52 +02:00
virtio_bt.h linux-headers: update to 6.10-rc1 2024-07-01 17:16:04 -04:00
virtio_config.h linux-headers: Update to Linux v6.8-rc6 2024-03-08 20:48:03 +10:00
virtio_console.h linux headers: sync to 5.9-rc4 2020-09-29 02:14:29 -04:00
virtio_crypto.h linux-headers: Update to Linux 6.13-rc1 2024-12-11 09:18:38 +01:00
virtio_fs.h linux-headers: update against 5.10-rc1 2020-11-01 12:30:51 -07:00
virtio_gpio.h linux-headers: Update headers to v5.17-rc1 2022-02-17 17:21:45 +00:00
virtio_gpu.h linux-headers: Update to Linux v6.12-rc5 2024-11-02 15:20:41 +08:00
virtio_i2c.h linux-headers: Update headers to v5.17-rc1 2022-02-17 17:21:45 +00:00
virtio_ids.h Update linux headers to v6.0-rc4 2022-09-26 17:23:47 +02:00
virtio_input.h linux-headers: update 2015-04-30 13:21:42 +02:00
virtio_iommu.h linux-headers: Update headers to v5.17-rc1 2022-02-17 17:21:45 +00:00
virtio_mem.h linux-headers: update to 6.10-rc1 2024-07-01 17:16:04 -04:00
virtio_mmio.h linux-headers: update against 5.10-rc1 2020-11-01 12:30:51 -07:00
virtio_net.h linux-headers: update to 6.10-rc1 2024-07-01 17:16:04 -04:00
virtio_pci.h linux-headers: Update to Linux 6.13-rc1 2024-12-11 09:18:38 +01:00
virtio_pcidev.h linux-headers: Update headers to v5.17-rc1 2022-02-17 17:21:45 +00:00
virtio_pmem.h linux-headers: Update to Linux v6.8-rc6 2024-03-08 20:48:03 +10:00
virtio_ring.h Update linux headers to v6.0-rc4 2022-09-26 17:23:47 +02:00
virtio_rng.h include: import virtio headers from linux 4.0 2015-02-26 12:42:21 +01:00
virtio_scmi.h linux-headers: Update headers to v5.17-rc1 2022-02-17 17:21:45 +00:00
virtio_scsi.h linux headers: sync to 5.9-rc4 2020-09-29 02:14:29 -04:00
virtio_snd.h linux-headers: update to current kvm/next 2024-04-23 17:35:25 +02:00
virtio_types.h include: import virtio headers from linux 4.0 2015-02-26 12:42:21 +01:00
virtio_vsock.h linux-headers: update to 5.16-rc1 2021-12-10 09:47:18 +01:00
vmclock-abi.h hw/acpi: Add vmclock device 2025-01-15 17:43:24 -05:00