H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_MSR_H |
| 2 | #define _ASM_X86_MSR_H |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 3 | |
| 4 | #include <asm/msr-index.h> |
| 5 | |
Glauber de Oliveira Costa | 8f12dea | 2008-01-30 13:31:06 +0100 | [diff] [blame] | 6 | #ifdef __KERNEL__ |
| 7 | #ifndef __ASSEMBLY__ |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 8 | |
Jaswinder Singh Rajput | 8fa62ad | 2009-06-17 14:11:10 +0530 | [diff] [blame^] | 9 | #include <linux/types.h> |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 10 | #include <asm/asm.h> |
| 11 | #include <asm/errno.h> |
Borislav Petkov | 6bc1096 | 2009-05-22 12:12:01 +0200 | [diff] [blame] | 12 | #include <asm/cpumask.h> |
| 13 | |
| 14 | struct msr { |
| 15 | union { |
| 16 | struct { |
| 17 | u32 l; |
| 18 | u32 h; |
| 19 | }; |
| 20 | u64 q; |
| 21 | }; |
| 22 | }; |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 23 | |
Andrew Morton | 1e160cc | 2008-01-30 13:31:17 +0100 | [diff] [blame] | 24 | static inline unsigned long long native_read_tscp(unsigned int *aux) |
Glauber de Oliveira Costa | 8f12dea | 2008-01-30 13:31:06 +0100 | [diff] [blame] | 25 | { |
| 26 | unsigned long low, high; |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 27 | asm volatile(".byte 0x0f,0x01,0xf9" |
| 28 | : "=a" (low), "=d" (high), "=c" (*aux)); |
Max Asbock | 41aefdc | 2008-06-25 14:45:28 -0700 | [diff] [blame] | 29 | return low | ((u64)high << 32); |
Glauber de Oliveira Costa | 8f12dea | 2008-01-30 13:31:06 +0100 | [diff] [blame] | 30 | } |
| 31 | |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 32 | /* |
Jike Song | d4f1b10 | 2008-10-17 13:25:07 +0800 | [diff] [blame] | 33 | * both i386 and x86_64 returns 64-bit value in edx:eax, but gcc's "A" |
| 34 | * constraint has different meanings. For i386, "A" means exactly |
| 35 | * edx:eax, while for x86_64 it doesn't mean rdx:rax or edx:eax. Instead, |
| 36 | * it means rax *or* rdx. |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 37 | */ |
| 38 | #ifdef CONFIG_X86_64 |
| 39 | #define DECLARE_ARGS(val, low, high) unsigned low, high |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 40 | #define EAX_EDX_VAL(val, low, high) ((low) | ((u64)(high) << 32)) |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 41 | #define EAX_EDX_ARGS(val, low, high) "a" (low), "d" (high) |
| 42 | #define EAX_EDX_RET(val, low, high) "=a" (low), "=d" (high) |
| 43 | #else |
| 44 | #define DECLARE_ARGS(val, low, high) unsigned long long val |
| 45 | #define EAX_EDX_VAL(val, low, high) (val) |
| 46 | #define EAX_EDX_ARGS(val, low, high) "A" (val) |
| 47 | #define EAX_EDX_RET(val, low, high) "=A" (val) |
Glauber de Oliveira Costa | 8f12dea | 2008-01-30 13:31:06 +0100 | [diff] [blame] | 48 | #endif |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 49 | |
| 50 | static inline unsigned long long native_read_msr(unsigned int msr) |
| 51 | { |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 52 | DECLARE_ARGS(val, low, high); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 53 | |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 54 | asm volatile("rdmsr" : EAX_EDX_RET(val, low, high) : "c" (msr)); |
| 55 | return EAX_EDX_VAL(val, low, high); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | static inline unsigned long long native_read_msr_safe(unsigned int msr, |
| 59 | int *err) |
| 60 | { |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 61 | DECLARE_ARGS(val, low, high); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 62 | |
H. Peter Anvin | 08970fc | 2008-08-25 22:39:15 -0700 | [diff] [blame] | 63 | asm volatile("2: rdmsr ; xor %[err],%[err]\n" |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 64 | "1:\n\t" |
| 65 | ".section .fixup,\"ax\"\n\t" |
H. Peter Anvin | 08970fc | 2008-08-25 22:39:15 -0700 | [diff] [blame] | 66 | "3: mov %[fault],%[err] ; jmp 1b\n\t" |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 67 | ".previous\n\t" |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 68 | _ASM_EXTABLE(2b, 3b) |
H. Peter Anvin | 08970fc | 2008-08-25 22:39:15 -0700 | [diff] [blame] | 69 | : [err] "=r" (*err), EAX_EDX_RET(val, low, high) |
| 70 | : "c" (msr), [fault] "i" (-EFAULT)); |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 71 | return EAX_EDX_VAL(val, low, high); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 72 | } |
| 73 | |
Yinghai Lu | b05f78f | 2008-08-22 01:32:50 -0700 | [diff] [blame] | 74 | static inline unsigned long long native_read_msr_amd_safe(unsigned int msr, |
| 75 | int *err) |
| 76 | { |
| 77 | DECLARE_ARGS(val, low, high); |
| 78 | |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 79 | asm volatile("2: rdmsr ; xor %0,%0\n" |
| 80 | "1:\n\t" |
| 81 | ".section .fixup,\"ax\"\n\t" |
| 82 | "3: mov %3,%0 ; jmp 1b\n\t" |
| 83 | ".previous\n\t" |
| 84 | _ASM_EXTABLE(2b, 3b) |
| 85 | : "=r" (*err), EAX_EDX_RET(val, low, high) |
Yinghai Lu | b05f78f | 2008-08-22 01:32:50 -0700 | [diff] [blame] | 86 | : "c" (msr), "D" (0x9c5a203a), "i" (-EFAULT)); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 87 | return EAX_EDX_VAL(val, low, high); |
| 88 | } |
| 89 | |
Glauber de Oliveira Costa | c9dcda5 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 90 | static inline void native_write_msr(unsigned int msr, |
| 91 | unsigned low, unsigned high) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 92 | { |
Jeremy Fitzhardinge | af2b1c6 | 2008-06-25 00:18:59 -0400 | [diff] [blame] | 93 | asm volatile("wrmsr" : : "c" (msr), "a"(low), "d" (high) : "memory"); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 94 | } |
| 95 | |
Frederic Weisbecker | 0ca59dd | 2008-12-24 23:30:02 +0100 | [diff] [blame] | 96 | /* Can be uninlined because referenced by paravirt */ |
| 97 | notrace static inline int native_write_msr_safe(unsigned int msr, |
Glauber de Oliveira Costa | c9dcda5 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 98 | unsigned low, unsigned high) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 99 | { |
| 100 | int err; |
H. Peter Anvin | 08970fc | 2008-08-25 22:39:15 -0700 | [diff] [blame] | 101 | asm volatile("2: wrmsr ; xor %[err],%[err]\n" |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 102 | "1:\n\t" |
| 103 | ".section .fixup,\"ax\"\n\t" |
H. Peter Anvin | 08970fc | 2008-08-25 22:39:15 -0700 | [diff] [blame] | 104 | "3: mov %[fault],%[err] ; jmp 1b\n\t" |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 105 | ".previous\n\t" |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 106 | _ASM_EXTABLE(2b, 3b) |
H. Peter Anvin | 08970fc | 2008-08-25 22:39:15 -0700 | [diff] [blame] | 107 | : [err] "=a" (err) |
Glauber de Oliveira Costa | c9dcda5 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 108 | : "c" (msr), "0" (low), "d" (high), |
H. Peter Anvin | 08970fc | 2008-08-25 22:39:15 -0700 | [diff] [blame] | 109 | [fault] "i" (-EFAULT) |
Jeremy Fitzhardinge | af2b1c6 | 2008-06-25 00:18:59 -0400 | [diff] [blame] | 110 | : "memory"); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 111 | return err; |
| 112 | } |
| 113 | |
Ingo Molnar | cdc7957 | 2008-01-30 13:32:39 +0100 | [diff] [blame] | 114 | extern unsigned long long native_read_tsc(void); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 115 | |
Ingo Molnar | 92767af | 2008-01-30 13:32:40 +0100 | [diff] [blame] | 116 | static __always_inline unsigned long long __native_read_tsc(void) |
| 117 | { |
| 118 | DECLARE_ARGS(val, low, high); |
| 119 | |
Ingo Molnar | 92767af | 2008-01-30 13:32:40 +0100 | [diff] [blame] | 120 | asm volatile("rdtsc" : EAX_EDX_RET(val, low, high)); |
Ingo Molnar | 92767af | 2008-01-30 13:32:40 +0100 | [diff] [blame] | 121 | |
| 122 | return EAX_EDX_VAL(val, low, high); |
| 123 | } |
| 124 | |
Glauber de Oliveira Costa | b8d1fae | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 125 | static inline unsigned long long native_read_pmc(int counter) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 126 | { |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 127 | DECLARE_ARGS(val, low, high); |
| 128 | |
| 129 | asm volatile("rdpmc" : EAX_EDX_RET(val, low, high) : "c" (counter)); |
| 130 | return EAX_EDX_VAL(val, low, high); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 131 | } |
| 132 | |
| 133 | #ifdef CONFIG_PARAVIRT |
| 134 | #include <asm/paravirt.h> |
Thomas Gleixner | 96a388d | 2007-10-11 11:20:03 +0200 | [diff] [blame] | 135 | #else |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 136 | #include <linux/errno.h> |
| 137 | /* |
| 138 | * Access to machine-specific registers (available on 586 and better only) |
| 139 | * Note: the rd* operations modify the parameters directly (without using |
| 140 | * pointer indirection), this allows gcc to optimize better |
| 141 | */ |
| 142 | |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 143 | #define rdmsr(msr, val1, val2) \ |
| 144 | do { \ |
| 145 | u64 __val = native_read_msr((msr)); \ |
| 146 | (val1) = (u32)__val; \ |
| 147 | (val2) = (u32)(__val >> 32); \ |
| 148 | } while (0) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 149 | |
Glauber de Oliveira Costa | c9dcda5 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 150 | static inline void wrmsr(unsigned msr, unsigned low, unsigned high) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 151 | { |
Glauber de Oliveira Costa | c9dcda5 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 152 | native_write_msr(msr, low, high); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 153 | } |
| 154 | |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 155 | #define rdmsrl(msr, val) \ |
| 156 | ((val) = native_read_msr((msr))) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 157 | |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 158 | #define wrmsrl(msr, val) \ |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 159 | native_write_msr((msr), (u32)((u64)(val)), (u32)((u64)(val) >> 32)) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 160 | |
| 161 | /* wrmsr with exception handling */ |
Glauber de Oliveira Costa | c9dcda5 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 162 | static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 163 | { |
Glauber de Oliveira Costa | c9dcda5 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 164 | return native_write_msr_safe(msr, low, high); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 165 | } |
| 166 | |
| 167 | /* rdmsr with exception handling */ |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 168 | #define rdmsr_safe(msr, p1, p2) \ |
| 169 | ({ \ |
| 170 | int __err; \ |
| 171 | u64 __val = native_read_msr_safe((msr), &__err); \ |
| 172 | (*p1) = (u32)__val; \ |
| 173 | (*p2) = (u32)(__val >> 32); \ |
| 174 | __err; \ |
| 175 | }) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 176 | |
Andi Kleen | 1de87bd | 2008-03-22 10:59:28 +0100 | [diff] [blame] | 177 | static inline int rdmsrl_safe(unsigned msr, unsigned long long *p) |
| 178 | { |
| 179 | int err; |
| 180 | |
| 181 | *p = native_read_msr_safe(msr, &err); |
| 182 | return err; |
| 183 | } |
Yinghai Lu | b05f78f | 2008-08-22 01:32:50 -0700 | [diff] [blame] | 184 | static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p) |
| 185 | { |
| 186 | int err; |
| 187 | |
| 188 | *p = native_read_msr_amd_safe(msr, &err); |
| 189 | return err; |
| 190 | } |
Andi Kleen | 1de87bd | 2008-03-22 10:59:28 +0100 | [diff] [blame] | 191 | |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 192 | #define rdtscl(low) \ |
Ken Chen | 205516c | 2008-12-16 00:32:21 -0800 | [diff] [blame] | 193 | ((low) = (u32)__native_read_tsc()) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 194 | |
| 195 | #define rdtscll(val) \ |
Ken Chen | 205516c | 2008-12-16 00:32:21 -0800 | [diff] [blame] | 196 | ((val) = __native_read_tsc()) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 197 | |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 198 | #define rdpmc(counter, low, high) \ |
| 199 | do { \ |
| 200 | u64 _l = native_read_pmc((counter)); \ |
| 201 | (low) = (u32)_l; \ |
| 202 | (high) = (u32)(_l >> 32); \ |
| 203 | } while (0) |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 204 | |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 205 | #define rdtscp(low, high, aux) \ |
| 206 | do { \ |
| 207 | unsigned long long _val = native_read_tscp(&(aux)); \ |
| 208 | (low) = (u32)_val; \ |
| 209 | (high) = (u32)(_val >> 32); \ |
| 210 | } while (0) |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 211 | |
| 212 | #define rdtscpll(val, aux) (val) = native_read_tscp(&(aux)) |
| 213 | |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 214 | #endif /* !CONFIG_PARAVIRT */ |
| 215 | |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 216 | |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 217 | #define checking_wrmsrl(msr, val) wrmsr_safe((msr), (u32)(val), \ |
| 218 | (u32)((val) >> 32)) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 219 | |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 220 | #define write_tsc(val1, val2) wrmsr(0x10, (val1), (val2)) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 221 | |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 222 | #define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 223 | |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 224 | #ifdef CONFIG_SMP |
H. Peter Anvin | c6f3193 | 2008-08-25 17:27:21 -0700 | [diff] [blame] | 225 | int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
| 226 | int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
Borislav Petkov | b034c19 | 2009-05-22 13:52:19 +0200 | [diff] [blame] | 227 | void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); |
| 228 | void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs); |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 229 | int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
| 230 | int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
| 231 | #else /* CONFIG_SMP */ |
H. Peter Anvin | c6f3193 | 2008-08-25 17:27:21 -0700 | [diff] [blame] | 232 | static inline int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 233 | { |
| 234 | rdmsr(msr_no, *l, *h); |
H. Peter Anvin | c6f3193 | 2008-08-25 17:27:21 -0700 | [diff] [blame] | 235 | return 0; |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 236 | } |
H. Peter Anvin | c6f3193 | 2008-08-25 17:27:21 -0700 | [diff] [blame] | 237 | static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 238 | { |
| 239 | wrmsr(msr_no, l, h); |
H. Peter Anvin | c6f3193 | 2008-08-25 17:27:21 -0700 | [diff] [blame] | 240 | return 0; |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 241 | } |
Borislav Petkov | b034c19 | 2009-05-22 13:52:19 +0200 | [diff] [blame] | 242 | static inline void rdmsr_on_cpus(const cpumask_t *m, u32 msr_no, |
| 243 | struct msr *msrs) |
| 244 | { |
| 245 | rdmsr_on_cpu(0, msr_no, &(msrs[0].l), &(msrs[0].h)); |
| 246 | } |
| 247 | static inline void wrmsr_on_cpus(const cpumask_t *m, u32 msr_no, |
| 248 | struct msr *msrs) |
| 249 | { |
| 250 | wrmsr_on_cpu(0, msr_no, msrs[0].l, msrs[0].h); |
| 251 | } |
Joe Perches | abb0ade | 2008-03-23 01:02:51 -0700 | [diff] [blame] | 252 | static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, |
| 253 | u32 *l, u32 *h) |
Thomas Gleixner | be7baf8 | 2007-10-23 22:37:24 +0200 | [diff] [blame] | 254 | { |
| 255 | return rdmsr_safe(msr_no, l, h); |
| 256 | } |
| 257 | static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) |
| 258 | { |
| 259 | return wrmsr_safe(msr_no, l, h); |
| 260 | } |
| 261 | #endif /* CONFIG_SMP */ |
Glauber de Oliveira Costa | 751de83 | 2008-01-30 13:31:03 +0100 | [diff] [blame] | 262 | #endif /* __ASSEMBLY__ */ |
Glauber de Oliveira Costa | c210d24 | 2008-01-30 13:31:07 +0100 | [diff] [blame] | 263 | #endif /* __KERNEL__ */ |
H. Peter Anvin | 1965aae | 2008-10-22 22:26:29 -0700 | [diff] [blame] | 264 | #endif /* _ASM_X86_MSR_H */ |