diff options
author | Alok Kataria <akataria@vmware.com> | 2009-09-04 16:13:39 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-20 14:25:36 -0400 |
commit | 6399c087458859cddff2d6b46befb95b866df3e0 (patch) | |
tree | 15290084df15c7999adf4e3ecbae067ab280d0fb /arch | |
parent | bfefb7a0c6e08736f2d5917c468467f134bf28bb (diff) |
x86: Print the hypervisor returned tsc_khz during boot
On an AMD-64 system the processor frequency that is printed during
system boot, may be different than the tsc frequency that was
returned by the hypervisor, due to the value returned from
calibrate_cpu.
For debugging timekeeping or other related issues it might be
better to get the tsc_khz value returned by the hypervisor.
The patch below now prints the tsc frequency that the VMware
hypervisor returned.
Signed-off-by: Alok N Kataria <akataria@vmware.com>
LKML-Reference: <1252095219.12518.13.camel@ank32.eng.vmware.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/vmware.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c index 0a46b4df5d80..1cbed97b59cf 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c | |||
@@ -58,6 +58,9 @@ static unsigned long vmware_get_tsc_khz(void) | |||
58 | tsc_hz = eax | (((uint64_t)ebx) << 32); | 58 | tsc_hz = eax | (((uint64_t)ebx) << 32); |
59 | do_div(tsc_hz, 1000); | 59 | do_div(tsc_hz, 1000); |
60 | BUG_ON(tsc_hz >> 32); | 60 | BUG_ON(tsc_hz >> 32); |
61 | printk(KERN_INFO "TSC freq read from hypervisor : %lu.%03lu MHz\n", | ||
62 | (unsigned long) tsc_hz / 1000, | ||
63 | (unsigned long) tsc_hz % 1000); | ||
61 | return tsc_hz; | 64 | return tsc_hz; |
62 | } | 65 | } |
63 | 66 | ||
@@ -69,6 +72,9 @@ void __init vmware_platform_setup(void) | |||
69 | 72 | ||
70 | if (ebx != UINT_MAX) | 73 | if (ebx != UINT_MAX) |
71 | x86_platform.calibrate_tsc = vmware_get_tsc_khz; | 74 | x86_platform.calibrate_tsc = vmware_get_tsc_khz; |
75 | else | ||
76 | printk(KERN_WARNING | ||
77 | "Failed to get TSC freq from the hypervisor\n"); | ||
72 | } | 78 | } |
73 | 79 | ||
74 | /* | 80 | /* |