From patchwork Fri Jan 13 14:56:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 91438 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp172885obz; Fri, 13 Jan 2017 06:59:06 -0800 (PST) X-Received: by 10.237.61.8 with SMTP id g8mr7773899qtf.91.1484319546629; Fri, 13 Jan 2017 06:59:06 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a187si8555628qkd.275.2017.01.13.06.59.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 13 Jan 2017 06:59:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cS3Jq-0005GM-2i for patch@linaro.org; Fri, 13 Jan 2017 09:59:06 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+GWst2LlcDacETCE1YB8ulh+ZxTh6Pfq1QQv/YIzIr8=; b=UxU8rWQmJjWlJ0H4iRA4i/oWOcVup78lrR/Jyo/Q2DfDfDpLJqUQ5qT4QMSiyxUtQg +xHcr3XYjTxVVbbARp+8O/qbOAt1J6rAmaYP6gocPjFy/5qTAgQ7ZgS1OBaijRP/oiDZ zaCfEVIDMvziC89CbPy6ZFUAxRM7DeuWbkg0s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+GWst2LlcDacETCE1YB8ulh+ZxTh6Pfq1QQv/YIzIr8=; b=poaUPg/ciko/lHWz6n6WNoKSDpjuHsnBOj5gkS76sN2UzOReUO9rm9rt8hW4nEFiIK PAY+euffeG2n9BcWj5WmZ8XkPSox4t1wrk0JoA0eq59/YEoHnn2tqg4L734kAMg7KX0C EHjzAwGi5ylTlNGGITYXvwjI+35hczwAcF0bTSzzpdHw5PseFPQsBmGibf5QM7+79Nk5 ECdhuSES3P/YbHskEPxGLE3otSB9ulxGt/5e+OlJZUJ/rnu59iqnDvtPR5Sekkrcsy2I mEbQlo5TwxUdhc2vLF9q/ZuVxyZi1dq/xFZno7E3LIb5pF+NmSefU0308KkKXsEhWTk6 u5Rg== X-Gm-Message-State: AIkVDXLNRvfkrOPT8IglwUh7aR7HEDsLVXBmuTRwRDihNrXNwVptLNtNfDiHjDOGqCIbRrLo X-Received: by 10.28.6.210 with SMTP id 201mr2793792wmg.85.1484319399210; Fri, 13 Jan 2017 06:56:39 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c9sm4303764wmi.16.2017.01.13.06.56.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jan 2017 06:56:37 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E742F3E29F4; Fri, 13 Jan 2017 14:56:33 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 13 Jan 2017 14:56:32 +0000 Message-Id: <20170113145633.15384-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170113145633.15384-1-alex.bennee@linaro.org> References: <20170113145633.15384-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::231 Subject: [Qemu-devel] [PULL 2/3] cpu_common_reset: wrap TCG specific code in tcg_enabled() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org, stefanha@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.11.0 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)