From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 01/15] atomic: introduce atomic operations Date: Wed, 08 Aug 2012 12:02:29 +0300 Message-ID: <50222B25.7080404@redhat.com> References: <1344407156-25562-1-git-send-email-qemulist@gmail.com> <1344407156-25562-2-git-send-email-qemulist@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Anthony Liguori , Jan Kiszka , Marcelo Tosatti , Stefan Hajnoczi , Paolo Bonzini , Blue Swirl , =?ISO-8859-1?Q?Andreas_F=E4rber?= To: Liu Ping Fan Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44106 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932460Ab2HHJCl (ORCPT ); Wed, 8 Aug 2012 05:02:41 -0400 In-Reply-To: <1344407156-25562-2-git-send-email-qemulist@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/08/2012 09:25 AM, Liu Ping Fan wrote: > From: Liu Ping Fan > > If out of global lock, we will be challenged by SMP in low level, > so need atomic ops. > > This file is heavily copied from kernel. Currently, only x86 atomic ops > included, and will be extended for other arch for future. > I propose we use gcc builtins. We get automatic architecture support, and tuning for newer processors if the user so chooses. http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html In May 2031 we can switch to C11 atomics. -- error compiling committee.c: too many arguments to function From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz2A4-0002Yb-HZ for qemu-devel@nongnu.org; Wed, 08 Aug 2012 05:02:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sz2A2-0006iK-AO for qemu-devel@nongnu.org; Wed, 08 Aug 2012 05:02:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz2A2-0006iA-26 for qemu-devel@nongnu.org; Wed, 08 Aug 2012 05:02:38 -0400 Message-ID: <50222B25.7080404@redhat.com> Date: Wed, 08 Aug 2012 12:02:29 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1344407156-25562-1-git-send-email-qemulist@gmail.com> <1344407156-25562-2-git-send-email-qemulist@gmail.com> In-Reply-To: <1344407156-25562-2-git-send-email-qemulist@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 01/15] atomic: introduce atomic operations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Ping Fan Cc: kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, Blue Swirl , Anthony Liguori , Stefan Hajnoczi , Paolo Bonzini , =?ISO-8859-1?Q?Andreas_F=E4rber?= On 08/08/2012 09:25 AM, Liu Ping Fan wrote: > From: Liu Ping Fan > > If out of global lock, we will be challenged by SMP in low level, > so need atomic ops. > > This file is heavily copied from kernel. Currently, only x86 atomic ops > included, and will be extended for other arch for future. > I propose we use gcc builtins. We get automatic architecture support, and tuning for newer processors if the user so chooses. http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html In May 2031 we can switch to C11 atomics. -- error compiling committee.c: too many arguments to function