Received: from eggs.gnu.org ([2001:4830:134:3::10]:47104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxHdp-0005jZ-A7 for qemu-devel@nongnu.org; Thu, 20 Oct 2016 14:00:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxHdl-0001eS-Aq for qemu-devel@nongnu.org; Thu, 20 Oct 2016 14:00:33 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:34276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bxHdl-0001di-5C for qemu-devel@nongnu.org; Thu, 20 Oct 2016 14:00:29 -0400 Received: by mail-pf0-x243.google.com with SMTP id 128so6203605pfz.1 for ; Thu, 20 Oct 2016 11:00:28 -0700 (PDT) Sender: Richard Henderson References: <1472935202-3342-1-git-send-email-rth@twiddle.net> <1472935202-3342-28-git-send-email-rth@twiddle.net> <87oa3qii3c.fsf@linaro.org> <774df982-5495-cd18-fb7c-16df88903842@twiddle.net> From: Richard Henderson Message-ID: <9d3e312a-6599-6a06-462d-270efcb1ce23@twiddle.net> Date: Thu, 20 Oct 2016 11:00:24 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 27/34] target-arm: emulate LL/SC using cmpxchg helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pranith Kumar Cc: =?UTF-8?Q?Alex_Benn=c3=a9e?= , "Emilio G. Cota" , qemu-devel On 10/20/2016 10:51 AM, Pranith Kumar wrote: >> Added back >> >> /* Load/Store exclusive instructions are implemented by remembering >> the value/address loaded, and seeing if these are the same >> when the store is performed. This should be sufficient to implement >> the architecturally mandated semantics, and avoids having to monitor >> regular stores. The compare vs the remembered value is done during >> the cmpxchg operation, but we must compare the addresses manually. */ >> > > FYI, I do not see this in your v7 series. I do. It's in patch 28: /* Load/Store exclusive instructions are implemented by remembering the value/address loaded, and seeing if these are the same - when the store is performed. This should be sufficient to implement + when the store is performed. This should be sufficient to implement the architecturally mandated semantics, and avoids having to monitor - regular stores. - - In system emulation mode only one CPU will be running at once, so - this sequence is effectively atomic. In user emulation mode we - throw an exception and handle the atomic operation elsewhere. */ + regular stores. The compare vs the remembered value is done during + the cmpxchg operation, but we must compare the addresses manually. */ r~