From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze8B6-0000yS-2k for qemu-devel@nongnu.org; Mon, 21 Sep 2015 16:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ze8B0-0004j3-Ut for qemu-devel@nongnu.org; Mon, 21 Sep 2015 16:59:12 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:36828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ze8B0-0004if-QC for qemu-devel@nongnu.org; Mon, 21 Sep 2015 16:59:06 -0400 Received: by wicgb1 with SMTP id gb1so132613933wic.1 for ; Mon, 21 Sep 2015 13:59:05 -0700 (PDT) References: <1440375847-17603-1-git-send-email-cota@braap.org> <1440375847-17603-18-git-send-email-cota@braap.org> <55FF9339.2060209@redhat.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <55FF9339.2060209@redhat.com> Date: Mon, 21 Sep 2015 21:59:03 +0100 Message-ID: <87io73lca0.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [RFC 17/38] aie: add target helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: mttcg@listserver.greensocs.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, a.rigo@virtualopensystems.com, "Emilio G. Cota" , guillaume.delbergue@greensocs.com, Frederic Konrad Paolo Bonzini writes: > On 24/08/2015 02:23, Emilio G. Cota wrote: >> +void HELPER(aie_st_pre)(CPUArchState *env, target_ulong vaddr) >> +{ >> + if (unlikely(env->aie_lock_enabled)) { >> + if (env->aie_locked) { >> + return; >> + } > > Now that I've reviewed your code more carefully, the approach you're > using looks more promising than I thought. There are advantages over > Alvise's code, namely: > > - cache-line vs. page granularity There is nothing that stops Alvise's slow-path helpers having a better granularity when deciding if the exclusive flag needs tripping. However I like the lookup approach in these patches. > - avoiding the global TLB flush (due to the virtually indexed TLBs) > > - easy support for user-mode emulation > > and some of the disadvantages look more easily fixable than I thought, > too (e.g. TLB entry bloat). > > The main advantage of Alvise's code, on the other hand, is the minimal > overhead when there are no active LL/SC combinations and the better > integration with TCG. I too prefer the expression of LL/SC semantics via TCG ops. > A random idea: would it be possible to move some of the helper code to > generated TCG code? For example, maintaining a count of outstanding > load-locked operations and forcing the slow path for stores if it is > non-zero? > > Paolo > >> + aie_st_lock_ret(env, vaddr, GETRA()); >> + } else { >> + hwaddr paddr = h_get_st_phys(env, vaddr, GETRA()); >> + >> + if (unlikely(aie_entry_exists(paddr))) { >> + h_aie_lock(env, paddr); >> + } >> + } >> +} -- Alex Bennée