Received: from eggs.gnu.org ([2001:4830:134:3::10]:58515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biHVC-0001vM-ER for qemu-devel@nongnu.org; Fri, 09 Sep 2016 04:49:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1biHV9-0000kk-8f for qemu-devel@nongnu.org; Fri, 09 Sep 2016 04:49:38 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:60952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biHV9-0000ka-2g for qemu-devel@nongnu.org; Fri, 09 Sep 2016 04:49:35 -0400 Date: Fri, 9 Sep 2016 09:49:19 +0100 From: Leon Alrae Message-ID: <20160909084919.GA16694@hhmipssw201.hh.imgtec.org> References: <1473328861-15792-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2] target-mips: generate fences List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, aurelien@aurel32.net On Thu, Sep 08, 2016 at 10:04:05AM -0700, Richard Henderson wrote: > > +static void gen_sync(int stype) > > +{ > > + TCGOrder tcg_mo = TCG_BAR_SC; > > + > > + switch (stype) { > > + case 0x4: /* SYNC_WMB */ > > + tcg_mo |= TCG_MO_ST_ST; > > + break; > > + case 0x10: /* SYNC_MB */ > > + tcg_mo |= TCG_MO_ALL; > > + break; > > + case 0x11: /* SYNC_ACQUIRE */ > > + tcg_mo |= TCG_MO_LD_LD | TCG_MO_LD_ST; > > + break; > > + case 0x12: /* SYNC_RELEASE */ > > + tcg_mo |= TCG_MO_ST_ST | TCG_MO_LD_ST; > > + break; > > + case 0x13: /* SYNC_RMB */ > > + tcg_mo |= TCG_MO_LD_LD; > > + break; > > + default: > > + tcg_mo |= TCG_MO_ALL; > > + break; > > + } > > See git://github.com/rth7680/qemu.git tcg-next wherein this suggests that some > enhancement is desired in tcg/mips/ as well. Not that I have a mips32r6 board > with which to test. Would you or James Hogan be able to improve that? Actually the lightweight variants of SYNC exist also in earlier revisions of MIPS architecture; therefore this can be tested for example on mips32r2. According to manuals the support is optional, and if given CPU doesn't implement lightweight SYNCs (i.e. with stype != 0) then they are supposed to behave in the same way as SYNC 0. (which also means I simplified that here and always interpret the stype to take advantage of weaker ordering barriers). Thanks, Leon