qemu/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-cpu-hotplug-stub.c hw/acpi: Update ACPI GED framework to support vCPU Hotplug 2024-07-22 20:15:41 -04:00
acpi-mem-hotplug-stub.c hw/acpi: refactor acpi hp modules so that targets can just use what they need 2021-09-04 09:07:46 -04:00
acpi-nvdimm-stub.c hw/acpi: refactor acpi hp modules so that targets can just use what they need 2021-09-04 09:07:46 -04:00
acpi-pci-hotplug-stub.c pcihp: add ACPI PCI hotplug specific is_hotpluggable_bus() callback 2023-03-07 12:39:00 -05:00
acpi-qmp-cmds.c acpi: Move the QMP command from monitor/ to hw/acpi/ 2023-02-04 07:56:54 +01:00
acpi-stub.c hw/acpi: Dumb down acpi_table_add() stub 2023-02-23 14:10:17 +01:00
acpi-x86-stub.c hw/acpi/acpi_dev_interface: Remove now unused madt_cpu virtual method 2023-10-04 18:15:05 -04:00
acpi_interface.c hw/isa/isa-bus: Turn isa_build_aml() into qbus_build_aml() 2023-01-27 11:47:02 -05:00
aml-build-stub.c acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors 2022-11-07 14:00:29 -05:00
aml-build.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
bios-linker-loader.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
core.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpu.c cpuhp: make sure that remove events are handled within the same SCI 2025-01-15 13:05:41 -05:00
cpu_hotplug.c hw/acpi/cpu_hotplug: Include 'x86.h' instead of 'pc.h' 2024-02-20 20:34:21 +03:00
cxl-stub.c acpi/cxl: Add _OSC implementation (9.14.2) 2022-05-13 06:13:36 -04:00
cxl.c hw/cxl: Add QTG _DSM support for ACPI0017 device 2023-10-22 05:18:17 -04:00
erst.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
generic_event_device.c acpi/ghes: better name the offset of the hardware error firmware 2025-01-15 13:07:14 -05:00
ghes-stub.c acpi/ghes: better name GHES memory error function 2025-01-15 13:07:10 -05:00
ghes.c acpi/ghes: Change ghes fill logic to work with only one source 2025-01-15 13:07:17 -05:00
hmat.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
hmat.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ich9.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ich9_tco.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ich9_timer.c hw/acpi/ich9: Add periodic and swsmi timer 2024-09-11 09:46:14 -04:00
ipmi-stub.c acpi: ipmi: use AcpiDevAmlIf interface to build IPMI device descriptors 2022-06-09 19:32:49 -04:00
ipmi.c acpi: ipmi: use AcpiDevAmlIf interface to build IPMI device descriptors 2022-06-09 19:32:49 -04:00
Kconfig hw/acpi: Add vmclock device 2025-01-15 17:43:24 -05:00
memory_hotplug.c hw/acpi: Remove the deprecated QAPI MEM_UNPLUG_ERROR event 2024-06-04 11:53:43 +02:00
meson.build hw/acpi: Add vmclock device 2025-01-15 17:43:24 -05:00
nvdimm.c hw/other: spelling fixes 2023-09-21 11:31:16 +03:00
pci-bridge-stub.c pcihp: make bridge describe itself using AcpiDevAmlIfClass:build_dev_aml 2023-01-28 06:21:29 -05:00
pci-bridge.c acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices() 2023-03-07 12:39:00 -05:00
pci.c hw/acpi: Generic Initiator - add missing object class property descriptions. 2024-11-04 16:03:24 -05:00
pcihp.c hw/acpi: Constify VMState 2023-12-29 11:17:30 +11:00
piix4.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
tpm.c docs: fix references to docs/specs/tpm.rst 2021-06-02 06:51:09 +02:00
trace-events hw/acpi/core: Trace enable and status registers of GPE separately 2023-10-04 18:15:05 -04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
utils.c acpi: Set proper maximum size for "etc/acpi/rsdp" blob 2021-03-22 18:58:19 -04:00
viot.c hw/acpi/viot: sort VIOT ACPI table entries by PCI host bridge min_bus 2022-06-09 19:32:49 -04:00
viot.h hw/acpi: Add VIOT table 2021-11-01 18:49:10 -04:00
vmclock.c hw/acpi: Add vmclock device 2025-01-15 17:43:24 -05:00
vmgenid.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00