From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH] fix rdmsrl() truncation bug Date: Tue, 27 Dec 2005 19:04:16 +0200 Message-ID: <43B17410.40600@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org 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. Signed-off-by: Avi Kivity diff -r 829517be689f xen/include/asm-x86/msr.h --- a/xen/include/asm-x86/msr.h Fri Dec 23 15:42:46 2005 +++ b/xen/include/asm-x86/msr.h Tue Dec 27 19:02:09 2005 @@ -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) \ -- error compiling committee.c: too many arguments to function