forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
bfefb7a0c6
commit
6399c08745
@ -58,6 +58,9 @@ static unsigned long vmware_get_tsc_khz(void)
|
||||
tsc_hz = eax | (((uint64_t)ebx) << 32);
|
||||
do_div(tsc_hz, 1000);
|
||||
BUG_ON(tsc_hz >> 32);
|
||||
printk(KERN_INFO "TSC freq read from hypervisor : %lu.%03lu MHz\n",
|
||||
(unsigned long) tsc_hz / 1000,
|
||||
(unsigned long) tsc_hz % 1000);
|
||||
return tsc_hz;
|
||||
}
|
||||
|
||||
@ -69,6 +72,9 @@ void __init vmware_platform_setup(void)
|
||||
|
||||
if (ebx != UINT_MAX)
|
||||
x86_platform.calibrate_tsc = vmware_get_tsc_khz;
|
||||
else
|
||||
printk(KERN_WARNING
|
||||
"Failed to get TSC freq from the hypervisor\n");
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user