diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-08-27 22:17:07 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-08-27 22:17:07 -0400 |
commit | b30a72a7edfc64c8929104d5c2178aca489aa559 (patch) | |
tree | 2b26c155c318d08d946bd2d70cf815dcdb29a243 /arch/x86/lib/msr-on-cpu.c | |
parent | f1c5d30e1d79bbfb60eaf189db862d3cb2bcac92 (diff) | |
parent | c1b362e3b4d331a63915b268a33207311a439d60 (diff) |
Merge branch 'x86/urgent' into x86/cpu
Conflicts:
arch/x86/kernel/cpu/cyrix.c
Diffstat (limited to 'arch/x86/lib/msr-on-cpu.c')
-rw-r--r-- | arch/x86/lib/msr-on-cpu.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/x86/lib/msr-on-cpu.c b/arch/x86/lib/msr-on-cpu.c index d5a2b39f882b..01b868ba82f8 100644 --- a/arch/x86/lib/msr-on-cpu.c +++ b/arch/x86/lib/msr-on-cpu.c | |||
@@ -30,10 +30,11 @@ static int _rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h, int safe) | |||
30 | 30 | ||
31 | rv.msr_no = msr_no; | 31 | rv.msr_no = msr_no; |
32 | if (safe) { | 32 | if (safe) { |
33 | smp_call_function_single(cpu, __rdmsr_safe_on_cpu, &rv, 1); | 33 | err = smp_call_function_single(cpu, __rdmsr_safe_on_cpu, |
34 | err = rv.err; | 34 | &rv, 1); |
35 | err = err ? err : rv.err; | ||
35 | } else { | 36 | } else { |
36 | smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 1); | 37 | err = smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 1); |
37 | } | 38 | } |
38 | *l = rv.l; | 39 | *l = rv.l; |
39 | *h = rv.h; | 40 | *h = rv.h; |
@@ -64,23 +65,24 @@ static int _wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h, int safe) | |||
64 | rv.l = l; | 65 | rv.l = l; |
65 | rv.h = h; | 66 | rv.h = h; |
66 | if (safe) { | 67 | if (safe) { |
67 | smp_call_function_single(cpu, __wrmsr_safe_on_cpu, &rv, 1); | 68 | err = smp_call_function_single(cpu, __wrmsr_safe_on_cpu, |
68 | err = rv.err; | 69 | &rv, 1); |
70 | err = err ? err : rv.err; | ||
69 | } else { | 71 | } else { |
70 | smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 1); | 72 | err = smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 1); |
71 | } | 73 | } |
72 | 74 | ||
73 | return err; | 75 | return err; |
74 | } | 76 | } |
75 | 77 | ||
76 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | 78 | int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) |
77 | { | 79 | { |
78 | _wrmsr_on_cpu(cpu, msr_no, l, h, 0); | 80 | return _wrmsr_on_cpu(cpu, msr_no, l, h, 0); |
79 | } | 81 | } |
80 | 82 | ||
81 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | 83 | int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) |
82 | { | 84 | { |
83 | _rdmsr_on_cpu(cpu, msr_no, l, h, 0); | 85 | return _rdmsr_on_cpu(cpu, msr_no, l, h, 0); |
84 | } | 86 | } |
85 | 87 | ||
86 | /* These "safe" variants are slower and should be used when the target MSR | 88 | /* These "safe" variants are slower and should be used when the target MSR |