From: Prarit Bhargava <prarit@redhat.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, mark.langsdorf@amd.com
Subject: Re: [PATCH] Warn of incorrect cpu_khz on AMD systems
Date: Wed, 12 Nov 2008 13:35:00 -0500 [thread overview]
Message-ID: <491B21D4.5030001@redhat.com> (raw)
In-Reply-To: <20081106090118.GC4890@elte.hu>
[-- Attachment #1: Type: text/plain, Size: 74 bytes --]
New patch replacing printk with WARN() based on Ingo's suggestion...
P.
[-- Attachment #2: upstream.patch --]
[-- Type: text/plain, Size: 775 bytes --]
If none of the perfctrs are free when calculating cpu_khz we default to using
ctr 3 (ie, we just choose 3). This may lead to an incorrect tsc freq value
which can cause the system to be unstable.
To aid in future debugging, WARN the user of a potential problem.
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c
index cb19d65..e71d1ba 100644
--- a/arch/x86/kernel/time_64.c
+++ b/arch/x86/kernel/time_64.c
@@ -80,6 +80,8 @@ unsigned long __init calibrate_cpu(void)
break;
no_ctr_free = (i == 4);
if (no_ctr_free) {
+ WARN(1, KERN_WARN "Warning: AMD perfctrs busy ... "
+ "cpu_khz value may be incorrect.\n");
i = 3;
rdmsrl(MSR_K7_EVNTSEL3, evntsel3);
wrmsrl(MSR_K7_EVNTSEL3, 0);
next prev parent reply other threads:[~2008-11-12 18:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 15:27 [PATCH] Warn of incorrect cpu_khz on AMD systems Prarit Bhargava
2008-11-06 9:01 ` Ingo Molnar
2008-11-06 13:42 ` Prarit Bhargava
2008-11-12 18:35 ` Prarit Bhargava [this message]
2008-11-12 18:54 ` Ingo Molnar
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=491B21D4.5030001@redhat.com \
--to=prarit@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.langsdorf@amd.com \
--cc=mingo@elte.hu \
--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