Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754511Ab1CGIyz (ORCPT ); Mon, 7 Mar 2011 03:54:55 -0500 Received: from mtagate7.uk.ibm.com ([194.196.100.167]:48090 "EHLO mtagate7.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753203Ab1CGIyu (ORCPT ); Mon, 7 Mar 2011 03:54:50 -0500 Date: Mon, 7 Mar 2011 09:54:38 +0100 From: Martin Schwidefsky To: Michel Lespinasse Cc: Darren Hart , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Matt Turner , Russell King , David Howells , Tony Luck , Michal Simek , Ralf Baechle , "James E.J. Bottomley" , Benjamin Herrenschmidt , Paul Mundt , "David S. Miller" , Chris Metcalf , Andrew Morton , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH] futex: cmpxchg_futex_value_locked API change Message-ID: <20110307095438.7d963d0f@mschwide.boeblingen.de.ibm.com> In-Reply-To: <20110307021127.GB31188@google.com> References: <20110307021127.GB31188@google.com> Organization: IBM Corporation X-Mailer: Claws Mail 3.7.8 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1363 Lines: 40 On Sun, 6 Mar 2011 18:11:27 -0800 Michel Lespinasse wrote: > Aplogies for the long CC list - as this proposal involves asm changes > in many architectures, and I have only been able to test on x86, > I have tried to include one maintainer from every arch so they can > hopefully double check me. I do think I got all architectures right, > but you can never be 100% sure... > > -static int __futex_atomic_cmpxchg_pt(int __user *uaddr, int oldval, int newval) > +static int __futex_atomic_cmpxchg_pt(int *uval, int __user *uaddr, > + int oldval, int newval) > { > int ret; > > asm volatile("0: cs %1,%4,0(%5)\n" > - "1: lr %0,%1\n" > + "1: l %0,0\n" > "2:\n" > EX_TABLE(0b,2b) EX_TABLE(1b,2b) > : "=d" (ret), "+d" (oldval), "=m" (*uaddr) > : "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr) > : "cc", "memory" ); > + *uval = oldval; > return ret; > } That "l %0,0" is incorrect; if you want to load a zero into %0 you can use "la %0,0". -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/