From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KySB5-0008RO-Gd for qemu-devel@nongnu.org; Fri, 07 Nov 2008 09:19:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KySB4-0008QX-Uc for qemu-devel@nongnu.org; Fri, 07 Nov 2008 09:19:11 -0500 Received: from [199.232.76.173] (port=39882 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KySB4-0008QL-M9 for qemu-devel@nongnu.org; Fri, 07 Nov 2008 09:19:10 -0500 Received: from yx-out-1718.google.com ([74.125.44.155]:52748) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KySB4-0003S4-9u for qemu-devel@nongnu.org; Fri, 07 Nov 2008 09:19:10 -0500 Received: by yx-out-1718.google.com with SMTP id 3so471402yxi.82 for ; Fri, 07 Nov 2008 06:19:08 -0800 (PST) Message-ID: <761ea48b0811070619y3a6447e9g7b07dee73703ef6c@mail.gmail.com> Date: Fri, 7 Nov 2008 15:19:08 +0100 From: "Laurent Desnogues" Subject: Re: [Qemu-devel] [PATCH] Alpha: fix locked loads/stores In-Reply-To: <20081107140034.GA28030@volta.aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <761ea48b0811070334lb817c00x38624ca7bb41bb57@mail.gmail.com> <20081107140034.GA28030@volta.aurel32.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Fri, Nov 7, 2008 at 3:00 PM, Aurelien Jarno wrote: > On Fri, Nov 07, 2008 at 12:34:29PM +0100, Laurent Desnogues wrote: >> Hello, >> >> this patch is based on Vince Weaver patch for locked loads/stores. >> It was checked against Alpha architecture manual. >> >> Two fixes were done to Vince's patch: >> >> - use a comparison to 1 for lock instead of 0 to be closer to the >> Alpha spec > > I don't agree with this part. The current code use a single variable for > both address and lock_bit to spare a few tests. Basically it sets > cpu_lock to -1 when not locked and stores the address when locked. Your > patch does not compare the address, so it will break multi-threading. My understanding of the Alpha architecture manual is that if the addresses don't meet certain criteria (which you simplify to addresses comparison) then failure or success of st_c is UNPREDICTABLE (I am not shouting, it's the way they write it :-) unless some lock clearing occurred (cf section 4.2.5). I am not arguing, I just wonder... Laurent