From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLTE-0005uT-Pa for qemu-devel@nongnu.org; Wed, 19 Jun 2013 12:42:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpLTC-0008Pw-Us for qemu-devel@nongnu.org; Wed, 19 Jun 2013 12:42:56 -0400 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:36739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLTC-0008Ph-NS for qemu-devel@nongnu.org; Wed, 19 Jun 2013 12:42:54 -0400 Received: by mail-we0-f175.google.com with SMTP id t59so4731288wes.34 for ; Wed, 19 Jun 2013 09:42:53 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51C1DF87.8090704@redhat.com> Date: Wed, 19 Jun 2013 18:42:47 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1371675569-6516-1-git-send-email-pingfank@linux.vnet.ibm.com> <1371675569-6516-2-git-send-email-pingfank@linux.vnet.ibm.com> <51C1DE62.9090308@twiddle.net> In-Reply-To: <51C1DE62.9090308@twiddle.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 1/2] add a header file for atomic operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Kevin Wolf , Torvald Riegel , Stefan Hajnoczi , Andrew Haley , Liu Ping Fan , qemu-devel@nongnu.org, Anthony Liguori , "Paul E. McKenney" Il 19/06/2013 18:37, Richard Henderson ha scritto: >> > +#ifndef atomic_read >> > +#define atomic_read(ptr) (*(__typeof__(*ptr) *volatile) (ptr)) >> > #endif >> > >> > +#ifndef atomic_set >> > +#define atomic_set(ptr, i) ((*(__typeof__(*ptr) *volatile) (ptr)) = (i)) >> > +#endif > I still think these should be enhanced to reject operations larger > than word-size, so that we don't accidentally introduce bugs for our > 32-bit hosts. But that can be done as a follow-up. Oops, forgot about that (and also using relaxed instead of volatile). Will do as a follow-up. Thanks! Paolo > Otherwise, everything looks consistent now. > > Reviewed-by: Richard Henderson