From: Randy Dunlap <randy.dunlap@oracle•com>
To: "H. Peter Anvin" <hpa@zytor•com>
Cc: Borislav Petkov <borislav.petkov@amd•com>,
Stephen Rothwell <sfr@canb•auug.org.au>,
linux-next@vger•kernel.org, LKML <linux-kernel@vger•kernel.org>
Subject: [PATCH -next] x86 msrs: alloc/free for CONFIG_SMP=n
Date: Wed, 16 Dec 2009 13:51:19 -0800 [thread overview]
Message-ID: <20091216135119.e283e525.randy.dunlap@oracle.com> (raw)
In-Reply-To: <4B2928AC.3020807@zytor.com>
From: Randy Dunlap <randy.dunlap@oracle•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);
next prev parent reply other threads:[~2009-12-16 21:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 7:32 linux-next: Tree for December 16 Stephen Rothwell
2009-12-16 17:24 ` linux-next: Tree for December 16 (amd64_edac) Randy Dunlap
2009-12-16 17:32 ` H. Peter Anvin
2009-12-16 17:45 ` Borislav Petkov
2009-12-16 18:36 ` H. Peter Anvin
2009-12-16 21:51 ` Randy Dunlap [this message]
2009-12-16 21:58 ` [PATCH -next] x86 msrs: alloc/free for CONFIG_SMP=n Borislav Petkov
2009-12-16 22:02 ` Randy Dunlap
2009-12-16 22:41 ` H. Peter Anvin
2009-12-16 23:16 ` Borislav Petkov
2009-12-16 21:54 ` linux-next: Tree for December 16 (amd64_edac) Borislav Petkov
2009-12-16 22:26 ` [PATCH -next] power: fix printk formats Randy Dunlap
2009-12-16 22:35 ` Rafael J. Wysocki
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=20091216135119.e283e525.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle$(echo .)com \
--cc=borislav.petkov@amd$(echo .)com \
--cc=hpa@zytor$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=sfr@canb$(echo .)auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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