diff options
author | Adrian Bunk <bunk@stusta.de> | 2007-02-19 19:07:13 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2007-02-20 14:29:37 -0500 |
commit | b44755cfaa72e7ed3d831a946bb4e7dfe7548966 (patch) | |
tree | 251cf0ab5aa9c39bab3f0981ab96021b5523bee3 | |
parent | 48ac3271e52d23ee987da93f80d20f6bec8e6717 (diff) |
{rd,wr}msr_on_cpu SMP=n optimization
Let's save a few bytes in the CONFIG_SMP=n case.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave Jones <davej@redhat.com>
-rw-r--r-- | arch/i386/lib/Makefile | 2 | ||||
-rw-r--r-- | arch/i386/lib/msr-on-cpu.c | 12 | ||||
-rw-r--r-- | arch/x86_64/lib/Makefile | 3 | ||||
-rw-r--r-- | include/asm-i386/msr.h | 11 | ||||
-rw-r--r-- | include/asm-x86_64/msr.h | 11 |
5 files changed, 25 insertions, 14 deletions
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile index 0d41223472c2..22d8ac5815f0 100644 --- a/arch/i386/lib/Makefile +++ b/arch/i386/lib/Makefile | |||
@@ -8,4 +8,4 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \ | |||
8 | 8 | ||
9 | lib-$(CONFIG_X86_USE_3DNOW) += mmx.o | 9 | lib-$(CONFIG_X86_USE_3DNOW) += mmx.o |
10 | 10 | ||
11 | obj-y = msr-on-cpu.o | 11 | obj-$(CONFIG_SMP) += msr-on-cpu.o |
diff --git a/arch/i386/lib/msr-on-cpu.c b/arch/i386/lib/msr-on-cpu.c index 2092ea15ba85..1c46bda409ff 100644 --- a/arch/i386/lib/msr-on-cpu.c +++ b/arch/i386/lib/msr-on-cpu.c | |||
@@ -3,7 +3,6 @@ | |||
3 | #include <linux/smp.h> | 3 | #include <linux/smp.h> |
4 | #include <asm/msr.h> | 4 | #include <asm/msr.h> |
5 | 5 | ||
6 | #ifdef CONFIG_SMP | ||
7 | struct msr_info { | 6 | struct msr_info { |
8 | u32 msr_no; | 7 | u32 msr_no; |
9 | u32 l, h; | 8 | u32 l, h; |
@@ -54,17 +53,6 @@ void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | |||
54 | } | 53 | } |
55 | preempt_enable(); | 54 | preempt_enable(); |
56 | } | 55 | } |
57 | #else | ||
58 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | ||
59 | { | ||
60 | rdmsr(msr_no, *l, *h); | ||
61 | } | ||
62 | |||
63 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | ||
64 | { | ||
65 | wrmsr(msr_no, l, h); | ||
66 | } | ||
67 | #endif | ||
68 | 56 | ||
69 | EXPORT_SYMBOL(rdmsr_on_cpu); | 57 | EXPORT_SYMBOL(rdmsr_on_cpu); |
70 | EXPORT_SYMBOL(wrmsr_on_cpu); | 58 | EXPORT_SYMBOL(wrmsr_on_cpu); |
diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile index 0a43f07b0290..43d051ff1fb4 100644 --- a/arch/x86_64/lib/Makefile +++ b/arch/x86_64/lib/Makefile | |||
@@ -4,7 +4,8 @@ | |||
4 | 4 | ||
5 | CFLAGS_csum-partial.o := -funroll-loops | 5 | CFLAGS_csum-partial.o := -funroll-loops |
6 | 6 | ||
7 | obj-y := io.o iomap_copy.o msr-on-cpu.o | 7 | obj-y := io.o iomap_copy.o |
8 | obj-$(CONFIG_SMP) += msr-on-cpu.o | ||
8 | 9 | ||
9 | lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ | 10 | lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ |
10 | usercopy.o getuser.o putuser.o \ | 11 | usercopy.o getuser.o putuser.o \ |
diff --git a/include/asm-i386/msr.h b/include/asm-i386/msr.h index 3516a1fb38e0..8c35f3d90a89 100644 --- a/include/asm-i386/msr.h +++ b/include/asm-i386/msr.h | |||
@@ -83,8 +83,19 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val) | |||
83 | : "c" (counter)) | 83 | : "c" (counter)) |
84 | #endif /* !CONFIG_PARAVIRT */ | 84 | #endif /* !CONFIG_PARAVIRT */ |
85 | 85 | ||
86 | #ifdef CONFIG_SMP | ||
86 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | 87 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
87 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | 88 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
89 | #else /* CONFIG_SMP */ | ||
90 | static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | ||
91 | { | ||
92 | rdmsr(msr_no, *l, *h); | ||
93 | } | ||
94 | static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | ||
95 | { | ||
96 | wrmsr(msr_no, l, h); | ||
97 | } | ||
98 | #endif /* CONFIG_SMP */ | ||
88 | 99 | ||
89 | /* symbolic names for some interesting MSRs */ | 100 | /* symbolic names for some interesting MSRs */ |
90 | /* Intel defined MSRs. */ | 101 | /* Intel defined MSRs. */ |
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h index 995a2b5fb26b..902f9a58617e 100644 --- a/include/asm-x86_64/msr.h +++ b/include/asm-x86_64/msr.h | |||
@@ -160,8 +160,19 @@ static inline unsigned int cpuid_edx(unsigned int op) | |||
160 | #define MSR_IA32_UCODE_WRITE 0x79 | 160 | #define MSR_IA32_UCODE_WRITE 0x79 |
161 | #define MSR_IA32_UCODE_REV 0x8b | 161 | #define MSR_IA32_UCODE_REV 0x8b |
162 | 162 | ||
163 | #ifdef CONFIG_SMP | ||
163 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | 164 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
164 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | 165 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
166 | #else /* CONFIG_SMP */ | ||
167 | static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | ||
168 | { | ||
169 | rdmsr(msr_no, *l, *h); | ||
170 | } | ||
171 | static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | ||
172 | { | ||
173 | wrmsr(msr_no, l, h); | ||
174 | } | ||
175 | #endif /* CONFIG_SMP */ | ||
165 | 176 | ||
166 | #endif | 177 | #endif |
167 | 178 | ||