]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: arm64: Make timer_set_offset() generally accessible
authorMarc Zyngier <maz@kernel.org>
Mon, 29 Sep 2025 16:04:48 +0000 (17:04 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 13 Oct 2025 13:42:40 +0000 (14:42 +0100)
Move the timer_set_offset() helper to arm_arch_timer.h, so that it
is next to timer_get_offset(), and accessible by the rest of KVM.

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/arch_timer.c
include/kvm/arm_arch_timer.h

index c832c293676a32ebf06293d1856dd191f5758f19..27662a3a3043e7eb132bd55407e400f1c7878da0 100644 (file)
@@ -146,16 +146,6 @@ static void timer_set_cval(struct arch_timer_context *ctxt, u64 cval)
        }
 }
 
-static void timer_set_offset(struct arch_timer_context *ctxt, u64 offset)
-{
-       if (!ctxt->offset.vm_offset) {
-               WARN(offset, "timer %d\n", arch_timer_ctx_index(ctxt));
-               return;
-       }
-
-       WRITE_ONCE(*ctxt->offset.vm_offset, offset);
-}
-
 u64 kvm_phys_timer_read(void)
 {
        return timecounter->cc->read(timecounter->cc);
index d8e400cb2bfff40aa8beb404fb4833680fc62794..5f7f2ed8817c5d793c951f658aea53bc2423c139 100644 (file)
@@ -179,4 +179,14 @@ static inline u64 timer_get_offset(struct arch_timer_context *ctxt)
        return offset;
 }
 
+static inline void timer_set_offset(struct arch_timer_context *ctxt, u64 offset)
+{
+       if (!ctxt->offset.vm_offset) {
+               WARN(offset, "timer %d\n", arch_timer_ctx_index(ctxt));
+               return;
+       }
+
+       WRITE_ONCE(*ctxt->offset.vm_offset, offset);
+}
+
 #endif