From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boSlg-0006aL-54 for qemu-devel@nongnu.org; Mon, 26 Sep 2016 06:04:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boSle-0006vv-3h for qemu-devel@nongnu.org; Mon, 26 Sep 2016 06:04:11 -0400 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]:34464) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boSld-0006vg-TZ for qemu-devel@nongnu.org; Mon, 26 Sep 2016 06:04:10 -0400 Received: by mail-oi0-x244.google.com with SMTP id a62so13245369oib.1 for ; Mon, 26 Sep 2016 03:04:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1473847013-20191-1-git-send-email-pbonzini@redhat.com> References: <1473847013-20191-1-git-send-email-pbonzini@redhat.com> From: Laurent Desnogues Date: Mon, 26 Sep 2016 12:04:08 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 0/3] target-arm: cache tbflags in CPUARMState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: "qemu-devel@nongnu.org" Hello, On Wed, Sep 14, 2016 at 11:56 AM, Paolo Bonzini wrote: > Computing TranslationBlock flags is pretty expensive on ARM, especially > 32-bit. Because tbflags are computed on every tb lookup, it is not > unlikely to see cpu_get_tb_cpu_state close to the top of the profile > now that QHT makes the hash table much more efficient. > > However, most tbflags only change when the EL is switched or after > MSR instructions. Based on this observation, this series caches these > tbflags in CPUARMState, resulting in a 10-15% speedup on 32-bit code. I like that patch! I quickly tested with some softmmu images on both AArch32 and AArch64 and I can confirm the speedup. As far as your patch goes: Tested-by: Laurent Desnogues Reviewed-by: Laurent Desnogues Thanks, Laurent PS - BTW, I couldn't run any user mode program since they segfault on mainline for some reason I have no time to look into. The v2.7.0 tag works. > Paolo > > Paolo Bonzini (3): > target-arm: introduce cpu_dynamic_tb_cpu_flags > target-arm: add env->tbflags > target-arm: cache most tbflags > > target-arm/cpu.c | 2 ++ > target-arm/cpu.h | 58 ++++++++++++++++++++++++++++++++-------------- > target-arm/helper.c | 2 ++ > target-arm/helper.h | 1 + > target-arm/op_helper.c | 7 ++++++ > target-arm/translate-a64.c | 4 ++++ > target-arm/translate.c | 12 ++++++++-- > target-arm/translate.h | 1 + > 8 files changed, 68 insertions(+), 19 deletions(-) > > -- > 2.7.4 > >