Skip to contentSkip to conversation

use __u32 in asm-x86_64/msr.h

PATCH In review Mike Frysinger 2 participants 2 messages Jan 30, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use __u32 in asm-x86_64/msr.h

the checking_wrmsrl() macro in asm-x86_64/msr.h which is exported to userspace utilizes the u32 type instead of __u32 ... trivial attached patch fixes that -mike

Use __u32 rather than u32 in checking_wrmsrl() exported to userspace.

include/asm-x86_64/msr.h +4 -1
@@ -2,6 +2,9 @@
 #define X86_64_MSR_H 1
 
 #ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+
 /*
  * Access to machine-specific registers (available on 586 and better only)
  * Note: the rd* operations modify the parameters directly (without using
@@ -43,7 +46,7 @@
 		     : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \
 	ret__; })
 
-#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32))
+#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(__u32)(val),(__u32)((val)>>32))
 
 #define rdmsr_safe(msr,a,b) \
 	({ int ret__;						\
#1 lore raw
Quoted 2 lines · Mike Frysinger

the checking_wrmsrl() macro in asm-x86_64/msr.h which is exported to userspace utilizes the u32 type instead of __u32 ... trivial attached patch fixes that

Better would be to not export those macros to userspace at all, as they can't be used outside of ring 0 anyway.

Dave

Signature · 1 line
http://www.codemonkey.org.uk