From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MNq7s-0001gZ-Ve for qemu-devel@nongnu.org; Mon, 06 Jul 2009 11:29:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MNq7o-0001bL-5p for qemu-devel@nongnu.org; Mon, 06 Jul 2009 11:29:04 -0400 Received: from [199.232.76.173] (port=55356 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MNq7o-0001aJ-01 for qemu-devel@nongnu.org; Mon, 06 Jul 2009 11:29:00 -0400 Received: from mx20.gnu.org ([199.232.41.8]:12140) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MNq7m-0005vw-S0 for qemu-devel@nongnu.org; Mon, 06 Jul 2009 11:28:59 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MNq7k-0007XW-Rf for qemu-devel@nongnu.org; Mon, 06 Jul 2009 11:28:57 -0400 Date: Mon, 6 Jul 2009 08:28:55 -0700 From: Nathan Froyd Subject: Re: [Qemu-devel] [PATCH 0/7] target-ppc/linux-user: NPTL support Message-ID: <20090706152855.GI11286@codesourcery.com> References: <1244141522-21802-1-git-send-email-froydnj@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org On Sat, Jun 06, 2009 at 03:04:38AM +0400, malc wrote: > On Thu, 4 Jun 2009, Nathan Froyd wrote: > > The main complication comes from implementing atomic instructions > > properly. We chose to implement a simplistic model: > > > > - reserved loads record the value loaded; > > > > - conditional stores check that the memory at the effective address > > contains the value loaded by the previous reserved load, in addition > > to all other checks. if so, the store succeeds; otherwise, it fails. > > I think this will break code that relies on the fact that ll/sc is not > affected by the ABA problem. > > > It is possible to implement something more sophisticated using mprotect: The simpler scheme is slightly faster than mprotect, but not astonishingly so. In practice, it works out OK, even if it doesn't adhere to a particular interpretation of the chip docs. I'm ambivalent about which scheme goes in: I just would like to see something go in so atomic instructions/user-mode emulation threading can be properly supported on PPC (and other architectures to follow, I'm sure...). -Nathan