From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRLgE-0004Cc-Eu for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:18:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRLg9-0006hK-B8 for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:18:46 -0500 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:49814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRLg9-0006gZ-46 for qemu-devel@nongnu.org; Thu, 04 Feb 2016 10:18:41 -0500 References: <1454494453-20738-1-git-send-email-glaubitz@physik.fu-berlin.de> <1454494453-20738-2-git-send-email-glaubitz@physik.fu-berlin.de> <56B219E4.2070800@redhat.com> <56B21ACC.1020802@physik.fu-berlin.de> <56B226A5.80507@redhat.com> From: John Paul Adrian Glaubitz Message-ID: <56B36BCD.3020705@physik.fu-berlin.de> Date: Thu, 4 Feb 2016 16:18:37 +0100 MIME-Version: 1.0 In-Reply-To: <56B226A5.80507@redhat.com> Content-Type: multipart/mixed; boundary="------------050208020306010108050005" Subject: Re: [Qemu-devel] [PATCH] m68k: Build the opcode table only once to avoid multithreading issues List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: laurent@vivier.eu This is a multi-part message in MIME format. --------------050208020306010108050005 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 02/03/2016 05:11 PM, Eric Blake wrote: > Weird. Wonder why it doesn't complain on that file? I'm guessing > that it is due to the #define on the next line. Because > rearranging things to put the code after the #define changes the > situation (but not the semantics): Alright, this should do the trick then. Adrian - -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz@debian.org `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJWs2vKAAoJEHQmOzf1tfkTR6MQAJWRekJIKOcxgdpFWWenL5c2 LmLPFtnFN+d4mvrSRuha7onRt/IFQ514oakur93gi45uholK0zR1/KVQPaLN/0ED jnDUf9z2orJQjn36RnP2HJa4uoTEHQyXfmZ++nKWRlqvxeMNjSiLFzw/NycZapmd CGllQ9mHX1UKFwbsZJWrrKfDN/jlqMp9Ph8t9pTyehUPsMP5fe+anZWG9cdiUtJI C/rQUIdzIRi2dAntcVoWOeX6sx+uXfxtHanRdxl5gDv1e53fD9tuSVGnkpqwd0fU 2QKeSvPFh+OTDT4UPLr6ljukzwx2dTEYujtmZPgOz2d4KZg/XMS71vuE9Rjye+O+ y7LXAfamW/gtKAY2QdYSsvxsua7UsitlqOqC4BQ0TCvrdRZufRm6ruL+K45F6zag brRc//20GYqunS67uw2qo4zh3hJCgv9z8Cah3W4KIRM1T+WhNIiunHQkte5gCkKD MBZ9JisxNMAK2DnUElHIcY83LDCdfDe3M4T8ndk+4OyBw8SIPGAOO3KEhJ7Q132B dFpL0zJ/VBPgUCRYedX5+c3YxKJLfFrXv1UZWE4Gt/lbBNqet/Ayv5dHIh48BU1D u09tCUXjobOK2+H6vKiW60/b/IcNPKSsz35xpJXc91TmMBuYTnUap4ppy2jCTXpY VBFmKPRgI3q8lhzrkUgh =SFbP -----END PGP SIGNATURE----- --------------050208020306010108050005 Content-Type: text/x-diff; name="0002-m68k-Build-the-opcode-table-only-once-to-avoid-multi.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-m68k-Build-the-opcode-table-only-once-to-avoid-multi.pa"; filename*1="tch" >>From 9a78a2f7f8a9063c2ef4dd9b52ffc061d045886b Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Wed, 3 Feb 2016 10:22:35 +0100 Subject: [PATCH 2/2] m68k: Build the opcode table only once to avoid multithreading issues Signed-off-by: John Paul Adrian Glaubitz --- target-m68k/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 535d7f9..015e220 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -2828,6 +2828,12 @@ 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); \ -- 2.7.0 --------------050208020306010108050005--