diff options
Diffstat (limited to 'arch/x86/include/asm/msr.h')
-rw-r--r-- | arch/x86/include/asm/msr.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h index 638bf6241807..22603764e7db 100644 --- a/arch/x86/include/asm/msr.h +++ b/arch/x86/include/asm/msr.h | |||
@@ -12,6 +12,17 @@ | |||
12 | 12 | ||
13 | #include <asm/asm.h> | 13 | #include <asm/asm.h> |
14 | #include <asm/errno.h> | 14 | #include <asm/errno.h> |
15 | #include <asm/cpumask.h> | ||
16 | |||
17 | struct msr { | ||
18 | union { | ||
19 | struct { | ||
20 | u32 l; | ||
21 | u32 h; | ||
22 | }; | ||
23 | u64 q; | ||
24 | }; | ||
25 | }; | ||
15 | 26 | ||
16 | static inline unsigned long long native_read_tscp(unsigned int *aux) | 27 | static inline unsigned long long native_read_tscp(unsigned int *aux) |
17 | { | 28 | { |
@@ -216,6 +227,8 @@ do { \ | |||
216 | #ifdef CONFIG_SMP | 227 | #ifdef CONFIG_SMP |
217 | 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); |
218 | 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); | ||
219 | 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); |
220 | 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); |
221 | #else /* CONFIG_SMP */ | 234 | #else /* CONFIG_SMP */ |
@@ -229,6 +242,16 @@ static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | |||
229 | wrmsr(msr_no, l, h); | 242 | wrmsr(msr_no, l, h); |
230 | return 0; | 243 | return 0; |
231 | } | 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 | } | ||
232 | 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, |
233 | u32 *l, u32 *h) | 256 | u32 *l, u32 *h) |
234 | { | 257 | { |