From: Rusty Russell Subject: Re: [PATCH 1/9] Xen Share: Simplified I/O Mechanism Date: Wed, 07 Jun 2006 12:24:19 +1000 Message-ID: <1149647059.5183.174.camel@localhost.localdomain> References: <1149572143.5183.25.camel@localhost.localdomain> <1149604314.7721.62.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1149604314.7721.62.camel@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Harry Butterworth Cc: Xen Mailing List List-Id: xen-devel@lists.xenproject.org On Tue, 2006-06-06 at 15:31 +0100, Harry Butterworth wrote: > On Tue, 2006-06-06 at 15:35 +1000, Rusty Russell wrote: > > + __asm__ __volatile__( > > + LOCK_PREFIX "cmpxchg8b %3" > > + : "=d" (nd), "=a" (y), "=c" (d), > > + "=m" (*(volatile u64 *)(&page->count_info)) > > + : "0" (d), "1" (x), "c" (d), "b" (nx) ); > > + } > > + while ( unlikely(nd != d) || unlikely(y != x) ); > > + > > + return 1; > > +} > > What is the "=c" (d) there for? And doesn't cmpxchg8b modify the zero > flag---is it necessary to clobber the condition code register? Good questions. I copied this code from below, though, so I can conveniently punt on this one... > > diff -r d5f98d23427a xen/include/public/xen.h > > --- a/xen/include/public/xen.h Tue May 30 10:44:23 2006 > > +++ b/xen/include/public/xen.h Wed May 31 17:39:54 2006 > > @@ -64,6 +64,7 @@ > > #define __HYPERVISOR_xenoprof_op 31 > > #define __HYPERVISOR_event_channel_op 32 > > #define __HYPERVISOR_physdev_op 33 > > +#define __HYPERVISOR_share_op 33 > > Sharing no 33? Oops. Good catch, this must have been my sloppy merging. I've fixed this locally. Thanks! Rusty. -- ccontrol: http://ccontrol.ozlabs.org