From: "Jan Beulich" Subject: Re: [PATCH] x86: simplify non-atomic bitops Date: Wed, 11 Feb 2015 15:41:15 +0000 Message-ID: <54DB862B020000780005F227@mail.emea.novell.com> References: <54DB6984020000780005F0DB@mail.emea.novell.com> <54DB71C3.8050502@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YLZPj-0008CP-3q for xen-devel@lists.xenproject.org; Wed, 11 Feb 2015 15:41:19 +0000 In-Reply-To: <54DB71C3.8050502@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 11.02.15 at 16:14, wrote: > On 11/02/15 13:39, Jan Beulich wrote: >> @@ -55,12 +54,9 @@ static inline void set_bit(int nr, volat >> * If it's called on the same region of memory simultaneously, the effect >> * may be that only one operation succeeds. >> */ >> -static inline void __set_bit(int nr, volatile void *addr) >> +static inline void __set_bit(int nr, void *addr) >> { >> - asm volatile ( >> - "btsl %1,%0" >> - : "=m" (ADDR) >> - : "Ir" (nr), "m" (ADDR) : "memory"); >> + asm volatile ( "btsl %1,%0" : "+m" (ADDR) : "Ir" (nr) : "memory" ); > > You presumably want to s/ADDR/addr/ to avoid re-gaining the volatile > attribute on the pointer? I don't think it makes a difference, but yes, that would get things into more consistent shape. Looking at it again the memory operand could also legitimately be just an input, as we have a memory clobber. Jan