Received: from eggs.gnu.org ([2001:4830:134:3::10]:59698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk6xB-0004VS-Mo for qemu-devel@nongnu.org; Wed, 14 Sep 2016 05:58:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bk6x4-0000CX-Vb for qemu-devel@nongnu.org; Wed, 14 Sep 2016 05:58:02 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:38317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bk6x4-0000CQ-Oa for qemu-devel@nongnu.org; Wed, 14 Sep 2016 05:57:58 -0400 Received: by mail-wm0-f41.google.com with SMTP id 1so20211686wmz.1 for ; Wed, 14 Sep 2016 02:57:58 -0700 (PDT) Received: from donizetti.lan (94-39-176-182.adsl-ull.clienti.tiscali.it. [94.39.176.182]) by smtp.gmail.com with ESMTPSA id v73sm9876453wmf.19.2016.09.14.02.56.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Sep 2016 02:56:57 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 14 Sep 2016 11:56:50 +0200 Message-Id: <1473847013-20191-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] target-arm: cache tbflags in CPUARMState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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. 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