From patchwork Tue Oct 25 14:50:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9394619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2165C60231 for ; Tue, 25 Oct 2016 14:51:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 142C929629 for ; Tue, 25 Oct 2016 14:51:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 090BB29635; Tue, 25 Oct 2016 14:51:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D9E529634 for ; Tue, 25 Oct 2016 14:51:24 +0000 (UTC) Received: from localhost ([::1]:55179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz34V-0008WO-6m for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Oct 2016 10:51:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz33n-0008Qu-Ln for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz33j-0005vH-5Q for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:39 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:56861) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bz33i-0005uV-SU for qemu-devel@nongnu.org; Tue, 25 Oct 2016 10:50:35 -0400 Received: from Quad.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003) with ESMTPSA (Nemesis) id 0LqpKo-1ccDce3jb0-00ePRr; Tue, 25 Oct 2016 16:50:27 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 25 Oct 2016 16:50:00 +0200 Message-Id: <1477407021-30755-3-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477407021-30755-1-git-send-email-laurent@vivier.eu> References: <1477407021-30755-1-git-send-email-laurent@vivier.eu> X-Provags-ID: V03:K0:ifY4QRFZeVZAysZ9flguB0EAbco2+5kkax2ZpOaItz2Do28ZQ8v wk8u511Avpn2QWVKsn4J07VTvTVcH+iqIyXa2N0LbONY7Uy60vB0NfmTquKJkbJa7ILiwGb wpFrJiqj3d5PtOrap/Se2luAMOhQQdBCnRlnCN1o8fNJhHe7x9ZmBHH6wT4SfAhYefOhajn +B4tZRtzJ6lKTsCDMAYKg== X-UI-Out-Filterresults: notjunk:1; V01:K0:+sDzpTKeym4=:keHQ8by5OrCTZDZTqLEwL+ TZpf38rXA1Kcwl2ZJmEvdlwCGux75992ca6Vxt24GkLq67Nw8vU7+bV5FUlZ3IEOdBywzuZlZ RgTEus9h8mW3pR+290VjAT2lLO7FW9vC4EgDi3ZVRIjVLdlVHCfyWL2ZTcaTgZwrVXv02iZCK RV57PSghuG5gHYsli8Ak7b8TGOrNz6F7k5ObpNCFv5wtfPY0MI/TKimMmssfVx/HBVjX3ovsd /pKVqV4dWzG1rt1jGjmH43+VyvaKPhdSKecDg//kg7YxviN+TDZXGOId4C5Tp5Xg0u1cbR3QN N0+NTrZqN3W+5IMHYy/97rh5fgqPDnyNSDKb04yAl0MAJoB/2ihCXOAW3vIdCWK5y6d+QYxB5 OhnftcqrCECbN7NCF4UIAvYh3kW4icwz8DLqjSde/ClIXruCp0QI1H54CCjO97Ia2DHljbZqD 1Zwu7enN+IiI5Bn725rRabWVcMmujMOcSWUv0g66AHc9MEn1dNEFjxjfbdIXHmpFWjTJVa2NP 2QOoHI/TEITxzvVSEhGcX3ZAN77aehJK+5waqnz9DKodITaTwO8rl5EQZnggmu8ASq+iSkFdn e3m4ppSr3L67PJj1x/yr97XJQU+nqR70EokUyCuTbP+9IEp14NFhR1KgCSn1kMqOZVQAalF0u bam24hdBoAb991j5bJ85zPFqpnyK26SU3XBjt07AqVCQ9mVhFxeAxr35ubaXK6hTQCsk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PATCH 02/23] target-m68k: Build the opcode table only once to avoid multithreading issues 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: gerg@uclinux.org, Laurent Vivier , agraf@suse.de, schwab@linux-m68k.org, John Paul Adrian Glaubitz , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: John Paul Adrian Glaubitz Signed-off-by: John Paul Adrian Glaubitz Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson --- target-m68k/translate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index deb5a58..eecb32b 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -2841,6 +2841,11 @@ register_opcode (disas_proc proc, uint16_t opcode, uint16_t mask) Later insn override earlier ones. */ void register_m68k_insns (CPUM68KState *env) { + /* Build the opcode table only once to avoid + multithreading issues. */ + if (opcode_table[0] != NULL) { + return; + } #define INSN(name, opcode, mask, feature) do { \ if (m68k_feature(env, M68K_FEATURE_##feature)) \ register_opcode(disas_##name, 0x##opcode, 0x##mask); \