[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] PATCH: BUG:655 update clobber list for set_bit



The attached patch is a minimal change to set_bit/__set_bit clobber list
that fixes bug 655.  

On our x460 systems APICID values end up setting bits in an array past
native word size (e.g setting bit 65) and this is broken when the array
is passed on the stack as it is in the apicid_to_cpu_present() function.
If one runs set_bit() directly on the bitmap, things are fine.

I examined Linux 2.6.17 x86_64 bitops.h to compare set_bit
implementation and noticed the difference in the clobber list.  Updating
Xen to what was in 2.6.17 for set_bit and __set_bit() allowed the x460
to boot all 32 cpus instead of the first 16.  

We should probably look at updating bitops.h to what is in the latest
Linux, but I don't know much about the clobber lists to determine if we
should take all of the changes or not.

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh@xxxxxxxxxx


diffstat output:
 bitops.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Signed-off-by: Ryan Harper <ryanh@xxxxxxxxxx>
---
diff -r 66dd34f2f439 xen/include/asm-x86/bitops.h
--- a/xen/include/asm-x86/bitops.h      Tue Sep 05 12:20:31 2006 -0700
+++ b/xen/include/asm-x86/bitops.h      Tue Sep 05 17:37:44 2006 -0500
@@ -37,8 +37,8 @@ static __inline__ void set_bit(int nr, v
 {
        __asm__ __volatile__( LOCK_PREFIX
                "btsl %1,%0"
-               :"=m" (ADDR)
-               :"dIr" (nr));
+               :"+m" (ADDR)
+               :"dIr" (nr) : "memory");
 }
 
 /**
@@ -54,8 +54,8 @@ static __inline__ void __set_bit(int nr,
 {
        __asm__(
                "btsl %1,%0"
-               :"=m" (ADDR)
-               :"dIr" (nr));
+               :"+m" (ADDR)
+               :"dIr" (nr) : "memory");
 }
 
 /**

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.