Skip to content

Commit f4066c2

Browse files
matosattibonzini
authored andcommitted
kvmclock: export kvmclock clocksource and data pointers
To be used by KVM PTP driver. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 80fbd89 commit f4066c2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

arch/x86/include/asm/kvmclock.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef _ASM_X86_KVM_CLOCK_H
2+
#define _ASM_X86_KVM_CLOCK_H
3+
4+
extern struct clocksource kvm_clock;
5+
6+
#endif /* _ASM_X86_KVM_CLOCK_H */

arch/x86/kernel/kvmclock.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#include <asm/x86_init.h>
3030
#include <asm/reboot.h>
31+
#include <asm/kvmclock.h>
3132

3233
static int kvmclock __ro_after_init = 1;
3334
static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME;
@@ -49,6 +50,7 @@ struct pvclock_vsyscall_time_info *pvclock_pvti_cpu0_va(void)
4950
{
5051
return hv_clock;
5152
}
53+
EXPORT_SYMBOL_GPL(pvclock_pvti_cpu0_va);
5254

5355
/*
5456
* The wallclock is the time of day when we booted. Since then, some time may
@@ -174,13 +176,14 @@ bool kvm_check_and_clear_guest_paused(void)
174176
return ret;
175177
}
176178

177-
static struct clocksource kvm_clock = {
179+
struct clocksource kvm_clock = {
178180
.name = "kvm-clock",
179181
.read = kvm_clock_get_cycles,
180182
.rating = 400,
181183
.mask = CLOCKSOURCE_MASK(64),
182184
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
183185
};
186+
EXPORT_SYMBOL_GPL(kvm_clock);
184187

185188
int kvm_register_clock(char *txt)
186189
{

0 commit comments

Comments
 (0)