From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS3HW-0003IE-N8 for qemu-devel@nongnu.org; Fri, 13 Jan 2017 09:56:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cS3HU-0003LE-HV for qemu-devel@nongnu.org; Fri, 13 Jan 2017 09:56:42 -0500 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:35747) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cS3HU-0003LA-C9 for qemu-devel@nongnu.org; Fri, 13 Jan 2017 09:56:40 -0500 Received: by mail-wm0-x231.google.com with SMTP id r126so68591979wmr.0 for ; Fri, 13 Jan 2017 06:56:40 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Fri, 13 Jan 2017 14:56:32 +0000 Message-Id: <20170113145633.15384-3-alex.bennee@linaro.org> In-Reply-To: <20170113145633.15384-1-alex.bennee@linaro.org> References: <20170113145633.15384-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL 2/3] cpu_common_reset: wrap TCG specific code in tcg_enabled() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: stefanha@redhat.com, qemu-devel@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Both the cpu->tb_jmp_cache and SoftMMU TLB structures are only used when running TCG code so we might as well skip them for anything else. Signed-off-by: Alex Bennée Reviewed-by: Eduardo Habkost --- qom/cpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qom/cpu.c b/qom/cpu.c index cc51de2a8c..61ee0cb88c 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -270,13 +270,15 @@ static void cpu_common_reset(CPUState *cpu) cpu->exception_index = -1; cpu->crash_occurred = false; - for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) { - atomic_set(&cpu->tb_jmp_cache[i], NULL); - } + if (tcg_enabled()) { + for (i = 0; i < TB_JMP_CACHE_SIZE; ++i) { + atomic_set(&cpu->tb_jmp_cache[i], NULL); + } #ifdef CONFIG_SOFTMMU - tlb_flush(cpu, 0); + tlb_flush(cpu, 0); #endif + } } static bool cpu_common_has_work(CPUState *cs) -- 2.11.0