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.
Needed for followup patch.
Signed-off-by: Andi Kleen <ak@suse.de>
---
include/asm-x86/msr.h | 3 +++
include/asm-x86/paravirt.h | 4 ++++
2 files changed, 7 insertions(+)
Index: linux/include/asm-x86/msr.h
===================================================================
--- linux.orig/include/asm-x86/msr.h
+++ linux/include/asm-x86/msr.h
@@ -150,6 +150,9 @@ static inline int wrmsr_safe(unsigned ms
__err; \
})
+#define rdmsrl_safe(msr,p) \
+ ({ int __err; *(p) = native_read_msr_safe(msr, &__err); __err; })
+
#define rdtscl(low) \
((low) = (u32)native_read_tsc())
Index: linux/include/asm-x86/paravirt.h
===================================================================
--- linux.orig/include/asm-x86/paravirt.h
+++ linux/include/asm-x86/paravirt.h
@@ -687,6 +687,10 @@ static inline int paravirt_write_msr(uns
(*b) = _l >> 32; \
_err; })
+#define rdmsrl_safe(msr, p) ({ \
+ int _err; \
+ *(p) = paravirt_read_msr(msr, &_err); \
+ _err; })
static inline u64 paravirt_read_tsc(void)
{
--
| Al Viro | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | [2.6.22.2 review 05/84] Fix deadlocks in sparc serial console. |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Greg Kroah-Hartman | [PATCH 006/196] Chinese: add translation of oops-tracing.txt |
git: | |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Linus Torvalds | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| Manuel Bouyer | Re: Interactive performance in -current |
| YAMAMOTO Takashi | Re: statvfs(2) replacement for statfs(2) patch |
| Nathan Langford | microkernels |
| Garrett D'Amore | Re: wsmux inject |
