From: tip-bot for Alok Kataria <akataria@vmware.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
akataria@vmware.com, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:x86/urgent] x86: Print the hypervisor returned tsc_khz during boot
Date: Sun, 20 Sep 2009 18:30:20 GMT [thread overview]
Message-ID: <tip-6399c087458859cddff2d6b46befb95b866df3e0@git.kernel.org> (raw)
In-Reply-To: <1252095219.12518.13.camel@ank32.eng.vmware.com>
Commit-ID: 6399c087458859cddff2d6b46befb95b866df3e0
Gitweb: http://git.kernel.org/tip/6399c087458859cddff2d6b46befb95b866df3e0
Author: Alok Kataria <akataria@vmware.com>
AuthorDate: Fri, 4 Sep 2009 13:13:39 -0700
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 20 Sep 2009 20:25:36 +0200
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>
---
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 0a46b4d..1cbed97 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)
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");
}
/*
prev parent reply other threads:[~2009-09-20 18:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 1:08 [PATCH: x86] " Alok Kataria
2009-09-04 7:49 ` Ingo Molnar
2009-09-04 20:13 ` Alok Kataria
2009-09-20 18:30 ` tip-bot for Alok Kataria [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-6399c087458859cddff2d6b46befb95b866df3e0@git.kernel.org \
--to=akataria@vmware.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome