qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: laurent@vivier.eu
Subject: Re: [Qemu-devel] [PATCH] m68k: Build the opcode table only once to avoid multithreading issues
Date: Thu, 4 Feb 2016 16:18:37 +0100	[thread overview]
Message-ID: <56B36BCD.3020705@physik.fu-berlin.de> (raw)
In-Reply-To: <56B226A5.80507@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

-----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-----

[-- Attachment #2: 0002-m68k-Build-the-opcode-table-only-once-to-avoid-multi.patch --]
[-- Type: text/x-diff, Size: 1069 bytes --]

>From 9a78a2f7f8a9063c2ef4dd9b52ffc061d045886b Mon Sep 17 00:00:00 2001
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
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 <glaubitz@physik.fu-berlin.de>
---
 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


  reply	other threads:[~2016-02-04 15:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 10:14 [Qemu-devel] Updated patch for the opcode table John Paul Adrian Glaubitz
2016-02-03 10:14 ` [Qemu-devel] [PATCH] m68k: Build the opcode table only once to avoid multithreading issues John Paul Adrian Glaubitz
2016-02-03 15:16   ` Eric Blake
2016-02-03 15:19     ` Laurent Vivier
2016-02-03 15:20     ` John Paul Adrian Glaubitz
2016-02-03 16:11       ` Eric Blake
2016-02-04 15:18         ` John Paul Adrian Glaubitz [this message]
2016-02-08 23:15           ` John Paul Adrian Glaubitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B36BCD.3020705@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=eblake@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).