diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-09-22 07:08:57 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-22 07:08:57 -0400 |
commit | 0b88641f1bafdbd087d5e63987a30cc0eadd63b9 (patch) | |
tree | 81dcf756db373444140bb2623584710c628e3048 /include/asm-x86/msr.h | |
parent | fbdbf709938d155c719c76b9894d28342632c797 (diff) | |
parent | 72d31053f62c4bc464c2783974926969614a8649 (diff) |
Merge commit 'v2.6.27-rc7' into x86/debug
Diffstat (limited to 'include/asm-x86/msr.h')
-rw-r--r-- | include/asm-x86/msr.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h index a30e586df933..771bcb2f8d80 100644 --- a/include/asm-x86/msr.h +++ b/include/asm-x86/msr.h | |||
@@ -52,14 +52,14 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr, | |||
52 | { | 52 | { |
53 | DECLARE_ARGS(val, low, high); | 53 | DECLARE_ARGS(val, low, high); |
54 | 54 | ||
55 | asm volatile("2: rdmsr ; xor %0,%0\n" | 55 | asm volatile("2: rdmsr ; xor %[err],%[err]\n" |
56 | "1:\n\t" | 56 | "1:\n\t" |
57 | ".section .fixup,\"ax\"\n\t" | 57 | ".section .fixup,\"ax\"\n\t" |
58 | "3: mov %3,%0 ; jmp 1b\n\t" | 58 | "3: mov %[fault],%[err] ; jmp 1b\n\t" |
59 | ".previous\n\t" | 59 | ".previous\n\t" |
60 | _ASM_EXTABLE(2b, 3b) | 60 | _ASM_EXTABLE(2b, 3b) |
61 | : "=r" (*err), EAX_EDX_RET(val, low, high) | 61 | : [err] "=r" (*err), EAX_EDX_RET(val, low, high) |
62 | : "c" (msr), "i" (-EFAULT)); | 62 | : "c" (msr), [fault] "i" (-EFAULT)); |
63 | return EAX_EDX_VAL(val, low, high); | 63 | return EAX_EDX_VAL(val, low, high); |
64 | } | 64 | } |
65 | 65 | ||
@@ -89,15 +89,15 @@ static inline int native_write_msr_safe(unsigned int msr, | |||
89 | unsigned low, unsigned high) | 89 | unsigned low, unsigned high) |
90 | { | 90 | { |
91 | int err; | 91 | int err; |
92 | asm volatile("2: wrmsr ; xor %0,%0\n" | 92 | asm volatile("2: wrmsr ; xor %[err],%[err]\n" |
93 | "1:\n\t" | 93 | "1:\n\t" |
94 | ".section .fixup,\"ax\"\n\t" | 94 | ".section .fixup,\"ax\"\n\t" |
95 | "3: mov %4,%0 ; jmp 1b\n\t" | 95 | "3: mov %[fault],%[err] ; jmp 1b\n\t" |
96 | ".previous\n\t" | 96 | ".previous\n\t" |
97 | _ASM_EXTABLE(2b, 3b) | 97 | _ASM_EXTABLE(2b, 3b) |
98 | : "=a" (err) | 98 | : [err] "=a" (err) |
99 | : "c" (msr), "0" (low), "d" (high), | 99 | : "c" (msr), "0" (low), "d" (high), |
100 | "i" (-EFAULT) | 100 | [fault] "i" (-EFAULT) |
101 | : "memory"); | 101 | : "memory"); |
102 | return err; | 102 | return err; |
103 | } | 103 | } |
@@ -215,19 +215,20 @@ do { \ | |||
215 | #define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0) | 215 | #define write_rdtscp_aux(val) wrmsr(0xc0000103, (val), 0) |
216 | 216 | ||
217 | #ifdef CONFIG_SMP | 217 | #ifdef CONFIG_SMP |
218 | void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | 218 | int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
219 | void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | 219 | int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
220 | int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); | 220 | int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h); |
221 | |||
222 | int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); | 221 | int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h); |
223 | #else /* CONFIG_SMP */ | 222 | #else /* CONFIG_SMP */ |
224 | static inline void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) | 223 | static inline int rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h) |
225 | { | 224 | { |
226 | rdmsr(msr_no, *l, *h); | 225 | rdmsr(msr_no, *l, *h); |
226 | return 0; | ||
227 | } | 227 | } |
228 | static inline void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) | 228 | static inline int wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) |
229 | { | 229 | { |
230 | wrmsr(msr_no, l, h); | 230 | wrmsr(msr_no, l, h); |
231 | return 0; | ||
231 | } | 232 | } |
232 | static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, | 233 | static inline int rdmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, |
233 | u32 *l, u32 *h) | 234 | u32 *l, u32 *h) |