Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+10 -10
-10
arch/arm64/kvm/arch_timer.c
··· 146 146 } 147 147 } 148 148 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 - 159 149 u64 kvm_phys_timer_read(void) 160 150 { 161 151 return timecounter->cc->read(timecounter->cc);
+10
include/kvm/arm_arch_timer.h
··· 179 179 return offset; 180 180 } 181 181 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 + 182 192 #endif