From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAbin-0005g3-5e for qemu-devel@nongnu.org; Wed, 08 Jun 2016 07:32:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAbil-0000jk-74 for qemu-devel@nongnu.org; Wed, 08 Jun 2016 07:32:28 -0400 Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:34319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAbik-0000jg-S4 for qemu-devel@nongnu.org; Wed, 08 Jun 2016 07:32:27 -0400 Received: by mail-vk0-x235.google.com with SMTP id e4so6769929vkb.1 for ; Wed, 08 Jun 2016 04:32:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20160526163549.3276-2-a.rigo@virtualopensystems.com> <87fusoghnu.fsf@linaro.org> From: Peter Maydell Date: Wed, 8 Jun 2016 12:32:05 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [RFC 01/10] exec: Introduce tcg_exclusive_{lock, unlock}() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alvise rigo Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , MTTCG Devel , QEMU Developers , Jani Kokkonen , Claudio Fontana , VirtualOpenSystems Technical Team , =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= , Paolo Bonzini , Richard Henderson , Sergey Fedorov , "Emilio G. Cota" On 8 June 2016 at 11:00, alvise rigo wrote: > As far as I understand, linux-user uses a mutex to make the atomic > accesses exclusive with respect to other CPU's atomic accesses. So > basically in the LDREX case it implements: > lock() -> access() -> unlock() > This patch series makes the atomic accesses exclusive with respect to > every memory access, this is allowed by the softmmu. The access is now > something like: > lock() -> softmmu_access() -> unlock() > where "softmmu_access()" is not just a memory access, but includes a > manipulation of the EXCL bitmap and possible queries of TLB flushes. > So there are similarities, but are pretty much confined to the > locking/unlocking of a spinlock/mutex. > > This made me think, how does linux-user can properly work with > upstream TCG, for instance, in an absurd configuration like target-arm > on ARM host? linux-user's exclusives handling is "broken but happens to sort of work most of the time". Fixing this and bringing it into line with how we want to handle exclusives in the multithreaded system emulation case is one of the things I was hoping would come out of the MTTCG work... thanks -- PMM