diff options
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r-- | arch/x86/kernel/tsc.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 62348e4fd8d1..6dbf0bcb44a8 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/vgtod.h> | 15 | #include <asm/vgtod.h> |
16 | #include <asm/time.h> | 16 | #include <asm/time.h> |
17 | #include <asm/delay.h> | 17 | #include <asm/delay.h> |
18 | #include <asm/hypervisor.h> | ||
18 | 19 | ||
19 | unsigned int cpu_khz; /* TSC clocks / usec, not used here */ | 20 | unsigned int cpu_khz; /* TSC clocks / usec, not used here */ |
20 | EXPORT_SYMBOL(cpu_khz); | 21 | EXPORT_SYMBOL(cpu_khz); |
@@ -352,9 +353,15 @@ unsigned long native_calibrate_tsc(void) | |||
352 | { | 353 | { |
353 | u64 tsc1, tsc2, delta, ref1, ref2; | 354 | u64 tsc1, tsc2, delta, ref1, ref2; |
354 | unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX; | 355 | unsigned long tsc_pit_min = ULONG_MAX, tsc_ref_min = ULONG_MAX; |
355 | unsigned long flags, latch, ms, fast_calibrate; | 356 | unsigned long flags, latch, ms, fast_calibrate, tsc_khz; |
356 | int hpet = is_hpet_enabled(), i, loopmin; | 357 | int hpet = is_hpet_enabled(), i, loopmin; |
357 | 358 | ||
359 | tsc_khz = get_hypervisor_tsc_freq(); | ||
360 | if (tsc_khz) { | ||
361 | printk(KERN_INFO "TSC: Frequency read from the hypervisor\n"); | ||
362 | return tsc_khz; | ||
363 | } | ||
364 | |||
358 | local_irq_save(flags); | 365 | local_irq_save(flags); |
359 | fast_calibrate = quick_pit_calibrate(); | 366 | fast_calibrate = quick_pit_calibrate(); |
360 | local_irq_restore(flags); | 367 | local_irq_restore(flags); |