aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lib/msr-on-cpu.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 16:13:16 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 16:13:16 -0400
commitd20ead9e86881bc7ae84e385f47b5196b7d93aac (patch)
treeed27dd5db5f8447e4b3f541f0ec38219085d2f32 /arch/x86/lib/msr-on-cpu.c
parentc56ec7639288f3e5d6371b0c48d37da93642fc93 (diff)
parent88e4d250234fc9e64d6ce51df95efdcf8334fd95 (diff)
Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86
* ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-x86: (114 commits) x86: delete vsyscall files during make clean kbuild: fix typo SRCARCH in find_sources x86: fix kernel rebuild due to vsyscall fallout .gitignore update for x86 arch x86: unify include/asm/debugreg_32/64.h x86: unify include/asm/unwind_32/64.h x86: unify include/asm/types_32/64.h x86: unify include/asm/tlb_32/64.h x86: unify include/asm/siginfo_32/64.h x86: unify include/asm/bug_32/64.h x86: unify include/asm/mman_32/64.h x86: unify include/asm/agp_32/64.h x86: unify include/asm/kdebug_32/64.h x86: unify include/asm/ioctls_32/64.h x86: unify include/asm/floppy_32/64.h x86: apply missing DMA/OOM prevention to floppy_32.h x86: unify include/asm/cache_32/64.h x86: unify include/asm/cache_32/64.h x86: unify include/asm/dmi_32/64.h x86: unify include/asm/delay_32/64.h ...
Diffstat (limited to 'arch/x86/lib/msr-on-cpu.c')
-rw-r--r--arch/x86/lib/msr-on-cpu.c62
1 files changed, 22 insertions, 40 deletions
diff --git a/arch/x86/lib/msr-on-cpu.c b/arch/x86/lib/msr-on-cpu.c
index 7767962f25d3..57d043fa893e 100644
--- a/arch/x86/lib/msr-on-cpu.c
+++ b/arch/x86/lib/msr-on-cpu.c
@@ -26,27 +26,18 @@ static void __rdmsr_safe_on_cpu(void *info)
26static int _rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h, int safe) 26static int _rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h, int safe)
27{ 27{
28 int err = 0; 28 int err = 0;
29 preempt_disable(); 29 struct msr_info rv;
30 if (smp_processor_id() == cpu) 30
31 if (safe) 31 rv.msr_no = msr_no;
32 err = rdmsr_safe(msr_no, l, h); 32 if (safe) {
33 else 33 smp_call_function_single(cpu, __rdmsr_safe_on_cpu, &rv, 0, 1);
34 rdmsr(msr_no, *l, *h); 34 err = rv.err;
35 else { 35 } else {
36 struct msr_info rv; 36 smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 0, 1);
37
38 rv.msr_no = msr_no;
39 if (safe) {
40 smp_call_function_single(cpu, __rdmsr_safe_on_cpu,
41 &rv, 0, 1);
42 err = rv.err;
43 } else {
44 smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 0, 1);
45 }
46 *l = rv.l;
47 *h = rv.h;
48 } 37 }
49 preempt_enable(); 38 *l = rv.l;
39 *h = rv.h;
40
50 return err; 41 return err;
51} 42}
52 43
@@ -67,27 +58,18 @@ static void __wrmsr_safe_on_cpu(void *info)
67static int _wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h, int safe) 58static int _wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h, int safe)
68{ 59{
69 int err = 0; 60 int err = 0;
70 preempt_disable(); 61 struct msr_info rv;
71 if (smp_processor_id() == cpu) 62
72 if (safe) 63 rv.msr_no = msr_no;
73 err = wrmsr_safe(msr_no, l, h); 64 rv.l = l;
74 else 65 rv.h = h;
75 wrmsr(msr_no, l, h); 66 if (safe) {
76 else { 67 smp_call_function_single(cpu, __wrmsr_safe_on_cpu, &rv, 0, 1);
77 struct msr_info rv; 68 err = rv.err;
78 69 } else {
79 rv.msr_no = msr_no; 70 smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 0, 1);
80 rv.l = l;
81 rv.h = h;
82 if (safe) {
83 smp_call_function_single(cpu, __wrmsr_safe_on_cpu,
84 &rv, 0, 1);
85 err = rv.err;
86 } else {
87 smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 0, 1);
88 }
89 } 71 }
90 preempt_enable(); 72
91 return err; 73 return err;
92} 74}
93 75