From patchwork Sat Feb 16 15:45:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 220971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 01F162C0080 for ; Sun, 17 Feb 2013 03:11:09 +1100 (EST) Received: from localhost ([::1]:52870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6k2i-0006NO-Ka for incoming@patchwork.ozlabs.org; Sat, 16 Feb 2013 10:51:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6k0x-0004y8-QY for qemu-devel@nongnu.org; Sat, 16 Feb 2013 10:49:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6k0w-0002P8-Hy for qemu-devel@nongnu.org; Sat, 16 Feb 2013 10:49:23 -0500 Received: from cantor2.suse.de ([195.135.220.15]:40392 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6k0w-0002P0-CL for qemu-devel@nongnu.org; Sat, 16 Feb 2013 10:49:22 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D74E4A398D; Sat, 16 Feb 2013 16:49:21 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Sat, 16 Feb 2013 16:45:19 +0100 Message-Id: <1361029542-8412-25-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1361029542-8412-1-git-send-email-afaerber@suse.de> References: <1361029542-8412-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Subject: [Qemu-devel] [PATCH 24/47] target-s390x: Move TCG initialization to S390CPU initfn 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 Ensures that a QOM-created S390CPU is usable. Acked-by: Richard Henderson Signed-off-by: Andreas Färber --- target-s390x/cpu.c | 6 ++++++ target-s390x/helper.c | 7 ------- 2 Dateien geändert, 6 Zeilen hinzugefügt(+), 7 Zeilen entfernt(-) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index ee15783..787c937 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -112,6 +112,7 @@ static void s390_cpu_initfn(Object *obj) { S390CPU *cpu = S390_CPU(obj); CPUS390XState *env = &cpu->env; + static bool inited; static int cpu_num = 0; #if !defined(CONFIG_USER_ONLY) struct tm tm; @@ -133,6 +134,11 @@ static void s390_cpu_initfn(Object *obj) #endif env->cpu_num = cpu_num++; env->ext_index = -1; + + if (tcg_enabled() && !inited) { + inited = true; + s390x_translate_init(); + } } static void s390_cpu_finalize(Object *obj) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index d3bb456..1183b45 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -74,16 +74,9 @@ S390CPU *cpu_s390x_init(const char *cpu_model) { S390CPU *cpu; CPUS390XState *env; - static int inited; cpu = S390_CPU(object_new(TYPE_S390_CPU)); env = &cpu->env; - - if (tcg_enabled() && !inited) { - inited = 1; - s390x_translate_init(); - } - env->cpu_model_str = cpu_model; object_property_set_bool(OBJECT(cpu), true, "realized", NULL);