aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/kvmclock.h6
-rw-r--r--arch/x86/kernel/kvmclock.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/include/asm/kvmclock.h b/arch/x86/include/asm/kvmclock.h
new file mode 100644
index 000000000000..f260bef63591
--- /dev/null
+++ b/arch/x86/include/asm/kvmclock.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_X86_KVM_CLOCK_H
2#define _ASM_X86_KVM_CLOCK_H
3
4extern struct clocksource kvm_clock;
5
6#endif /* _ASM_X86_KVM_CLOCK_H */
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 2a5cafdf8808..995fa260a6da 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -28,6 +28,7 @@
28 28
29#include <asm/x86_init.h> 29#include <asm/x86_init.h>
30#include <asm/reboot.h> 30#include <asm/reboot.h>
31#include <asm/kvmclock.h>
31 32
32static int kvmclock __ro_after_init = 1; 33static int kvmclock __ro_after_init = 1;
33static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME; 34static int msr_kvm_system_time = MSR_KVM_SYSTEM_TIME;
@@ -49,6 +50,7 @@ struct pvclock_vsyscall_time_info *pvclock_pvti_cpu0_va(void)
49{ 50{
50 return hv_clock; 51 return hv_clock;
51} 52}
53EXPORT_SYMBOL_GPL(pvclock_pvti_cpu0_va);
52 54
53/* 55/*
54 * The wallclock is the time of day when we booted. Since then, some time may 56 * 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)
174 return ret; 176 return ret;
175} 177}
176 178
177static struct clocksource kvm_clock = { 179struct clocksource kvm_clock = {
178 .name = "kvm-clock", 180 .name = "kvm-clock",
179 .read = kvm_clock_get_cycles, 181 .read = kvm_clock_get_cycles,
180 .rating = 400, 182 .rating = 400,
181 .mask = CLOCKSOURCE_MASK(64), 183 .mask = CLOCKSOURCE_MASK(64),
182 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 184 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
183}; 185};
186EXPORT_SYMBOL_GPL(kvm_clock);
184 187
185int kvm_register_clock(char *txt) 188int kvm_register_clock(char *txt)
186{ 189{