From patchwork Sat Jul 2 06:02:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586526 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2075793mab; Fri, 1 Jul 2022 23:08:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vTdScDSROJMQ+U0DRwl9twcJGP6UmIM710gvK6ajg6OILgIfvV94nR7jiuHA7P9QdEbMj0 X-Received: by 2002:a0d:fe03:0:b0:31c:71c8:9cbc with SMTP id o3-20020a0dfe03000000b0031c71c89cbcmr4080728ywf.164.1656742087760; Fri, 01 Jul 2022 23:08:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656742087; cv=none; d=google.com; s=arc-20160816; b=JQyphZXCVxNSrXZr6C3qPHKRlAr1TX1Hve4JTzIzbiHTDKcL82O9LHfBpx00BdBQ7c LCmeYLLN0lBFzwvRS6N2KQtVXeZ/MbzlitUm5NbPR/vkCVo7rLuMuWKbIwOd/pl1yubB 52pkh9uYyCickZbbQ4Urn2hnNPr4BCGWzq3J87pArWIIw0SBNmPj5S0y/2T5ffoVbeF7 K2aJ/66Zpuz0OJsmjb/C+7LaLcnY+migM9fgVvLFRRPg5jqW2u9n8r5wQgX7Hxpv8EmE Ak8HOMQaBlGNU5xVWBPO+KOgmoVe3iTjm0L6PAfJPNXzcjvvhykErnEjUZ/uJMljNrmG Tbhg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eHKkLzGG0Agc+EIiK5URkE6gZDnUx3WL+56oJZ1cu3c=; b=nKPUp32gYYslaw3EVwHu2qSKMe/XMM5HzJ/cjqWZ/8GmDhWja+ZAmCHPwWKEW9dl6C kc+/JqXpeqR1PQB5+WFpxj6K8tfluwQ8wuAonG5DGsi3UCWrBA3MY6/11oV3NU0d4m+6 RlDFb8DQ8cU6Wt9RNRR5loAje06yXgQpOp2W+4V+8abPRWSwlXHl26AjkkqLtjlLHvp6 5fkvMzMuXj5GWPsZNqXY7vDDvMizY2PnPjvCYGOc35pE54wTRLo47lLp/hFHiL2RJSjf CN5YdlQUpkWCC869xuzqk8/F5BYXzpoJcEPxqMcIf6yZ8wzBNf1lDeIOU3E1iZX6Dp4a 10hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=df68vIYd; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f140-20020a253892000000b0066d33613b6fsi17177254yba.63.2022.07.01.23.08.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Jul 2022 23:08:07 -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; dkim=pass header.i=@linaro.org header.s=google header.b=df68vIYd; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7WIZ-0007Wa-8x for patch@linaro.org; Sat, 02 Jul 2022 02:08:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7WDP-00035e-KO for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:47 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:43825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7WDN-0004sM-SJ for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:47 -0400 Received: by mail-pl1-x634.google.com with SMTP id r1so4173536plo.10 for ; Fri, 01 Jul 2022 23:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eHKkLzGG0Agc+EIiK5URkE6gZDnUx3WL+56oJZ1cu3c=; b=df68vIYdQLczovEaQQJf8gS/7y0fV/8tKo+oqOf7iTKgHxnHb6S7VApso7YBguPNcQ UvhTpIvW/yPFwrLoWVzIOEkJWB6w2vSNsPea/cGhUGt5G5W4qzQ9kb9Fne13jD4ltHmv zdtULHgfVwygA6z8vAfQHL80GB1nw0BTVLzF+1j36AITRskNi5TZiCbRK+GVQVjjMbHU aHJm1Xn84nKyFJ9ITnJZLeui1Lh6KQ262301g8u2r8iAdn2u23NL22hx8IWm74Yeq13k Ja2qVp8tbkH2yE/EETbw5U3Rp0jElwcUyukpUKl6VwLs1av3l9Pfe8EvlLkAv8r9Vl4M gYZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eHKkLzGG0Agc+EIiK5URkE6gZDnUx3WL+56oJZ1cu3c=; b=LtxYmj6QMTKAfx6Yi7b2nRUb9iTGAa/aioZ+thGW4CBufPqWk0Ev8Cvnj1Sbhzs7cL w7WWoA4iFGGyfkKySQdUxGLIgBHy41svIQmgQioAZkoKht1LAa2b8H/rYk9YwwTR2wDO Rnz/+r8Em7wTUfc+MfTtSBsEI5Pkz55kJgmm1o53TShqRdIdoMP7s89hpExOGjGSQ1Zh r1tm0dR+asjaJDX4mB6y1txPjZJPgIjrYktfHF0u3x+ofRDwpXDkasQeJ5F65icpeKX8 qjTy7CNh0znVIw5PRc5TeKo+11+BuYGKILX4uDrZvfy2sMBtILoUh/rac6HTl8C6Nyze ep1Q== X-Gm-Message-State: AJIora/0ZCQkohL0ksljgMqhJwpqe4Y1ZmODwljUX04r5D/XmYlZafIE g32dBvOoBydAHlPegagmYJTSJoVrXnwDl4iA X-Received: by 2002:a17:90b:218:b0:1ef:1440:ebe1 with SMTP id fy24-20020a17090b021800b001ef1440ebe1mr22466975pjb.166.1656741764447; Fri, 01 Jul 2022 23:02:44 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id z2-20020a17090a66c200b001ece55b938asm5232178pjl.32.2022.07.01.23.02.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 23:02:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@linux.ibm.com, qemu-s390x@nongnu.org Subject: [PATCH v2 3/4] target/s390x: Remove DISAS_PC_STALE_NOCHAIN Date: Sat, 2 Jul 2022 11:32:27 +0530 Message-Id: <20220702060228.420454-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220702060228.420454-1-richard.henderson@linaro.org> References: <20220702060228.420454-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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" Replace this with a flag: exit_to_mainloop. We can now control the exit for each of DISAS_TOO_MANY, DISAS_PC_UPDATED, and DISAS_PC_CC_UPDATED, and fold in the check for PER. Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/tcg/translate.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index a3422c0eb0..eac59c3dd1 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -149,6 +149,7 @@ struct DisasContext { uint64_t pc_tmp; uint32_t ilen; enum cc_op cc_op; + bool exit_to_mainloop; }; /* Information carried about a condition to be evaluated. */ @@ -1126,9 +1127,6 @@ typedef struct { /* We have updated the PC and CC values. */ #define DISAS_PC_CC_UPDATED DISAS_TARGET_2 -/* We are exiting the TB to the main loop. */ -#define DISAS_PC_STALE_NOCHAIN DISAS_TARGET_4 - /* Instruction flags */ #define IF_AFP1 0x0001 /* r1 is a fp reg for HFP/FPS instructions */ @@ -3022,7 +3020,8 @@ static DisasJumpType op_lctl(DisasContext *s, DisasOps *o) tcg_temp_free_i32(r1); tcg_temp_free_i32(r3); /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ - return DISAS_PC_STALE_NOCHAIN; + s->exit_to_mainloop = true; + return DISAS_TOO_MANY; } static DisasJumpType op_lctlg(DisasContext *s, DisasOps *o) @@ -3033,7 +3032,8 @@ static DisasJumpType op_lctlg(DisasContext *s, DisasOps *o) tcg_temp_free_i32(r1); tcg_temp_free_i32(r3); /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ - return DISAS_PC_STALE_NOCHAIN; + s->exit_to_mainloop = true; + return DISAS_TOO_MANY; } static DisasJumpType op_lra(DisasContext *s, DisasOps *o) @@ -4283,7 +4283,8 @@ static DisasJumpType op_ssm(DisasContext *s, DisasOps *o) { tcg_gen_deposit_i64(psw_mask, psw_mask, o->in2, 56, 8); /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ - return DISAS_PC_STALE_NOCHAIN; + s->exit_to_mainloop = true; + return DISAS_TOO_MANY; } static DisasJumpType op_stap(DisasContext *s, DisasOps *o) @@ -4548,7 +4549,8 @@ static DisasJumpType op_stnosm(DisasContext *s, DisasOps *o) } /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ - return DISAS_PC_STALE_NOCHAIN; + s->exit_to_mainloop = true; + return DISAS_TOO_MANY; } static DisasJumpType op_stura(DisasContext *s, DisasOps *o) @@ -6591,6 +6593,7 @@ static void s390x_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) dc->cc_op = CC_OP_DYNAMIC; dc->ex_value = dc->base.tb->cs_base; + dc->exit_to_mainloop = (dc->base.tb->flags & FLAG_MASK_PER); } static void s390x_tr_tb_start(DisasContextBase *db, CPUState *cs) @@ -6630,7 +6633,6 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) case DISAS_NORETURN: break; case DISAS_TOO_MANY: - case DISAS_PC_STALE_NOCHAIN: update_psw_addr(dc); /* FALLTHRU */ case DISAS_PC_UPDATED: @@ -6640,8 +6642,7 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) /* FALLTHRU */ case DISAS_PC_CC_UPDATED: /* Exit the TB, either by raising a debug exception or by return. */ - if ((dc->base.tb->flags & FLAG_MASK_PER) || - dc->base.is_jmp == DISAS_PC_STALE_NOCHAIN) { + if (dc->exit_to_mainloop) { tcg_gen_exit_tb(NULL, 0); } else { tcg_gen_lookup_and_goto_ptr();