From patchwork Sat Jan 14 09:07:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 9516799 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 8EC31606B3 for ; Sat, 14 Jan 2017 09:08:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70D4E2855B for ; Sat, 14 Jan 2017 09:08:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65C2428585; Sat, 14 Jan 2017 09:08:56 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 E05DF2855B for ; Sat, 14 Jan 2017 09:08:55 +0000 (UTC) Received: from localhost ([::1]:47047 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSKKV-00034y-18 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 14 Jan 2017 04:08:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSKJp-00033J-CK for qemu-devel@nongnu.org; Sat, 14 Jan 2017 04:08:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSKJl-00034L-F6 for qemu-devel@nongnu.org; Sat, 14 Jan 2017 04:08:13 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:53551) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cSKJl-00032O-68 for qemu-devel@nongnu.org; Sat, 14 Jan 2017 04:08:09 -0500 Received: from Quad.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LvQBP-1cb9xE1ufT-010gBj; Sat, 14 Jan 2017 10:08:07 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Sat, 14 Jan 2017 10:07:55 +0100 Message-Id: <1484384878-29179-7-git-send-email-laurent@vivier.eu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484384878-29179-1-git-send-email-laurent@vivier.eu> References: <1484384878-29179-1-git-send-email-laurent@vivier.eu> X-Provags-ID: V03:K0:xISikG723517M2PQHrno88WeqUgMKW3MwOvgXtBDbzzwY7/SEPY tnOhgVCjV/vj+cMCcapJfLsgsULmFjeIavBqSEAY9bDLJKInjBQZnaNBzYQHeRyNAtf1oWL Lz20o0VxAn+n/yU7VGUdTrlL+tyTksoD7K1ltWQr35wr+dYMB2HrUBnrS3pWCMNz3zu1qwG rEWdWDNREe28iwXIK3cig== X-UI-Out-Filterresults: notjunk:1; V01:K0:XQShsIaR04A=:5AjrciVBgkMGYS4XjyC5Lv ZX6fTXiRjWR1qBHu4X5JGuODnZuGUhvKWRGBvNzveKO1RSKpI3tMclrJrPNpTACB/CSGg/2mR px8u6WUTr3B4AUN37X+BMGRrphcSpHHG4Ne34hdgpBiyt/N3kDNyVQ8yW4dGDw0cI6oGZ6mqO +YxnrSIqDvyDj9h6D01mjboxMvoSPlhhFmtnSBIaqjTBBhSnPNfOdA1+cw+KzDraNjA73djkG 3lPV+ZiBoY5PUxlrZ1jLr91MVtefJZ7751ceVV+CdfCXL1BGCuujnRbo434j2dTr6oxk9T9mR rev9vLWcQOB9sfrvQG+qmECi+AyZN4oIVLw+URdn0XcIaSBjh1Fy3wZTKgBk4PBlPZ2c0oAnI Au7uydLbYfJGPCTY3T+W73Spy2jBOXJwGB/XbQ7PX31NJRNCz278JZiKEksy64wE7zlNyWszF aBwPdltrS1FzgoJv+UnN/86oBbCCTD8S+Tj2CSQ3n3rK/pqTbuB5nWnHf3u4yxIFkL/muzbuV cMXivvZa19UuMx7cBlWyd7T2BPsw+XTDaUZUR4+xpjkdD+Wh5NhY1l8lWFzc3xiYpF/KlhwIv yGO1Ipu1IddDmKMFOx5y1RenFZr5knBFsDUaaEfK8IAGowgkjoIIqlRFI3np7fs3IT4PPP013 tkbUpWbH1qXmNCqPh/kKs/7E8M2m/XXiyJGXdT1V+9v3CVznAmO/i8YCP1hM7+n4vicA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.24 Subject: [Qemu-devel] [PULL v2 6/9] target-m68k: fix gen_flush_flags() 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: Laurent Vivier Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP gen_flush_flags() is setting unconditionally cc_op_synced to 1 and s->cc_op to CC_OP_FLAGS, whereas env->cc_op can be set to something else by a previous tcg fragment. We fix that by not setting cc_op_synced to 1 (except for gen_helper_flush_flags() that updates env->cc_op) FIX: https://github.com/vivier/qemu-m68k/issues/19 Signed-off-by: Laurent Vivier Reviewed-by: Richard Henderson Message-Id: <1484332593-16782-3-git-send-email-laurent@vivier.eu> --- target/m68k/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 410f56a..0e97900 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -595,18 +595,19 @@ static void gen_flush_flags(DisasContext *s) case CC_OP_DYNAMIC: gen_helper_flush_flags(cpu_env, QREG_CC_OP); + s->cc_op_synced = 1; break; default: t0 = tcg_const_i32(s->cc_op); gen_helper_flush_flags(cpu_env, t0); tcg_temp_free(t0); + s->cc_op_synced = 1; break; } /* Note that flush_flags also assigned to env->cc_op. */ s->cc_op = CC_OP_FLAGS; - s->cc_op_synced = 1; } static inline TCGv gen_extend(TCGv val, int opsize, int sign)