From patchwork Wed Feb 3 10:14:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Paul Adrian Glaubitz X-Patchwork-Id: 8199921 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 16EB5BEEE5 for ; Wed, 3 Feb 2016 10:14:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 86F252025B for ; Wed, 3 Feb 2016 10:14:36 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id BBE4120253 for ; Wed, 3 Feb 2016 10:14:35 +0000 (UTC) Received: from localhost ([::1]:33793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQuSJ-0004bR-6B for patchwork-qemu-devel@patchwork.kernel.org; Wed, 03 Feb 2016 05:14:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQuS7-0004XF-WA for qemu-devel@nongnu.org; Wed, 03 Feb 2016 05:14:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQuS3-0002di-Lu for qemu-devel@nongnu.org; Wed, 03 Feb 2016 05:14:23 -0500 Received: from outpost19.zedat.fu-berlin.de ([130.133.4.112]:55988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQuS3-0002dW-7u for qemu-devel@nongnu.org; Wed, 03 Feb 2016 05:14:19 -0500 Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (envelope-from ) id <1aQuS2-000hAG-H1>; Wed, 03 Feb 2016 11:14:18 +0100 Received: from z6.physik.fu-berlin.de ([160.45.34.66] helo=z6) by relay1.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (envelope-from ) id <1aQuS2-0001tX-Ch>; Wed, 03 Feb 2016 11:14:18 +0100 Received: from glaubitz by z6 with local (Exim 4.86) (envelope-from ) id 1aQuRz-0005mi-GZ; Wed, 03 Feb 2016 11:14:15 +0100 From: John Paul Adrian Glaubitz To: qemu-devel@nongnu.org Date: Wed, 3 Feb 2016 11:14:13 +0100 Message-Id: <1454494453-20738-2-git-send-email-glaubitz@physik.fu-berlin.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454494453-20738-1-git-send-email-glaubitz@physik.fu-berlin.de> References: <1454494453-20738-1-git-send-email-glaubitz@physik.fu-berlin.de> X-Originating-IP: 160.45.34.66 X-ZEDAT-Hint: RV X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 130.133.4.112 Cc: laurent@vivier.eu, John Paul Adrian Glaubitz Subject: [Qemu-devel] [PATCH] m68k: Build the opcode table only once to avoid multithreading issues 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: John Paul Adrian Glaubitz Signed-off-by: John Paul Adrian Glaubitz --- target-m68k/translate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 535d7f9..a989961 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -2828,6 +2828,10 @@ 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); \