From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjTsY-0005Dj-Cp for qemu-devel@nongnu.org; Mon, 12 Sep 2016 12:14:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjTsT-0004aM-Uz for qemu-devel@nongnu.org; Mon, 12 Sep 2016 12:14:41 -0400 Received: from mail-yw0-f176.google.com ([209.85.161.176]:34158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjTsT-0004Td-P1 for qemu-devel@nongnu.org; Mon, 12 Sep 2016 12:14:37 -0400 Received: by mail-yw0-f176.google.com with SMTP id g192so88843682ywh.1 for ; Mon, 12 Sep 2016 09:14:16 -0700 (PDT) Sender: Richard Henderson References: <1472935202-3342-1-git-send-email-rth@twiddle.net> <1472935202-3342-14-git-send-email-rth@twiddle.net> <20160909144616.GA6795@hhmipssw201.hh.imgtec.org> <20160912075932.GA3300@hhmipssw201.hh.imgtec.org> From: Richard Henderson Message-ID: <111ee94e-124b-3a84-0de7-ee81faecd07f@twiddle.net> Date: Mon, 12 Sep 2016 09:13:10 -0700 MIME-Version: 1.0 In-Reply-To: <20160912075932.GA3300@hhmipssw201.hh.imgtec.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 13/34] tcg: Add atomic helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leon Alrae Cc: "qemu-devel@nongnu.org" On 09/12/2016 12:59 AM, Leon Alrae wrote: > On Fri, Sep 09, 2016 at 09:26:29AM -0700, Richard Henderson wrote: >> On 09/09/2016 07:46 AM, Leon Alrae wrote: >>> Wouldn't it be useful if tcg.h provided also aliases for _le/_be atomic >>> helpers (equivalent to helper_ret_X_mmu) so that in target-* code we wouldn't >>> need to care about the endianness (specifically I'm thinking about SC in MIPS >>> where I need to select between helper_atomic_cmpxchgl_le_mmu() and >>> helper_atomic_cmpxchgl_be_mmu()). >> >> Perhaps. I would have hoped that you could do the SC inline now >> though, and tcg_gen_atomic_cmpxchg() will do the selection for you. > > On every SC we need to do the virtual -> physical address translation as we > have to compare the physical address against that of the preceeding LL. > This operation seems too complex to be inlined :( What happens if you do virtual address comparisons, like everyone else? It might not be strictly correct, but in practice I bet its no worse than using cmpxchg in the first place. r~