From patchwork Fri Nov 25 18:25:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 127740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 87A571007D5 for ; Sat, 26 Nov 2011 05:26:02 +1100 (EST) Received: from localhost ([::1]:51456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RU0TH-0007CV-VZ for incoming@patchwork.ozlabs.org; Fri, 25 Nov 2011 13:25:59 -0500 Received: from eggs.gnu.org ([140.186.70.92]:43175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RU0TC-0007By-Kq for qemu-devel@nongnu.org; Fri, 25 Nov 2011 13:25:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RU0TB-0000GW-Hg for qemu-devel@nongnu.org; Fri, 25 Nov 2011 13:25:54 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:51742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RU0TB-0000GD-BV for qemu-devel@nongnu.org; Fri, 25 Nov 2011 13:25:53 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1RU0T8-0001Kr-Lj; Fri, 25 Nov 2011 18:25:50 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 25 Nov 2011 18:25:50 +0000 Message-Id: <1322245550-5110-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: patches@linaro.org Subject: [Qemu-devel] [PATCH] target-arm/helper.c: Don't allocate TCG resources unless TCG enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Don't call arm_translate_init() (which allocates TCG resources) unless TCG is enabled. Signed-off-by: Peter Maydell --- First KVM related QEMU patch :-) [without this we segfault on startup if run with -enable-kvm, although the omission is currently harmless for upstream QEMU where TCG is always enabled on ARM.] target-arm/helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 97af4d0..3fe5822 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -390,7 +390,7 @@ CPUARMState *cpu_arm_init(const char *cpu_model) return NULL; env = g_malloc0(sizeof(CPUARMState)); cpu_exec_init(env); - if (!inited) { + if (tcg_enabled() && !inited) { inited = 1; arm_translate_init(); }