From nobody Sun Feb 8 18:15:47 2026 Received: from fra-out-002.esa.eu-central-1.outbound.mail-perimeter.amazon.com (fra-out-002.esa.eu-central-1.outbound.mail-perimeter.amazon.com [3.65.3.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A66F133E348; Wed, 7 Jan 2026 13:26:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=3.65.3.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767792420; cv=none; b=Yh5me3uKmLA+w0B9XX1BYIXu05qG6DSS5GdpUQRVrBiH2OYtyrPrsCz7OHBPFZyQBQ0CLESYO2Rq9hCee9t6v4cINRQVHBatNwEk/8oFijJYld1HJJbqQE6SFfcuTPBgaVmBPjwoe2qRHQCrPM28MGw9iv4OCgHyowSA+EmcEJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767792420; c=relaxed/simple; bh=K9PWfOsr2URHViwINyOwCX3J3UQ1Ltgw6a13juuLadA=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=Zicz//rDd9clSL6cUctfxpZZ9RTwuxmsnpSOVMs2ue/Fk2Aik49u9sIYgIV9gjZRPhjcYJYGOuMgzssDp778iT+pvP0Kg/NO+KXmGLmJhhVi3KwLxQomxiu7F+/sNmjX8sqNeXXW8p/cjkWek5t2SoCX2McUgK2Ap86mptSA+5s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.es; spf=pass smtp.mailfrom=amazon.es; dkim=pass (2048-bit key) header.d=amazon.es header.i=@amazon.es header.b=A5Q0r/zW; arc=none smtp.client-ip=3.65.3.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.es Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.es Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.es header.i=@amazon.es header.b="A5Q0r/zW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.es; i=@amazon.es; q=dns/txt; s=amazoncorp2; t=1767792419; x=1799328419; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=iKrltbaD/Drhq8kMDPgbTPux36kEXGe0gvAIL/BeBmI=; b=A5Q0r/zWC+tQUFtC/KQbERjY2PsJPOiWQJ1mDkC3XBEBbW75dBrrzwei o5p9RqcYiS1cvfnEs3pUrTIfNUG4iRpt/SErOTxV6oXiBgzSsJPFAHnAh lOM5qf/20CytQjO14y8K6qHECH3XQ3lYHXgTyFHxRAtyBWR/dxgxKbcVm JrCjP0yRCh9FxubSSK0hSgNN+FvVVa2AbbEeVd3pcFfnCc1lpEW48cR86 Hx1s8maxiCaKN3P/1UyorddiCekQsJjEnVdEF0s7Hkb3rzXllhxlCXC+x P/l3Jh0GyLMZ5cwcCvP6p5FCssvQaAz7h7QQDhhSpoGyULhh+4huLM0rS A==; X-CSE-ConnectionGUID: 58v3xja4QNqoj2AL1voR/A== X-CSE-MsgGUID: YggqituoT1C10BTKVOxa4w== X-IronPort-AV: E=Sophos;i="6.21,208,1763424000"; d="scan'208";a="7582955" Received: from ip-10-6-6-97.eu-central-1.compute.internal (HELO smtpout.naws.eu-central-1.prod.farcaster.email.amazon.dev) ([10.6.6.97]) by internal-fra-out-002.esa.eu-central-1.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2026 13:25:30 +0000 Received: from EX19MTAEUB001.ant.amazon.com [54.240.197.234:21286] by smtpin.naws.eu-central-1.prod.farcaster.email.amazon.dev [10.0.8.109:2525] with esmtp (Farcaster) id 39e392b3-f1d0-46cf-8878-57df51408764; Wed, 7 Jan 2026 13:25:30 +0000 (UTC) X-Farcaster-Flow-ID: 39e392b3-f1d0-46cf-8878-57df51408764 Received: from EX19D012EUA002.ant.amazon.com (10.252.50.32) by EX19MTAEUB001.ant.amazon.com (10.252.51.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.35; Wed, 7 Jan 2026 13:25:27 +0000 Received: from EX19D012EUA001.ant.amazon.com (10.252.50.122) by EX19D012EUA002.ant.amazon.com (10.252.50.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.35; Wed, 7 Jan 2026 13:25:27 +0000 Received: from EX19D012EUA001.ant.amazon.com ([fe80::b7ea:84f7:2c4b:2719]) by EX19D012EUA001.ant.amazon.com ([fe80::b7ea:84f7:2c4b:2719%3]) with mapi id 15.02.2562.035; Wed, 7 Jan 2026 13:25:27 +0000 From: "Chalios, Babis" To: "robh@kernel.org" , "krzk+dt@kernel.org" , "conor+dt@kernel.org" , "richardcochran@gmail.com" , "dwmw2@infradead.org" , "andrew+netdev@lunn.ch" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" CC: "devicetree@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Chalios, Babis" , "Graf (AWS), Alexander" , "mzxreary@0pointer.de" , "Cali, Marco" , "Woodhouse, David" Subject: [PATCH v5 1/7] ptp: vmclock: add vm generation counter Thread-Topic: [PATCH v5 1/7] ptp: vmclock: add vm generation counter Thread-Index: AQHcf9kWLvE+0o9WbU2Yd+WMMW1HBg== Date: Wed, 7 Jan 2026 13:25:27 +0000 Message-ID: <20260107132514.437-2-bchalios@amazon.es> References: <20260107132514.437-1-bchalios@amazon.es> In-Reply-To: <20260107132514.437-1-bchalios@amazon.es> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Similar to live migration, loading a VM from some saved state (aka snapshot) is also an event that calls for clock adjustments in the guest. However, guests might want to take more actions as a response to such events, e.g. as discarding UUIDs, resetting network connections, reseeding entropy pools, etc. These are actions that guests don't typically take during live migration, so add a new field in the vmclock_abi called vm_generation_counter which informs the guest about such events. Hypervisor advertises support for vm_generation_counter through the VMCLOCK_FLAG_VM_GEN_COUNTER_PRESENT flag. Users need to check the presence of this bit in vmclock_abi flags field before using this flag. Signed-off-by: Babis Chalios Reviewed-by: David Woodhouse --- include/uapi/linux/vmclock-abi.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/uapi/linux/vmclock-abi.h b/include/uapi/linux/vmclock-= abi.h index 2d99b29ac44a..937fe00e4f33 100644 --- a/include/uapi/linux/vmclock-abi.h +++ b/include/uapi/linux/vmclock-abi.h @@ -115,6 +115,12 @@ 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) =20 __u8 pad[2]; __u8 clock_status; @@ -177,6 +183,15 @@ struct vmclock_abi { __le64 time_frac_sec; /* Units of 1/2^64 of a second */ __le64 time_esterror_nanosec; __le64 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. + */ + __le64 vm_generation_counter; }; =20 #endif /* __VMCLOCK_ABI_H__ */ --=20 2.34.1