WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] fix rdmsrl() truncation bug

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] fix rdmsrl() truncation bug
From: Avi Kivity <avi@xxxxxxxxxxxx>
Date: Tue, 27 Dec 2005 19:04:16 +0200
Delivery-date: Fri, 30 Dec 2005 15:56:15 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)
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 <avi@xxxxxxxxxxxx>

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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] fix rdmsrl() truncation bug, Avi Kivity <=