From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buRV3-0001R7-BG for qemu-devel@nongnu.org; Wed, 12 Oct 2016 17:55:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buRUz-0004b6-6D for qemu-devel@nongnu.org; Wed, 12 Oct 2016 17:55:44 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:33387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buRUw-0004ZU-Ij for qemu-devel@nongnu.org; Wed, 12 Oct 2016 17:55:40 -0400 Date: Wed, 12 Oct 2016 17:55:27 -0400 From: "Emilio G. Cota" Message-ID: <20161012215527.GA8852@flamenco> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] MTTCG memory ordering List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: pranith kumar , Alex =?iso-8859-1?Q?Benn=E9e?= , qemu-devel , Richard Henderson On Wed, Oct 12, 2016 at 10:58:43 +0200, Stefan Hajnoczi wrote: > Hi Pranith, > I was curious about the status of your MTTCG GSoC work: > > I saw your fence series which implements the noop memory barrier/fence > instructions on various architectures, but I wasn't sure if that also > covers the case where a strong target is emulated on a weak host. > > Did you make TCG automatically emit barriers so stronger targets (x86) > run correctly on weaker targets (ARM)? Here are some numbers on this. Chart: http://imgur.com/a/H9E9R The overhead of emitting barriers all over the place is significant (~3x for integer code), but that's the price of correctness as the ArMOR paper shows[*] (this is the SYNC option in the chart). A faster alternative also provided by ArMOR is to pretend the host isn't multi-copy atomic (i.e. the iriw litmus test would fail); this is the PowerA option in the chart. An even better alternative is to let the hardware deal with this. Unfortunately, so far only recent IBM processors support this (the feature is called Strong Access Ordering--SAO in the chart). [*] ArMOR: Defending Against Memory Consistency Model Mismatches in Heterogeneous Architectures http://www.cs.princeton.edu/~ctrippel/dlustig_ISCA15.pdf Emilio