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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 16 Dec 2009 13:51:19 -0800
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	"H. Peter Anvin" <hpa@...or.com>
Cc:	Borislav Petkov <borislav.petkov@....com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] x86 msrs: alloc/free for CONFIG_SMP=n

From: Randy Dunlap <randy.dunlap@...cle.com>

Rearrange arch/x86/lib/msr.c so that alloc/free are built and
usable when CONFIG_SMP=n.  Fixes build of amd64_edac.

ERROR: "msrs_free" [drivers/edac/amd64_edac_mod.ko] undefined!
ERROR: "msrs_alloc" [drivers/edac/amd64_edac_mod.ko] undefined!

---
 arch/x86/lib/Makefile |    2 -
 arch/x86/lib/msr.c    |   42 ++++++++++++++++++++--------------------
 2 files changed, 23 insertions(+), 21 deletions(-)

--- linux-next-20091216.orig/arch/x86/lib/Makefile
+++ linux-next-20091216/arch/x86/lib/Makefile
@@ -14,7 +14,7 @@ $(obj)/inat.o: $(obj)/inat-tables.c
 
 clean-files := inat-tables.c
 
-obj-$(CONFIG_SMP) := msr.o
+obj-$(CONFIG_X86_MSR) := msr.o
 
 lib-y := delay.o
 lib-y += thunk_$(BITS).o
--- linux-next-20091216.orig/arch/x86/lib/msr.c
+++ linux-next-20091216/arch/x86/lib/msr.c
@@ -10,6 +10,7 @@ struct msr_info {
 	int err;
 };
 
+#ifdef CONFIG_SMP
 static void __rdmsr_on_cpu(void *info)
 {
 	struct msr_info *rv = info;
@@ -118,26 +119,6 @@ void wrmsr_on_cpus(const struct cpumask 
 }
 EXPORT_SYMBOL(wrmsr_on_cpus);
 
-struct msr *msrs_alloc(void)
-{
-	struct msr *msrs = NULL;
-
-	msrs = alloc_percpu(struct msr);
-	if (!msrs) {
-		pr_warning("%s: error allocating msrs\n", __func__);
-		return NULL;
-	}
-
-	return msrs;
-}
-EXPORT_SYMBOL(msrs_alloc);
-
-void msrs_free(struct msr *msrs)
-{
-	free_percpu(msrs);
-}
-EXPORT_SYMBOL(msrs_free);
-
 /* These "safe" variants are slower and should be used when the target MSR
    may not actually exist. */
 static void __rdmsr_safe_on_cpu(void *info)
@@ -234,3 +215,24 @@ int wrmsr_safe_regs_on_cpu(unsigned int 
 	return err ? err : rv.err;
 }
 EXPORT_SYMBOL(wrmsr_safe_regs_on_cpu);
+#endif
+
+struct msr *msrs_alloc(void)
+{
+	struct msr *msrs = NULL;
+
+	msrs = alloc_percpu(struct msr);
+	if (!msrs) {
+		pr_warning("%s: error allocating msrs\n", __func__);
+		return NULL;
+	}
+
+	return msrs;
+}
+EXPORT_SYMBOL(msrs_alloc);
+
+void msrs_free(struct msr *msrs)
+{
+	free_percpu(msrs);
+}
+EXPORT_SYMBOL(msrs_free);
--
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