xref: /openbmc/linux/arch/x86/include/asm/kvmclock.h (revision 8739c681)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2f4066c2bSMarcelo Tosatti #ifndef _ASM_X86_KVM_CLOCK_H
3f4066c2bSMarcelo Tosatti #define _ASM_X86_KVM_CLOCK_H
4f4066c2bSMarcelo Tosatti 
5ad9af930SZelin Deng #include <linux/percpu.h>
6ad9af930SZelin Deng 
7f4066c2bSMarcelo Tosatti extern struct clocksource kvm_clock;
8f4066c2bSMarcelo Tosatti 
9ad9af930SZelin Deng DECLARE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu);
10ad9af930SZelin Deng 
this_cpu_pvti(void)11*8739c681SPeter Zijlstra static __always_inline struct pvclock_vcpu_time_info *this_cpu_pvti(void)
12ad9af930SZelin Deng {
13ad9af930SZelin Deng 	return &this_cpu_read(hv_clock_per_cpu)->pvti;
14ad9af930SZelin Deng }
15ad9af930SZelin Deng 
this_cpu_hvclock(void)16ad9af930SZelin Deng static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void)
17ad9af930SZelin Deng {
18ad9af930SZelin Deng 	return this_cpu_read(hv_clock_per_cpu);
19ad9af930SZelin Deng }
20ad9af930SZelin Deng 
21f4066c2bSMarcelo Tosatti #endif /* _ASM_X86_KVM_CLOCK_H */
22