From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Peter Oruba <peter.oruba@amd.com>,
Tigran Aivazian <tigran@aivazian.fsnet.co.uk>,
Max Krasnyansky <maxk@qualcomm.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: [1/2 -tip, BUG-fix] x86-microcode: fix unbalanced use of get_cpu()
Date: Wed, 20 Aug 2008 00:16:13 +0200 [thread overview]
Message-ID: <1219184173.10426.33.camel@earth> (raw)
From: Dmitry Adamushko <dmitry.adamushko@gmail.com>
Subject: x86-microcode: fix unbalanced use of get_cpu()
Don't use get_cpu() at all. Resort to checking a boot-up CPU (#0) in
microcode_{intel,amd}_module_init().
---
Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com>
commit 9375be36d98cdaecefbd98904609f1aee0d50367
Author: dimm <dimm@earth.(none)>
Date: Tue Aug 19 22:40:41 2008 +0200
microcode: bug-fix
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 33b2a21..a6e76cc 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -500,13 +500,15 @@ static struct microcode_ops microcode_amd_ops = {
static int __init microcode_amd_module_init(void)
{
- struct cpuinfo_x86 *c = &cpu_data(get_cpu());
+ struct cpuinfo_x86 *c = &cpu_data(0);
equiv_cpu_table = NULL;
- if (c->x86_vendor == X86_VENDOR_AMD)
- return microcode_init(µcode_amd_ops, THIS_MODULE);
- else
+ if (c->x86_vendor != X86_VENDOR_AMD) {
+ printk(KERN_ERR "microcode: CPU platform is not AMD-capable\n");
return -ENODEV;
+ }
+
+ return microcode_init(µcode_amd_ops, THIS_MODULE);
}
static void __exit microcode_amd_module_exit(void)
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c
index d2d9d74..6dd8907 100644
--- a/arch/x86/kernel/microcode_intel.c
+++ b/arch/x86/kernel/microcode_intel.c
@@ -531,12 +531,14 @@ static struct microcode_ops microcode_intel_ops = {
static int __init microcode_intel_module_init(void)
{
- struct cpuinfo_x86 *c = &cpu_data(get_cpu());
+ struct cpuinfo_x86 *c = &cpu_data(0);
- if (c->x86_vendor == X86_VENDOR_INTEL)
- return microcode_init(µcode_intel_ops, THIS_MODULE);
- else
+ if (c->x86_vendor != X86_VENDOR_INTEL) {
+ printk(KERN_ERR "microcode: CPU platform is not Intel-capable\n");
return -ENODEV;
+ }
+
+ return microcode_init(µcode_intel_ops, THIS_MODULE);
}
static void __exit microcode_intel_module_exit(void)
reply other threads:[~2008-08-19 22:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1219184173.10426.33.camel@earth \
--to=dmitry.adamushko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maxk@qualcomm.com \
--cc=mingo@elte.hu \
--cc=peter.oruba@amd.com \
--cc=tigran@aivazian.fsnet.co.uk \
/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
all inboxes | Powered by JetHome®