All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh@us.ibm.com>
To: xen-devel@lists.xensource.com
Subject: PATCH: BUG:655 update clobber list for set_bit
Date: Tue, 5 Sep 2006 17:58:45 -0500	[thread overview]
Message-ID: <20060905225845.GU31723@us.ibm.com> (raw)

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@us.ibm.com


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

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
---
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");
 }
 
 /**

                 reply	other threads:[~2006-09-05 22:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060905225845.GU31723@us.ibm.com \
    --to=ryanh@us.ibm.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.