diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2009-05-22 07:52:19 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2009-06-10 06:18:43 -0400 |
commit | b034c19f9f61c8b6f2435aa2e77f52348ebde767 (patch) | |
tree | 0dce206e1eaa998b7233a4679e366890881c1f7f /arch/x86/include/asm/msr.h | |
parent | 6bc1096d7ab3621b3ffcf06616d1f4e0325d903d (diff) |
x86: MSR: add methods for writing of an MSR on several CPUs
Provide for concurrent MSR writes on all the CPUs in the cpumask. Also,
add a temporary workaround for smp_call_function_many which skips the
CPU we're executing on.
Bart: zero out rv struct which is allocated on stack.
CC: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'arch/x86/include/asm/msr.h')
-rw-r--r-- | arch/x86/include/asm/msr.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 5e1213216e2b..22603764e7db 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h | |||
@@ -227,6 +227,8 @@ do { \ | |||
227 | #ifdef CONFIG_SMP | 227 | #ifdef CONFIG_SMP |
228 | int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | 228 | int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
229 | int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | 229 | int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
230 | void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); | ||
231 | void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); | ||
230 | int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | 232 | int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
231 | int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | 233 | int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
232 | #else /* CONFIG_SMP */ | 234 | #else /* CONFIG_SMP */ |
@@ -240,6 +242,16 @@ static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | |||
240 | wrmsr(msr_no, l, h); | 242 | wrmsr(msr_no, l, h); |
241 | return 0; | 243 | return 0; |
242 | } | 244 | } |
245 | static inline void rdmsr_on_cpus(const cpumask_t *m, u32 msr_no, | ||
246 | struct msr *msrs) | ||
247 | { | ||
248 | rdmsr_on_cpu(0, msr_no, &(msrs[0].l), &(msrs[0].h)); | ||
249 | } | ||
250 | static inline void wrmsr_on_cpus(const cpumask_t *m, u32 msr_no, | ||
251 | struct msr *msrs) | ||
252 | { | ||
253 | wrmsr_on_cpu(0, msr_no, msrs[0].l, msrs[0].h); | ||
254 | } | ||
243 | static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, | 255 | static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, |
244 | u32 *l, u32 *h) | 256 | u32 *l, u32 *h) |
245 | { | 257 | { |