From patchwork Sat Jul 2 06:02:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12903910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F5EEC433EF for ; Sat, 2 Jul 2022 06:05:10 +0000 (UTC) Received: from localhost ([::1]:60254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7WFh-0005Dg-5Y for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 02:05:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34612) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7WDI-0002pZ-Th for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:41 -0400 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:38830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7WDH-0004rF-Ax for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:40 -0400 Received: by mail-pf1-x42d.google.com with SMTP id k9so4302407pfg.5 for ; Fri, 01 Jul 2022 23:02:38 -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=RpjQ/jx+Qxs41kvoM5hWq5FpDDhEEkw+sqWhzkGXZNw=; b=RZvsolZ2xaT39Kt80mhV24Coq/u2JTLoMN06SYRgOqikj25NdCspzn/9lp/k4Uwp/A 1Uk5xHLCU+0HiWseTz+owOQLV3XAnssgK9cryWl2xQLn+Ch08TpcRF8gJiTvHVRaSk6R B28STYvfa8ggWj4u/UmdKnlfcvS8scA9Mip1HWBKUeba97cEJPRAl//WVqQCzVIG3K90 t8bR2+V1zgOfPgJ2cqB1g+B7bz3h3pUCFWlU0A11nXwq1bxYCg/xXJs/PI75oYyZR9V1 FdBWrs4z6fvIUsqnq52JvArvbSmRz7lGjNu2hyR26OYqDKUiuWwhOqHRF2CBENiTAHUT o3mw== 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=RpjQ/jx+Qxs41kvoM5hWq5FpDDhEEkw+sqWhzkGXZNw=; b=IlpKDrJrgcbOxwo7ohuVdFb/PHkhcukzFT5pr3gZPrGOPb3YJycZPvPF1A0PYojC1u UufP2i/Ucep9IGd5/rAwIxt5Qidz3qThLywVbPcskUFsPHW0eT0fIHP3L7jmBm0b9E/X JKA4bQAxTjIwdmYo8PuIE2ZUwwIPk0pjLH79TQZwd61kanEROQS43Nl+3O8gohLiK8Yz m0I2PPJsqEe60osCm31QBBh/lg3ORdeI/4WR+jWN+6so0Kl16iiBr6stt/BBNYsQNlWL 0JdgptWZg3CN8uGrojUuBnEGF1I1hXgDBeU93FenqFnKla1qPWEzAYN8ZjyFHjJKmU6b bFCg== X-Gm-Message-State: AJIora8pXDAi/T0I63AcWm/1OWNBxS5Nm4/KwW/dTDg28ShofZn65E1/ yXwrbP4o6kkWu62baAGcaU3fBcijctcdiYnO X-Google-Smtp-Source: AGRyM1vKgEkZWv7Oo5jCVwZK8bHXLVVwilLQXzxtmgCn+YZLQWHTiMCoU/YGxx35cGb26YZvBLYUkg== X-Received: by 2002:a63:1952:0:b0:411:90a3:5853 with SMTP id 18-20020a631952000000b0041190a35853mr13764333pgz.474.1656741757363; Fri, 01 Jul 2022 23:02:37 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id z2-20020a17090a66c200b001ece55b938asm5232178pjl.32.2022.07.01.23.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 23:02:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@linux.ibm.com, qemu-s390x@nongnu.org Subject: [PATCH v2 1/4] target/s390x: Remove DISAS_GOTO_TB Date: Sat, 2 Jul 2022 11:32:25 +0530 Message-Id: <20220702060228.420454-2-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::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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=ham 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" There is nothing to distinguish this from DISAS_NORETURN. Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/tcg/translate.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index fd2433d625..e38ae9ce09 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1123,9 +1123,6 @@ typedef struct { exiting the TB. */ #define DISAS_PC_UPDATED DISAS_TARGET_0 -/* We have emitted one or more goto_tb. No fixup required. */ -#define DISAS_GOTO_TB DISAS_TARGET_1 - /* We have updated the PC and CC values. */ #define DISAS_PC_CC_UPDATED DISAS_TARGET_2 @@ -1189,7 +1186,7 @@ static DisasJumpType help_goto_direct(DisasContext *s, uint64_t dest) tcg_gen_goto_tb(0); tcg_gen_movi_i64(psw_addr, dest); tcg_gen_exit_tb(s->base.tb, 0); - return DISAS_GOTO_TB; + return DISAS_NORETURN; } else { tcg_gen_movi_i64(psw_addr, dest); per_branch(s, false); @@ -1258,7 +1255,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c, tcg_gen_movi_i64(psw_addr, dest); tcg_gen_exit_tb(s->base.tb, 1); - ret = DISAS_GOTO_TB; + ret = DISAS_NORETURN; } else { /* Fallthru can use goto_tb, but taken branch cannot. */ /* Store taken branch destination before the brcond. This @@ -6634,7 +6631,6 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) DisasContext *dc = container_of(dcbase, DisasContext, base); switch (dc->base.is_jmp) { - case DISAS_GOTO_TB: case DISAS_NORETURN: break; case DISAS_TOO_MANY: From patchwork Sat Jul 2 06:02:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12903912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35EE9C433EF for ; Sat, 2 Jul 2022 06:08:21 +0000 (UTC) Received: from localhost ([::1]:37508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7WIm-0000iP-Bo for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 02:08:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7WDM-0002vg-DR for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:44 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:43569) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7WDJ-0004rd-M5 for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:44 -0400 Received: by mail-pf1-x431.google.com with SMTP id 136so4278044pfy.10 for ; Fri, 01 Jul 2022 23:02:41 -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=Vr0uT7qqfwuP7HuZnNZDuuWBaqMj6lUxoak84Ik4zME=; b=hGmD0bohoC0VPo05P9u4ltrv9bFX/2yzR7lgsy3Cx/rfF1EnpblQ6OCtXA8bkQ+1Jb cmaV9tAW+yYXZfwPjjG3PER12WJ80DgSxD9IX5Jhab7aYkj9/QbRXaH7JWqIjZWoZsuk FOakitBVCE8H6ecr0uOsItQb9gMH4GF3rzfcFoaeR2qNkxaKdFc0DUgQP1fC5qPpg31l dUeNGcwLEBfl7ScxywsNzOmGgWPDsYUOO2JPxd/TJKXfGZEg4M9pjmw8pnu2beumwzb/ /vKUMRmTdSen9saUOyTBOtOfTRH5CRQvWZAccd3sJYGQ7sLsNBUDzxjfuIU7BCOwWGl9 Fxlg== 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=Vr0uT7qqfwuP7HuZnNZDuuWBaqMj6lUxoak84Ik4zME=; b=PH7hgiqGWLOefaC0sRrCVCZSxbjVGhenJJBFYQCGGxY1iGcEyldioK5gk69ySkUK6v O+0yN+3enn6oD2+XTVQNO3OEDAcJ4X1ITzLzb4i3YzNv+miIIQt6Beuxflu60XTANcBZ btmNM1AaGDRy8x+bh4BDvwsdsOXuxAOKP7sd8Pg1i7NhbEol1+APJQaIEoWZCw9O4bec keu5lbf/iLBBdMVm66H31CDsZtT0PkoVOufBG7yi+noRos3uSWLz5dSBP/hTkFkQwfQn FehiW9P8Gv5Hoq7qvJkoVRp9kCP3DbOvcoWLz4GT7AekcPI5Fe+4f8ViwKvyy2ywj5co qQVw== X-Gm-Message-State: AJIora/sKjWOv2ZV7jW089IN0Q3NJoA6tCxmx7ZB97diw9uy2g0ZKr7L QDL46mu0/vqnxDloOwuEiuhzRryEkneM/GNR X-Google-Smtp-Source: AGRyM1sJFB9MfUSs8eeROtE5rPi1i9uvR3Otkr999Zb5+Kn3RVb6lxF3BB7KRj/DhAuHH/LsvXzSNw== X-Received: by 2002:a63:d751:0:b0:401:9f40:3fcb with SMTP id w17-20020a63d751000000b004019f403fcbmr15373268pgi.311.1656741760085; Fri, 01 Jul 2022 23:02:40 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id z2-20020a17090a66c200b001ece55b938asm5232178pjl.32.2022.07.01.23.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 23:02:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@linux.ibm.com, qemu-s390x@nongnu.org Subject: [PATCH v2 2/4] target/s390x: Remove DISAS_PC_STALE Date: Sat, 2 Jul 2022 11:32:26 +0530 Message-Id: <20220702060228.420454-3-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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" There is nothing to distinguish this from DISAS_TOO_MANY. Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/tcg/translate.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index e38ae9ce09..a3422c0eb0 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -1126,10 +1126,6 @@ typedef struct { /* We have updated the PC and CC values. */ #define DISAS_PC_CC_UPDATED DISAS_TARGET_2 -/* We are exiting the TB, but have neither emitted a goto_tb, nor - updated the PC for the next instruction to be executed. */ -#define DISAS_PC_STALE DISAS_TARGET_3 - /* We are exiting the TB to the main loop. */ #define DISAS_PC_STALE_NOCHAIN DISAS_TARGET_4 @@ -3993,7 +3989,7 @@ static DisasJumpType op_sacf(DisasContext *s, DisasOps *o) { gen_helper_sacf(cpu_env, o->in2); /* Addressing mode has changed, so end the block. */ - return DISAS_PC_STALE; + return DISAS_TOO_MANY; } #endif @@ -4029,7 +4025,7 @@ static DisasJumpType op_sam(DisasContext *s, DisasOps *o) tcg_temp_free_i64(tsam); /* Always exit the TB, since we (may have) changed execution mode. */ - return DISAS_PC_STALE; + return DISAS_TOO_MANY; } static DisasJumpType op_sar(DisasContext *s, DisasOps *o) @@ -6562,13 +6558,13 @@ static DisasJumpType translate_one(CPUS390XState *env, DisasContext *s) /* io should be the last instruction in tb when icount is enabled */ if (unlikely(icount && ret == DISAS_NEXT)) { - ret = DISAS_PC_STALE; + ret = DISAS_TOO_MANY; } #ifndef CONFIG_USER_ONLY if (s->base.tb->flags & FLAG_MASK_PER) { /* An exception might be triggered, save PSW if not already done. */ - if (ret == DISAS_NEXT || ret == DISAS_PC_STALE) { + if (ret == DISAS_NEXT || ret == DISAS_TOO_MANY) { tcg_gen_movi_i64(psw_addr, s->pc_tmp); } @@ -6634,7 +6630,6 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs) case DISAS_NORETURN: break; case DISAS_TOO_MANY: - case DISAS_PC_STALE: case DISAS_PC_STALE_NOCHAIN: update_psw_addr(dc); /* FALLTHRU */ 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: 12903913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E5F3EC43334 for ; Sat, 2 Jul 2022 06:08:39 +0000 (UTC) Received: from localhost ([::1]:37770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7WJ5-0000tC-2y for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 02:08:39 -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-Google-Smtp-Source: AGRyM1tS/CQLvw0bVhzR0v5o0Sjc/hM2+nmEN3DCuoEF1wdv2boRmmqR7QtjnCHB33GE1GNwZZkwCw== 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+qemu-devel=archiver.kernel.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(); From patchwork Sat Jul 2 06:02:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 12903914 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68EC7C433EF for ; Sat, 2 Jul 2022 06:10:04 +0000 (UTC) Received: from localhost ([::1]:40856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7WKR-0002wd-J5 for qemu-devel@archiver.kernel.org; Sat, 02 Jul 2022 02:10:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7WDR-0003Cw-V7 for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:49 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:46843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7WDQ-0004sp-Ga for qemu-devel@nongnu.org; Sat, 02 Jul 2022 02:02:49 -0400 Received: by mail-pl1-x62b.google.com with SMTP id q18so4160037pld.13 for ; Fri, 01 Jul 2022 23:02:48 -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=Xm7U7AL4nOnjycULzYDw79xiqJVDueo/kCsQJyWcsKU=; b=CRCBep4YA3KLJs2P6ugE+pCtNc8XR9Qbbqqp9wpjnIwdl83pbl5GewLVBEkwkxmunQ 4I10zr7Ud8e2cZOeUcU2E0UCLsknTdoWFLYYscKRnUe6QP1kUAbynEv5xxB+LtbkpIYo C0bTLo5V1Qx/JxSinlXRphvFL+g5AlICgRUWBSFTcQUsFc0vD0M08f4Ef+WjP6WsLHYN JoUtNC7tMhevKFv0pxkdtM9tgQmOX4GpDhbNWCKgiOqVO28A4EI0f1uFQDkkYYxAH3Jl dF4WSHY6qhQ8K1nq5aDFrh4KeVdSXnmcjj52nnY8ia8LgkgArfzMczCe/UPHEMoWL/Rd p48A== 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=Xm7U7AL4nOnjycULzYDw79xiqJVDueo/kCsQJyWcsKU=; b=J8qR9gA1P/o8gtz8EiBGO/3sTH8DtzQr8sUIKASCrtWgaJ/vbxGTu1TZLxHX7uIj80 zOdTOoE+pp5MJT9vY/01gj53R7nARFE0Y1Qbqwfsd0gqmdM0LiYD/jlYWwamIkBv48AO +U8XZ4tDjZUwEiedpBT0jNHcCDIowbc7qdYXPjNBzBTDMPwsQN+LeA8chbRauTFLj1S5 g5Ves4lkzE4a4dMu4CqziT5dEJdz9WqaWZOB796Qenmh1rYI4DNWm2ygF/bkzERAKWa/ y/Odjjx1pFmrTgIxErh2VUuHj0G77HPA/8o7i7jkA6fvToDPTJDwM9pmLcnlRX5Yi3YQ MOtA== X-Gm-Message-State: AJIora/gc7mwN93KyM6M3UNNxmqvU88P3+7tfIETHl36f41/Dm1kVsyd bFVPzwgP5ri1TDYEsDDUmcz/2BLwwKzGrxaI X-Google-Smtp-Source: AGRyM1tXQsE4D8TgBSawG7gDe8vvP9FBiZJlSgqT6gIXG4a7MIC75SdWENP7TFN4rE6mssBpjvqn/A== X-Received: by 2002:a17:902:8216:b0:16a:6376:ef81 with SMTP id x22-20020a170902821600b0016a6376ef81mr25273603pln.2.1656741767190; Fri, 01 Jul 2022 23:02:47 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id z2-20020a17090a66c200b001ece55b938asm5232178pjl.32.2022.07.01.23.02.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 23:02:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: svens@linux.ibm.com, qemu-s390x@nongnu.org Subject: [PATCH v2 4/4] target/s390x: Exit tb after executing ex_value Date: Sat, 2 Jul 2022 11:32:28 +0530 Message-Id: <20220702060228.420454-5-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::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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=ham 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" When EXECUTE sets ex_value to interrupt the constructed instruction, we implicitly disable interrupts so that the value is not corrupted. Exit to the main loop after execution, so that we re-evaluate any pending interrupts. Reported-by: Sven Schnelle Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/tcg/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index eac59c3dd1..e2ee005671 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6593,7 +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); + dc->exit_to_mainloop = (dc->base.tb->flags & FLAG_MASK_PER) || dc->ex_value; } static void s390x_tr_tb_start(DisasContextBase *db, CPUState *cs)