Received: from eggs.gnu.org ([208.118.235.92]:35734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF4R4-00055S-6b for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:42:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF4Qy-0004L9-EI for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:42:30 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35826 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF4Qy-0004L0-7R for qemu-devel@nongnu.org; Fri, 21 Sep 2012 10:42:24 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 21 Sep 2012 16:38:35 +0200 Message-Id: <1348238315-29748-12-git-send-email-afaerber@suse.de> In-Reply-To: <1348238315-29748-1-git-send-email-afaerber@suse.de> References: <1348238315-29748-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 11/11] target-alpha: Make cpu_alpha_init() reentrant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , anthony@codemonkey.ws, Richard Henderson From: Richard Henderson Guard against duplicate TCG initialization, triggered by linux-user NPTL emulation. Signed-off-by: Richard Henderson [AF: Split off into separate patch] Signed-off-by: Andreas F=C3=A4rber --- target-alpha/translate.c | 6 +++++- 1 Datei ge=C3=A4ndert, 5 Zeilen hinzugef=C3=BCgt(+), 1 Zeile entfernt(-) diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 93063fb..f998f75 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -3525,6 +3525,7 @@ static const struct cpu_def_t cpu_defs[] =3D { =20 CPUAlphaState * cpu_alpha_init (const char *cpu_model) { + static bool inited; AlphaCPU *cpu; CPUAlphaState *env; int implver, amask, i, max; @@ -3532,7 +3533,10 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_mo= del) cpu =3D ALPHA_CPU(object_new(TYPE_ALPHA_CPU)); env =3D &cpu->env; =20 - alpha_translate_init(); + if (!inited) { + inited =3D true; + alpha_translate_init(); + } =20 /* Default to ev67; no reason not to emulate insns by default. */ implver =3D IMPLVER_21264; --=20 1.7.10.4