aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndi Kleen <andi@firstfloor.org>2008-03-22 05:59:28 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:41:30 -0400
commit1de87bd40e119d26533b5135677901990390bfa9 (patch)
tree862877f6e54993a9067fffc0d545e75697a8184e /include
parentf5c24a7fd0798d636af184cc7032e7e0cb149112 (diff)
x86: re-add rdmsrl_safe
RDMSR for 64bit values with exception handling. Makes it easier to deal with 64bit valued MSRs. The old 64bit code base had that too as checking_rdmsrl(), but it got dropped somehow. Signed-off-by: Andi Kleen <andi@firstfloor.org> Cc: andreas.herrmann3@amd.com Cc: mingo@elte.hu Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/msr.h8
-rw-r--r--include/asm-x86/paravirt.h7
2 files changed, 15 insertions, 0 deletions
diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h
index 2c698a2e81f9..3707650a169b 100644
--- a/include/asm-x86/msr.h
+++ b/include/asm-x86/msr.h
@@ -150,6 +150,14 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high)
150 __err; \ 150 __err; \
151}) 151})
152 152
153static inline int rdmsrl_safe(unsigned msr, unsigned long long *p)
154{
155 int err;
156
157 *p = native_read_msr_safe(msr, &err);
158 return err;
159}
160
153#define rdtscl(low) \ 161#define rdtscl(low) \
154 ((low) = (u32)native_read_tsc()) 162 ((low) = (u32)native_read_tsc())
155 163
diff --git a/include/asm-x86/paravirt.h b/include/asm-x86/paravirt.h
index 0c23f7940bc4..3d419398499b 100644
--- a/include/asm-x86/paravirt.h
+++ b/include/asm-x86/paravirt.h
@@ -693,6 +693,13 @@ do { \
693 _err; \ 693 _err; \
694}) 694})
695 695
696static inline int rdmsrl_safe(unsigned msr, unsigned long long *p)
697{
698 int err;
699
700 *p = paravirt_read_msr(msr, &err);
701 return err;
702}
696 703
697static inline u64 paravirt_read_tsc(void) 704static inline u64 paravirt_read_tsc(void)
698{ 705{