From: Avi Kivity <avi@qumranet.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Avi Kivity <avi@qumranet.com>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 2/4] [cpuid driver] Simplify smp_call_function_single() call sequence
Date: Sat, 21 Jul 2007 17:57:55 +0300 [thread overview]
Message-ID: <1185029877880-git-send-email-avi@qumranet.com> (raw)
In-Reply-To: <11850298772540-git-send-email-avi@qumranet.com>
smp_call_function_single() now knows how to call the function on the
current cpu.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
---
arch/i386/kernel/cpuid.c | 22 +++-------------------
1 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c
index 5c2faa1..5665dd2 100644
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -45,8 +45,6 @@
static struct class *cpuid_class;
-#ifdef CONFIG_SMP
-
struct cpuid_command {
u32 reg;
u32 *data;
@@ -64,25 +62,11 @@ static inline void do_cpuid(int cpu, u32 reg, u32 * data)
{
struct cpuid_command cmd;
- preempt_disable();
- if (cpu == smp_processor_id()) {
- cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
- } else {
- cmd.reg = reg;
- cmd.data = data;
+ cmd.reg = reg;
+ cmd.data = data;
- smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1);
- }
- preempt_enable();
+ smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1);
}
-#else /* ! CONFIG_SMP */
-
-static inline void do_cpuid(int cpu, u32 reg, u32 * data)
-{
- cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
-}
-
-#endif /* ! CONFIG_SMP */
static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
{
--
1.5.2.4
next prev parent reply other threads:[~2007-07-21 14:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-21 14:57 [PATCH 0/4] Clean up smp_call_function_single() callers Avi Kivity
2007-07-21 14:57 ` [PATCH 1/4] [MTRR] Simplify smp_call_function_single() call sequence Avi Kivity
2007-07-21 14:57 ` Avi Kivity [this message]
2007-07-21 14:57 ` [PATCH 3/4] [msr driver] " Avi Kivity
2007-07-21 14:57 ` [PATCH 4/4] [TIME] " Avi Kivity
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=1185029877880-git-send-email-avi@qumranet.com \
--to=avi@qumranet.com \
--cc=akpm@osdl.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/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