qemu/include/hw/acpi
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
..
acpi-defs.h hw/acpi: Upgrade ACPI SPCR table to support SPCR table revision 4 format 2024-12-20 11:22:47 +10:00
acpi.h replace TABs with spaces 2023-03-20 12:43:50 +01:00
acpi_aml_interface.h hw/isa/isa-bus: Turn isa_build_aml() into qbus_build_aml() 2023-01-27 11:47:02 -05:00
acpi_dev_interface.h hw/acpi/acpi_dev_interface: Remove now unused #include "hw/boards.h" 2023-10-04 18:15:05 -04:00
aml-build.h hw/acpi: Upgrade ACPI SPCR table to support SPCR table revision 4 format 2024-12-20 11:22:47 +10:00
bios-linker-loader.h vmgenid: replace x-write-pointer-available hack 2017-09-08 16:15:17 +03:00
cpu.h hw/acpi: Update CPUs AML with cpu-(ctrl)dev change 2024-07-22 20:15:41 -04:00
cpu_hotplug.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
cxl.h hw/cxl: Add QTG _DSM support for ACPI0017 device 2023-10-22 05:18:17 -04:00
erst.h include: Include headers where needed 2023-01-08 01:54:22 -05:00
generic_event_device.h acpi: ged: Add macro for acpi sleep control register 2024-10-16 15:56:42 +08:00
ghes.h acpi/ghes: better name the offset of the hardware error firmware 2025-01-15 13:07:14 -05:00
ich9.h hw/acpi/ich9: Add periodic and swsmi timer 2024-09-11 09:46:14 -04:00
ich9_tco.h hw/acpi/ich9_tco: Include missing 'migration/vmstate.h' header 2024-02-22 12:47:40 +01:00
ich9_timer.h hw/acpi/ich9: Add periodic and swsmi timer 2024-09-11 09:46:14 -04:00
ipmi.h acpi: ipmi: use AcpiDevAmlIf interface to build IPMI device descriptors 2022-06-09 19:32:49 -04:00
memory_hotplug.h hw/acpi: Include missing 'qapi/qapi-types-acpi.h' generated header 2024-02-22 12:47:40 +01:00
pc-hotplug.h include/: spelling fixes 2023-09-08 13:08:52 +03:00
pci.h hw/acpi: Generic Port Affinity Structure support 2024-11-04 16:03:24 -05:00
pcihp.h hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init() 2023-10-19 23:13:28 +02:00
piix4.h pcihp: move fields enabling hotplug into AcpiPciHpState 2023-03-07 12:39:00 -05:00
tpm.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
utils.h acpi: Move maximum size logic into acpi_add_rom_blob() 2021-03-22 18:58:19 -04:00
vmclock.h hw/acpi: Add vmclock device 2025-01-15 17:43:24 -05:00
vmgenid.h include/: spelling fixes 2023-09-08 13:08:52 +03:00