[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251127103159.19816-1-bchalios@amazon.es>
Date: Thu, 27 Nov 2025 10:32:01 +0000
From: "Chalios, Babis" <bchalios@...zon.es>
To: "richardcochran@...il.com" <richardcochran@...il.com>,
"dwmw2@...radead.org" <dwmw2@...radead.org>, "andrew+netdev@...n.ch"
<andrew+netdev@...n.ch>, "davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>, "kuba@...nel.org"
<kuba@...nel.org>, "pabeni@...hat.com" <pabeni@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC: "Chalios, Babis" <bchalios@...zon.es>, "Graf (AWS), Alexander"
<graf@...zon.de>, "mzxreary@...inter.de" <mzxreary@...inter.de>
Subject: [PATCH 0/2] ptp: vmclock: Add VM generation counter and ACPI
notification
Similarly to live migration, starting a VM from some serialized state
(aka snapshot) is an event which calls for adjusting guest clocks, hence
a hypervisor should increase the disruption_marker before resuming the
VM vCPUs, letting the guest know.
However, loading a snapshot, is slightly different than live migration,
especially since we can start multiple VMs from the same serialized
state. Apart from adjusting clocks, the guest needs to take additional
action during such events, e.g. recreate UUIDs, reset network
adapters/connections, reseed entropy pools, etc. These actions are not
necessary during live migration. This calls for a differentiation
between the two triggering events.
We differentiate between the two events via an extra field in the
vmclock_abi, called vm_generation_counter. Whereas hypervisors should
increase the disruption marker in both cases, they should only increase
vm_generation_counter when a snapshot is loaded in a VM (not during live
migration).
Additionally, we attach an ACPI notification to VMClock. Implementing
the notification is optional for the device. VMClock device will declare
that it implements the notification by setting
VMCLOCK_FLAG_NOTIFICATION_PRESENT bit in vmclock_abi flags. Hypervisors
that implement the notification must send an ACPI notification every
time seq_count changes to an even number. The driver will propagate
these notifications to userspace via the poll() interface.
Once we are happy with the semantics and implementation, I will post a
patchset for QEMU so people can test this.
Changes:
* RFC -> v1:
- Made the notification support optional. Hypervisor needs to
advertise support for the notification via a flag in vmclock_abi.
Subsequently, poll() will return POLLHUP when the feature is not
supported, to avoid having userspace blocking indefinitely waiting
for events that won't arrive
- Reworded the comment around vm_generation_counter field to avoid
speaking about "jumping forward in time".
Babis Chalios (2):
ptp: vmclock: add vm generation counter
ptp: vmclock: support device notifications
drivers/ptp/ptp_vmclock.c | 113 +++++++++++++++++++++++++++++--
include/uapi/linux/vmclock-abi.h | 20 ++++++
2 files changed, 128 insertions(+), 5 deletions(-)
--
2.34.1
Powered by blists - more mailing lists