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: BUG:655 update clobber list for set_bit

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] PATCH: BUG:655 update clobber list for set_bit
From: Ryan Harper <ryanh@xxxxxxxxxx>
Date: Tue, 5 Sep 2006 17:58:45 -0500
Delivery-date: Tue, 05 Sep 2006 15:59:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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: Mutt/1.5.6+20040907i
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] PATCH: BUG:655 update clobber list for set_bit, Ryan Harper <=