From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ2AM-0000g8-J1 for qemu-devel@nongnu.org; Fri, 01 Jul 2016 13:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJ2AI-0002Qv-34 for qemu-devel@nongnu.org; Fri, 01 Jul 2016 13:23:45 -0400 Received: from mail-qk0-x22a.google.com ([2607:f8b0:400d:c09::22a]:33472) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ2AH-0002Qd-Uu for qemu-devel@nongnu.org; Fri, 01 Jul 2016 13:23:42 -0400 Received: by mail-qk0-x22a.google.com with SMTP id e3so11115026qkd.0 for ; Fri, 01 Jul 2016 10:23:41 -0700 (PDT) Sender: Richard Henderson References: <1467392693-22715-1-git-send-email-rth@twiddle.net> From: Richard Henderson Message-ID: <64cb3df6-53bd-dab3-7134-335b08baf563@twiddle.net> Date: Fri, 1 Jul 2016 10:23:38 -0700 MIME-Version: 1.0 In-Reply-To: <1467392693-22715-1-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 00/27] cmpxchg-based emulation of atomics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, serge.fdrv@gmail.com, cota@braap.org, alex.bennee@linaro.org, peter.maydell@linaro.org On 07/01/2016 10:04 AM, Richard Henderson wrote: > I spent a couple evenings this week tweaking Emilio's patch set. > > The first major change is to "qemu/int128.h", so that we can use > that type in the context of a 16-byte cmpxchg. I have yet to teach > TCG code generation about this type, so it's really only usable > from other helper functions. But that's still an improvement over > having to return two uint64_t by reference. > > The second major change is to funnel atomic operation generation > through functions in tcg-op.c. There we can test whether or not > we're generating code in a parallel context and require atomic > operations. This also centralizes the helper functions so that we > don't have to have the same sets in every target. > > The third major change is providing a mechanism by which we can > trap on atomic operations that we do not support, exit the cpu loop, > stop the world, and then re-execute the instruction in a serial context. > This is obviously something that will need to be filled in further > as MTTCG progresses. > > This minimally tested, but it is good enough to boot Fedora 24 x86-64, > even with the softmmu single-step stubbed out. Perhaps unsurprisingly, > Fedora does not attempt an unaligned atomic operation. I should have mentioned -- this was based on my tcg-next branch, for which I just sent a pull request (in particular, Sergey's alignment improvement patch). I pushed my patchset to git://github.com/rth7680/qemu.git atomic-2 for ease of browsing. r~