Skip to content

Commit a92d552

Browse files
author
Marc Zyngier
committed
KVM: arm64: Make timer_set_offset() generally accessible
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>
1 parent 8625a67 commit a92d552

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

arch/arm64/kvm/arch_timer.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,6 @@ static void timer_set_cval(struct arch_timer_context *ctxt, u64 cval)
146146
}
147147
}
148148

149-
static void timer_set_offset(struct arch_timer_context *ctxt, u64 offset)
150-
{
151-
if (!ctxt->offset.vm_offset) {
152-
WARN(offset, "timer %d\n", arch_timer_ctx_index(ctxt));
153-
return;
154-
}
155-
156-
WRITE_ONCE(*ctxt->offset.vm_offset, offset);
157-
}
158-
159149
u64 kvm_phys_timer_read(void)
160150
{
161151
return timecounter->cc->read(timecounter->cc);

include/kvm/arm_arch_timer.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,14 @@ static inline u64 timer_get_offset(struct arch_timer_context *ctxt)
179179
return offset;
180180
}
181181

182+
static inline void timer_set_offset(struct arch_timer_context *ctxt, u64 offset)
183+
{
184+
if (!ctxt->offset.vm_offset) {
185+
WARN(offset, "timer %d\n", arch_timer_ctx_index(ctxt));
186+
return;
187+
}
188+
189+
WRITE_ONCE(*ctxt->offset.vm_offset, offset);
190+
}
191+
182192
#endif

0 commit comments

Comments
 (0)