Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b44755cf authored by Adrian Bunk's avatar Adrian Bunk Committed by Dave Jones
Browse files

{rd,wr}msr_on_cpu SMP=n optimization



Let's save a few bytes in the CONFIG_SMP=n case.

Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 48ac3271
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,4 +8,4 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \

lib-$(CONFIG_X86_USE_3DNOW) += mmx.o

obj-y = msr-on-cpu.o
obj-$(CONFIG_SMP)	+= msr-on-cpu.o
+0 −12
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
#include <linux/smp.h>
#include <asm/msr.h>

#ifdef CONFIG_SMP
struct msr_info {
	u32 msr_no;
	u32 l, h;
@@ -54,17 +53,6 @@ void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
	}
	preempt_enable();
}
#else
void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
{
	rdmsr(msr_no, *l, *h);
}

void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
{
	wrmsr(msr_no, l, h);
}
#endif

EXPORT_SYMBOL(rdmsr_on_cpu);
EXPORT_SYMBOL(wrmsr_on_cpu);
+2 −1
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@

CFLAGS_csum-partial.o := -funroll-loops

obj-y := io.o iomap_copy.o msr-on-cpu.o
obj-y := io.o iomap_copy.o
obj-$(CONFIG_SMP)	+= msr-on-cpu.o

lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \
	usercopy.o getuser.o putuser.o  \
+11 −0
Original line number Diff line number Diff line
@@ -83,8 +83,19 @@ static inline void wrmsrl (unsigned long msr, unsigned long long val)
			  : "c" (counter))
#endif	/* !CONFIG_PARAVIRT */

#ifdef CONFIG_SMP
void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
#else  /*  CONFIG_SMP  */
static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
{
	rdmsr(msr_no, *l, *h);
}
static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
{
	wrmsr(msr_no, l, h);
}
#endif  /*  CONFIG_SMP  */

/* symbolic names for some interesting MSRs */
/* Intel defined MSRs. */
+11 −0
Original line number Diff line number Diff line
@@ -160,8 +160,19 @@ static inline unsigned int cpuid_edx(unsigned int op)
#define MSR_IA32_UCODE_WRITE		0x79
#define MSR_IA32_UCODE_REV		0x8b

#ifdef CONFIG_SMP
void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
#else  /*  CONFIG_SMP  */
static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
{
	rdmsr(msr_no, *l, *h);
}
static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
{
	wrmsr(msr_no, l, h);
}
#endif  /*  CONFIG_SMP  */

#endif