VMClock now supports a vm_generation_counter field in the struct it
exposes to userspace. The field signals a disruption that happened due
to a guest loaded from a snapshot.

Moreover, VMClock now optionally supports device notifications when the
seq_count changes to a new even value.

Signed-off-by: Babis Chalios <[email protected]>
---
 include/standard-headers/linux/vmclock-abi.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/include/standard-headers/linux/vmclock-abi.h 
b/include/standard-headers/linux/vmclock-abi.h
index 15b0316cb4..fe824badc0 100644
--- a/include/standard-headers/linux/vmclock-abi.h
+++ b/include/standard-headers/linux/vmclock-abi.h
@@ -115,6 +115,17 @@ struct vmclock_abi {
         * bit again after the update, using the about-to-be-valid fields.
         */
 #define VMCLOCK_FLAG_TIME_MONOTONIC            (1 << 7)
+       /*
+        * If the VM_GEN_COUNTER_PRESENT flag is set, the hypervisor will
+        * bump the vm_generation_counter field every time the guest is
+        * loaded from some save state (restored from a snapshot).
+        */
+#define VMCLOCK_FLAG_VM_GEN_COUNTER_PRESENT     (1 << 8)
+       /*
+        * If the NOTIFICATION_PRESENT flag is set, the hypervisor will send
+        * a notification every time it updates seq_count to a new even number.
+        */
+#define VMCLOCK_FLAG_NOTIFICATION_PRESENT       (1 << 9)
 
        uint8_t pad[2];
        uint8_t clock_status;
@@ -177,6 +188,15 @@ struct vmclock_abi {
        uint64_t time_frac_sec;         /* Units of 1/2^64 of a second */
        uint64_t time_esterror_nanosec;
        uint64_t time_maxerror_nanosec;
+
+       /*
+        * This field changes to another non-repeating value when the guest
+        * has been loaded from a snapshot. In addition to handling a
+        * disruption in time (which will also be signalled through the
+        * disruption_marker field), a guest may wish to discard UUIDs,
+        * reset network connections, reseed entropy, etc.
+        */
+       uint64_t vm_generation_counter;
 };
 
 #endif /*  __VMCLOCK_ABI_H__ */
-- 
2.34.1


Reply via email to