lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070402113947.GC6785@localhost.sw.ru>
Date:	Mon, 2 Apr 2007 15:39:47 +0400
From:	Alexey Dobriyan <adobriyan@...ru>
To:	akpm@...l.org
Cc:	linux-kernel@...r.kernel.org, devel@...nvz.org,
	cpufreq@...ts.linux.org.uk, hpa@...or.com, ak@...e.de,
	davej@...emonkey.org.uk
Subject: [PATCH 3/3] cpuid: switch to cpuid_on_cpu()

Now that cpuid_on_cpu() is in core, cpuid driver can be shrinked.

Signed-off-by: Alexey Dobriyan <adobriyan@...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;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ