From: Keir Fraser Subject: Re: Re: [rfc] [patch] grant_entry.flags accessors Date: Wed, 28 Jun 2006 07:43:07 +0100 Message-ID: <0f343a9b98fa1fd7f496167b73007980@cl.cam.ac.uk> References: <1151097564.14454.44.camel@basalt.austin.ibm.com> <46ab924009436680faa7cc0cb807c411@cl.cam.ac.uk> <1151420814.31429.35.camel@basalt.austin.ibm.com> <6bd19f34d11ffa609d6650b7937fb8b0@cl.cam.ac.uk> <1151424690.31429.106.camel@basalt.austin.ibm.com> <20a2a4524ce898b8fbd49cfd27c38b12@cl.cam.ac.uk> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jimi Xenidis Cc: xen-devel , Hollis Blanchard , xen-ppc-devel List-Id: xen-devel@lists.xenproject.org On 27 Jun 2006, at 18:45, Jimi Xenidis wrote: > Hmm, the interesting part is that as far as bit-ops go in Linux x86 > converged to longs rather then ppc converging to some the arbitrary > bit method: > see: > include/asm-i386/bitops.h clear_bit 71 static inline void > clear_bit(int nr, volatile unsigned long * addr) > > I've been told this was to solve a performance issue, but I am no > expert. Well there would be a performance impact for other architectures, no doubt. x86/64 never moved to longs for bitops. >> , but anyway: How about add a ARCH_SUPPORTS_UNALIGNED_CMPXCHG and >> move special gnttab_cmpxchg() definition to gnttab.c, compilation >> dependent on that? > > cmpxchg will take 1,2,4 byte, and pc will take to, however we need to > abstract these anyway because the values are castes to a u32 and or'd > in an little endian way. > >> Or rename the gnttab_cmpxchg to synch_cmpxchg_unaligned so at least >> the name is a bit more generic. It could then be used in other >> contexts. > > The _main_ issue is not really alignof(p), beacuse the Xen code is > careful about that, but sizeof(*p)which we need to calculate the bit > position. Thats where this interface can get a little loosy for me. Then pick a different name. :-) *_subword()? I won't put a gnttab_foo() in synch_bitops.h. -- Keir