From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQuBW-0000xR-5u for qemu-devel@nongnu.org; Wed, 03 Feb 2016 04:57:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQuBS-0006nl-W8 for qemu-devel@nongnu.org; Wed, 03 Feb 2016 04:57:14 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:58311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQuBS-0006nI-M2 for qemu-devel@nongnu.org; Wed, 03 Feb 2016 04:57:10 -0500 References: <1454492221-30625-1-git-send-email-glaubitz@physik.fu-berlin.de> <1454492221-30625-3-git-send-email-glaubitz@physik.fu-berlin.de> <56B1CAC1.5040903@vivier.eu> From: Laurent Vivier Message-ID: <56B1CEF3.8010904@vivier.eu> Date: Wed, 3 Feb 2016 10:57:07 +0100 MIME-Version: 1.0 In-Reply-To: <56B1CAC1.5040903@vivier.eu> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/2] m68k: Build the opcode table only once to avoid multithreading issues List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Paul Adrian Glaubitz , qemu-devel@nongnu.org Le 03/02/2016 10:39, Laurent Vivier a écrit : > > > Le 03/02/2016 10:37, John Paul Adrian Glaubitz a écrit : >> 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..f508d1e 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 >> + issues with multithreading. */ >> + 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); \ >> > Reviewed-by: Laurent Vivier In fact, the line should be: + if (opcode_table[0] != NULL) + return; thanks to scripts/checkpatch.pl. Laurent