* [PATCH 3/3] cpuid: switch to cpuid_on_cpu()
@ 2007-04-02 11:39 Alexey Dobriyan
2007-04-02 23:25 ` H. Peter Anvin
0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2007-04-02 11:39 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, devel, cpufreq, hpa, ak, davej
Now that cpuid_on_cpu() is in core, cpuid driver can be shrinked.
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
---
arch/i386/kernel/cpuid.c | 41 +----------------------------------------
1 file changed, 1 insertion(+), 40 deletions(-)
--- a/arch/i386/kernel/cpuid.c
+++ b/arch/i386/kernel/cpuid.c
@@ -45,45 +45,6 @@ #include <asm/system.h>
static struct class *cpuid_class;
-#ifdef CONFIG_SMP
-
-struct cpuid_command {
- u32 reg;
- u32 *data;
-};
-
-static void cpuid_smp_cpuid(void *cmd_block)
-{
- struct cpuid_command *cmd = (struct cpuid_command *)cmd_block;
-
- cpuid(cmd->reg, &cmd->data[0], &cmd->data[1], &cmd->data[2],
- &cmd->data[3]);
-}
-
-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;
-
- smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1);
- }
- preempt_enable();
-}
-#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)
{
loff_t ret;
@@ -119,7 +80,7 @@ static ssize_t cpuid_read(struct file *f
return -EINVAL; /* Invalid chunk size */
for (; count; count -= 16) {
- do_cpuid(cpu, reg, data);
+ cpuid_on_cpu(cpu, reg, &data[0], &data[1], &data[2], &data[3]);
if (copy_to_user(tmp, &data, 16))
return -EFAULT;
tmp += 16;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] cpuid: switch to cpuid_on_cpu()
2007-04-02 11:39 [PATCH 3/3] cpuid: switch to cpuid_on_cpu() Alexey Dobriyan
@ 2007-04-02 23:25 ` H. Peter Anvin
0 siblings, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2007-04-02 23:25 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: akpm, linux-kernel, devel, cpufreq, ak, davej
Alexey Dobriyan wrote:
> Now that cpuid_on_cpu() is in core, cpuid driver can be shrinked.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Hi Alexey,
This, and your other changes in this area does conflict with the work
that I've been doing on extending the usability of the CPUID and MSR
drivers (which is part of why this work has dragged out seemingly forever.)
I would really appreciate it if we could work together on this; there
needs to be new paravirtualization entry points for this. Consequently,
I just updated and uploaded a git tree with the current status. It
still needs porting to x86-64, however.
The current cpuid/msr work is at:
http://git.kernel.org/?p=linux/kernel/git/hpa/linux-2.6-cpuidmsr.git;a=summary
-hpa
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] cpuid: switch to cpuid_on_cpu()
@ 2007-04-02 23:25 ` H. Peter Anvin
0 siblings, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2007-04-02 23:25 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: akpm, davej, cpufreq, linux-kernel, ak, devel
Alexey Dobriyan wrote:
> Now that cpuid_on_cpu() is in core, cpuid driver can be shrinked.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Hi Alexey,
This, and your other changes in this area does conflict with the work
that I've been doing on extending the usability of the CPUID and MSR
drivers (which is part of why this work has dragged out seemingly forever.)
I would really appreciate it if we could work together on this; there
needs to be new paravirtualization entry points for this. Consequently,
I just updated and uploaded a git tree with the current status. It
still needs porting to x86-64, however.
The current cpuid/msr work is at:
http://git.kernel.org/?p=linux/kernel/git/hpa/linux-2.6-cpuidmsr.git;a=summary
-hpa
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-04-02 23:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-02 11:39 [PATCH 3/3] cpuid: switch to cpuid_on_cpu() Alexey Dobriyan
2007-04-02 23:25 ` H. Peter Anvin
2007-04-02 23:25 ` H. Peter Anvin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.