Skip to contentSkip to conversation

fix rdmsrl() truncation bug

PATCH New Avi Kivity 1 participant 1 message Dec 27, 2005

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 fix rdmsrl() truncation bug

rdmsrl() shifts an unsigned long by 32 bits, which on x86_32 results in the data being discarded. patch fixes that by casting to __u64 before the shift.

xen/include/asm-x86/msr.h +0 -0
diff -r 829517be689f xen/include/asm-x86/msr.h
@@ -12,7 +12,7 @@
       __asm__ __volatile__("rdmsr" \
			    : "=a" (a__), "=d" (b__) \
			    : "c" (msr)); \
-       val = a__ | (b__<<32); \
+       val = a__ | ((__u64)b__<<32); \

} while(0);

#define wrmsr(msr,val1,val2) \

Signature · 1 line
error compiling committee.c: too many arguments to function