[tip: timers/ptp] KVM: arm64: Use ktime_get_snapshot_id() to retrieve CLOCK_BOOTTIME

tip-bot2 for Thomas Gleixner posted 1 patch 3 days, 17 hours ago
arch/arm64/kvm/hyp_trace.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[tip: timers/ptp] KVM: arm64: Use ktime_get_snapshot_id() to retrieve CLOCK_BOOTTIME
Posted by tip-bot2 for Thomas Gleixner 3 days, 17 hours ago
The following commit has been merged into the timers/ptp branch of tip:

Commit-ID:     ed645be2ab1bcbc0e27242c7316fc15475962333
Gitweb:        https://git.kernel.org/tip/ed645be2ab1bcbc0e27242c7316fc15475962333
Author:        Thomas Gleixner <tglx@kernel.org>
AuthorDate:    Fri, 29 May 2026 22:00:08 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Thu, 04 Jun 2026 11:04:16 +02:00

KVM: arm64: Use ktime_get_snapshot_id() to retrieve CLOCK_BOOTTIME

ktime_get_snapshot() is replaced by ktime_get_snapshot_id() which allows to
request a particular CLOCK ID to be captured along with the clocksource
counter.

Convert the tracing mechanism over and use the new
system_time_snapshot::systime field, which holds the system timestamp
selected by the CLOCK ID argument.

No functional change intended.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Arthur Kiyanovski <akiyano@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Marc Zyngier <maz@kernel.org>
Acked-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://patch.msgid.link/20260529195557.174373054@kernel.org
---
 arch/arm64/kvm/hyp_trace.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/kvm/hyp_trace.c b/arch/arm64/kvm/hyp_trace.c
index 8b7f2bf..822ce32 100644
--- a/arch/arm64/kvm/hyp_trace.c
+++ b/arch/arm64/kvm/hyp_trace.c
@@ -51,8 +51,8 @@ static void __hyp_clock_work(struct work_struct *work)
 
 	hyp_clock = container_of(dwork, struct hyp_trace_clock, work);
 
-	ktime_get_snapshot(&snap);
-	boot = ktime_to_ns(snap.boot);
+	ktime_get_snapshot_id(CLOCK_BOOTTIME, &snap);
+	boot = ktime_to_ns(snap.systime);
 
 	delta_boot = boot - hyp_clock->boot;
 	delta_cycles = snap.cycles - hyp_clock->cycles;
@@ -118,9 +118,9 @@ static void hyp_trace_clock_enable(struct hyp_trace_clock *hyp_clock, bool enabl
 		hyp_clock->running = false;
 	}
 
-	ktime_get_snapshot(&snap);
+	ktime_get_snapshot_id(CLOCK_BOOTTIME, &snap);
 
-	hyp_clock->boot = ktime_to_ns(snap.boot);
+	hyp_clock->boot = ktime_to_ns(snap.systime);
 	hyp_clock->cycles = snap.cycles;
 	hyp_clock->mult = 0;