diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-08-22 10:32:50 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-22 10:43:21 +0200 |
commit | b05f78f5c713eda2c34e495d92495ee4f1c3b5e1 (patch) | |
tree | 87dd57341abc375131d3268d33c504e3eb609462 /include/asm-x86/msr.h | |
parent | x86_64: remove empty lines from stack traces/oopses (diff) | |
download | linux-b05f78f5c713eda2c34e495d92495ee4f1c3b5e1.tar.xz linux-b05f78f5c713eda2c34e495d92495ee4f1c3b5e1.zip |
x86_64: printout msr -v2
commandline show_msr=1 for bsp, show_msr=32 for all 32 cpus.
[ mingo@elte.hu: added documentation ]
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-x86/msr.h')
-rw-r--r-- | include/asm-x86/msr.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h index ca110ee73f07..a30e586df933 100644 --- a/include/asm-x86/msr.h +++ b/include/asm-x86/msr.h @@ -63,6 +63,22 @@ static inline unsigned long long native_read_msr_safe(unsigned int msr, return EAX_EDX_VAL(val, low, high); } +static inline unsigned long long native_read_msr_amd_safe(unsigned int msr, + int *err) +{ + DECLARE_ARGS(val, low, high); + + asm volatile("2: rdmsr ; xor %0,%0\n" + "1:\n\t" + ".section .fixup,\"ax\"\n\t" + "3: mov %3,%0 ; jmp 1b\n\t" + ".previous\n\t" + _ASM_EXTABLE(2b, 3b) + : "=r" (*err), EAX_EDX_RET(val, low, high) + : "c" (msr), "D" (0x9c5a203a), "i" (-EFAULT)); + return EAX_EDX_VAL(val, low, high); +} + static inline void native_write_msr(unsigned int msr, unsigned low, unsigned high) { @@ -158,6 +174,13 @@ static inline int rdmsrl_safe(unsigned msr, unsigned long long *p) *p = native_read_msr_safe(msr, &err); return err; } +static inline int rdmsrl_amd_safe(unsigned msr, unsigned long long *p) +{ + int err; + + *p = native_read_msr_amd_safe(msr, &err); + return err; +} #define rdtscl(low) \ ((low) = (u32)native_read_tsc()) |