From patchwork Fri Aug 10 22:25:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 956493 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41nKTc26yWz9s47 for ; Sat, 11 Aug 2018 08:26:10 +1000 (AEST) Received: from localhost ([::1]:58173 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foFrC-00041n-02 for incoming@patchwork.ozlabs.org; Fri, 10 Aug 2018 18:26:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foFqn-00041e-EP for qemu-devel@nongnu.org; Fri, 10 Aug 2018 18:25:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1foFqi-0007Bo-LA for qemu-devel@nongnu.org; Fri, 10 Aug 2018 18:25:41 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:36937) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1foFqi-0007B2-BD for qemu-devel@nongnu.org; Fri, 10 Aug 2018 18:25:36 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MYNYv-1fScN030Qz-00V6E3; Sat, 11 Aug 2018 00:25:15 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Sat, 11 Aug 2018 00:25:02 +0200 Message-Id: <20180810222502.19663-1-laurent@vivier.eu> X-Mailer: git-send-email 2.17.1 X-Provags-ID: V03:K1:Qa39JlhFo5fEY1P8jKAuZlPss2wqpMsWW/1Pz+vL/JJfSigGCIC ncxZAwBWGkv2lQzEd8nSq0bf6wBZQD57ahMzEUZQQ7KrXOKGhwOA2TfxrQWrhQOE+Uy5wDf pkdwICLJui6m0ipYqTT63xIRME+4HDssvYGn0tA8Q/y65jj9JLJbovk2hVJhZIVeri9Frrb nAVovVLe9/Mmku6FYpfAQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:2ZTY1JBOns8=:ogeEbmH8BSjmwNg/HKvX83 5dul4HNkEXmwiHEFEYdqHBBrhHzoZ0T+l/keyegS/aeMTnckMPJSe6drpbSOYH8Ngz3d1o8Dk v6M2WGXGiWdaQpo4m1h2EjVRRlZOKIjSx4DqJTZtzVhNkcnQVt4U1M1nuzKC60bBsPlHgEMyr iywDCo7Mg5mpkq2FDocGrdyy6JN6GNPbjkJ1AN4LA8qog7eZl+E2QDd7Pp92xzBZ5z3PXQah0 rhP/5HvtQMP/M/e1VD7c2sUt2DJbwpWjzKt3D7AUEIZ+zla8/Y90A7W3wi9b8zfylGBeuxeSD R5q75TTwK135oc4vNDZtTggOzELCqqd2V6tNPpqPxCrXRqEni5Zd6IVs0TQSeiShcrzuw7Stq CtqqSYpaSp/2ExF1g1PNApoaWoyfobeMc0LRQja3WCvlqRTIRaU/FG6rbjEw6gt3jmvGTyLVm NaUWWy4WPjdxVYLHw3lb+QDj7X5pNV52nsK5kzMu5D4YVySqQzrHtvrVOZjtvsqkNQOtkBCNS vgSCAfyyrIoDFMu7HksFwWledhr0m/ApJFIdtGXYQUquBSYj5LSYcOk61dDlubntfqvnbCe7U uS8hG04k+3yRvWciuuC9wms1YgahjKRmZrc/uB7GgwjTIAwgrKsAVvW46nSwQlNyLhNzS65Ku Gq08mTju1RRNUrwMA+G/EuwS23ISzEtDfDJ/yeomECWWed5ye8uIwoWQn0g6EGkmBgUk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.73 Subject: [Qemu-devel] [PATCH] sh4: fix use_icount with linux-user 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: Richard Henderson , Laurent Vivier , Aurelien Jarno , John Paul Adrian Glaubitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This patch revert changes from 4834871bc9 that are not only state renaming. This fixes java in a linux-user chroot: $ java --version qemu-sh4: .../accel/tcg/cpu-exec.c:634: cpu_loop_exec_tb: Assertion `use_icount' failed. qemu: uncaught target signal 6 (Aborted) - core dumped Aborted (core dumped) The problem seems to be in gen_conditional_jump() in the GUSA_EXCLUSIVE part: it should reset base.is_jmp to DISAS_NEXT after the gen_goto_tb() as it is done in gen_delayed_conditional_jump() after the gen_jump(). Bug: https://bugs.launchpad.net/qemu/+bug/1768246 Fixes: 4834871bc95b67343248100e2a75ae0d287bc08b ("target/sh4: Convert to DisasJumpType") Reported-by: John Paul Adrian Glaubitz Signed-off-by: Laurent Vivier Tested-by: John Paul Adrian Glaubitz --- target/sh4/translate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 1b9a201d6d..5010b0d349 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -253,7 +253,6 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest) tcg_gen_lookup_and_goto_ptr(); } } - ctx->base.is_jmp = DISAS_NORETURN; } static void gen_jump(DisasContext * ctx) @@ -324,7 +323,6 @@ static void gen_delayed_conditional_jump(DisasContext * ctx) gen_jump(ctx); gen_set_label(l1); - ctx->base.is_jmp = DISAS_NEXT; return; } @@ -1877,6 +1875,7 @@ static void decode_opc(DisasContext * ctx) ctx->envflags &= ~GUSA_MASK; tcg_gen_movi_i32(cpu_flags, ctx->envflags); + ctx->base.is_jmp = DISAS_NORETURN; if (old_flags & DELAY_SLOT_CONDITIONAL) { gen_delayed_conditional_jump(ctx); } else {