From patchwork Wed Sep 8 11:54:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 507920 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp524163jai; Wed, 8 Sep 2021 04:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpr+X+C9s0yQbvEiQxRTl2MdpjQiOTjdXh8tpoFTu6qPNF0cHNlETQVud9zi1sM+GvBS6x X-Received: by 2002:a02:8549:: with SMTP id g67mr3316240jai.73.1631102177066; Wed, 08 Sep 2021 04:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631102177; cv=none; d=google.com; s=arc-20160816; b=GamF9HFjVrQ7IphHmt1qIU7zvW0ePiMrde7QZQQMRdPLNs+1VFQVoBVqfjy9t6U7RY 1gGVwlJW52M+7ZLkjo8YgRs2GRO1dWGUuzwuohCEUN2CyPn1Ebm8qEg74hVlWX5UhZQF YDrlQQJLLkci4Lr11ZQmO4Ff8bfFTtD6Op3t7mamYZXnnFzHL/Y+na1DPAw57WPwrSdA yO/dEN5Oyy2WIa7QZpzHmqt8ofAQaN0byGmCegGJ1B+2vgUeVrZ2b2kAxiVm18tkQGZy KomTcxTHVGRzbK5GaUG4DMB80FQ8LE6n1+agCGeEimJSoIZmMKKGNPxyjpQkbIOZWMe+ bDmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=e6ZxNo7pCrEQoa/JG9E7oF5BOAt+ieThVXoX3Swn2+s=; b=xzw0i71H5QDiFTcbBKxk+usBDDS0Len0/EEZbPLVvk7rqy2GcjU8/o6Z+FethjAP+f mN+SEAlOoebISOmOoSWKf5onziXMqjd3ITT+Cf3p784OXW6E2muwQUOKS5LW4OpWMjzM SNu0Q5GNKgom9U2FeMU6zSdy8cF96Q59xAXcs3SH/F4xBO2jfi17b2aBuf6miYPujelI h6NHCJ2JzBd66UsKDXeA6c9+SGvpchd/ABxSeF4w2dPILDmduPy6o5EmqrtoXAEVHvfX QZVmryVH7DieS4Qsy4hu8vLD4onPTaELjXUQan9vS6Rdjn2aV+sBauLrLpVOFSAGEcGA zwbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l8si1924526ilt.110.2021.09.08.04.56.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Sep 2021 04:56:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:55130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNwBc-0005PD-Hp for patch@linaro.org; Wed, 08 Sep 2021 07:56:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNwAY-0005P3-Qv for qemu-devel@nongnu.org; Wed, 08 Sep 2021 07:55:10 -0400 Received: from mail.ilande.co.uk ([2001:41c9:1:41f::167]:59014 helo=mail.default.ilande.bv.iomart.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNwAX-0005Cp-8y for qemu-devel@nongnu.org; Wed, 08 Sep 2021 07:55:10 -0400 Received: from host86-140-11-91.range86-140.btcentralplus.com ([86.140.11.91] helo=kentang.home) by mail.default.ilande.bv.iomart.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mNwAR-0009u6-ML; Wed, 08 Sep 2021 12:55:07 +0100 From: Mark Cave-Ayland To: peter.maydell@linaro.org, qemu-devel@nongnu.org Date: Wed, 8 Sep 2021 12:54:40 +0100 Message-Id: <20210908115451.9821-2-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210908115451.9821-1-mark.cave-ayland@ilande.co.uk> References: <20210908115451.9821-1-mark.cave-ayland@ilande.co.uk> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 86.140.11.91 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: [PULL 01/12] target/sparc: Drop use of gen_io_end() X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.bv.iomart.io) Received-SPF: pass client-ip=2001:41c9:1:41f::167; envelope-from=mark.cave-ayland@ilande.co.uk; helo=mail.default.ilande.bv.iomart.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell The gen_io_end() function is obsolete (as documented in docs/devel/tcg-icount.rst). Where an instruction is an I/O operation, the translator frontend should call gen_io_start() before generating the code which does the I/O, and then end the TB immediately after this insn. Remove the calls to gen_io_end() in the SPARC frontend, and ensure that the insns which were calling it end the TB if they didn't do so already. Signed-off-by: Peter Maydell Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20210724134902.7785-2-peter.maydell@linaro.org> Signed-off-by: Mark Cave-Ayland --- target/sparc/translate.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) -- 2.20.1 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 11de5a4963..bb70ba17de 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -3401,7 +3401,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) tcg_temp_free_i32(r_const); gen_store_gpr(dc, rd, cpu_dst); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); + /* I/O operations in icount mode must end the TB */ + dc->base.is_jmp = DISAS_EXIT; } } break; @@ -3454,7 +3455,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) tcg_temp_free_i32(r_const); gen_store_gpr(dc, rd, cpu_dst); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); + /* I/O operations in icount mode must end the TB */ + dc->base.is_jmp = DISAS_EXIT; } } break; @@ -3588,7 +3590,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) tcg_temp_free_ptr(r_tickptr); tcg_temp_free_i32(r_const); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); + /* I/O operations in icount mode must end the TB */ + dc->base.is_jmp = DISAS_EXIT; } } break; @@ -4582,7 +4585,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) } gen_helper_wrpstate(cpu_env, cpu_tmp0); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); + /* I/O ops in icount mode must end the TB */ + dc->base.is_jmp = DISAS_EXIT; } dc->npc = DYNAMIC_PC; break; @@ -4598,7 +4602,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) } gen_helper_wrpil(cpu_env, cpu_tmp0); if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); + /* I/O ops in icount mode must end the TB */ + dc->base.is_jmp = DISAS_EXIT; } break; case 9: // cwp @@ -4697,10 +4702,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) gen_helper_tick_set_limit(r_tickptr, cpu_hstick_cmpr); tcg_temp_free_ptr(r_tickptr); - if (tb_cflags(dc->base.tb) & - CF_USE_ICOUNT) { - gen_io_end(); - } /* End TB to handle timer interrupt */ dc->base.is_jmp = DISAS_EXIT; } @@ -5327,9 +5328,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) gen_io_start(); } gen_helper_done(cpu_env); - if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); - } goto jmp_insn; case 1: if (!supervisor(dc)) @@ -5340,9 +5338,6 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn) gen_io_start(); } gen_helper_retry(cpu_env); - if (tb_cflags(dc->base.tb) & CF_USE_ICOUNT) { - gen_io_end(); - } goto jmp_insn; default: goto illegal_insn;