From nobody Wed Nov 5 15:48:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497469923884278.3178817519157; Wed, 14 Jun 2017 12:52:03 -0700 (PDT) Received: from localhost ([::1]:50619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLEKg-0003W3-Ad for importer@patchew.org; Wed, 14 Jun 2017 15:52:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLEHH-00014g-Ut for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:48:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLEHH-0008VM-2c for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:48:32 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:33458) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLEHG-0008Ux-UD for qemu-devel@nongnu.org; Wed, 14 Jun 2017 15:48:30 -0400 Received: by mail-qt0-x243.google.com with SMTP id w1so2208233qtg.0 for ; Wed, 14 Jun 2017 12:48:30 -0700 (PDT) Received: from bigtime.twiddle.net.com (97-113-165-157.tukw.qwest.net. [97.113.165.157]) by smtp.gmail.com with ESMTPSA id o93sm628571qte.41.2017.06.14.12.48.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 12:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=KSKO5x6kh4jGJtDIJQs0iUOuEMoeV515Kis+PmDJV1E=; b=ZFzRWx7IE+xgF+Q3IZSu/OnDoZczeZJRLLtl7H62Qhr5EH8s36YRzfj+d9ZP7oMOkn pfb5paABF9qlCFPOR1XMWAqSBNYO346OTeUAKcg8L9JdwqvViv+Qo+XunOIGXVq42w+O FqyShVnFW86B+DlNpsASzoVetPjKx4n0kDdPyrKvpSHYXTKYrmJqoxQm45Z+bu7NWNM6 IKZnt8DC6VfIifbq0lxU2XcccWxSwxO/whiHxGA6qQY/Xdyu67CD5GSWFMTD2mzWd3zb FfLkWi+Oqxj5CedblWGBhIR3Ll3KdCDUUkimnHrmMfO1WqRcNGYzNkk/O5Yv2IgFR9X+ Fvcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=KSKO5x6kh4jGJtDIJQs0iUOuEMoeV515Kis+PmDJV1E=; b=tD2yWnhy7gmWTOMa2IGeNsst8m4cplZi3bgWYEG4t6t4ksN8Yc4BOoTEZBshHd/eu7 wp7ne+gsNPKgF2BTgCanVWWldO0lBpz/8TFWH/uPdSZgIZWeWgljcgoua17VPWFy5Z9B qzULSWhYnb8QvlE3QK6nhMf5bDMtPtsvQYZ2XrQGSQeSoI5ohVvjyJXC6FHPCS8RvJly h08v7pYt5UjuLQFgT91m0KFb06YOAJcWREcJ7I0QAnNwPx8Cwthqy8KiFjrXeOl0R1ua M8ozSrxHkXia/3sZCIcDpepKIV7qtZmoVrGcnm6ICE77MPuEokiY7V685lO0CLGzFI0E GHRw== X-Gm-Message-State: AKS2vOyac0cCWHKuhAWa1wotvVWAZXATQ5ejdXq/BDkAFotC8d3G+5N/ aHg477KXIqfzDzYsdhU= X-Received: by 10.55.217.6 with SMTP id u6mr2038406qki.151.1497469710088; Wed, 14 Jun 2017 12:48:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 14 Jun 2017 12:48:20 -0700 Message-Id: <20170614194821.8754-5-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170614194821.8754-1-rth@twiddle.net> References: <20170614194821.8754-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v2 4/5] target/s390x: Exit after changing PSW mask 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: pbonzini@redhat.com, cota@braap.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Exit to cpu loop so we reevaluate cpu_s390x_hw_interrupts. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e --- target/alpha/translate.c | 2 +- target/s390x/translate.c | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index a48e451..232af9e 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -1207,7 +1207,7 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int= palcode) tcg_temp_free(tmp); =20 /* Allow interrupts to be recognized right away. */ - tcg_gen_movi_i64(cpu_pc, ctx.pc); + tcg_gen_movi_i64(cpu_pc, ctx->pc); return EXIT_PC_UPDATED_NOCHAIN; =20 case 0x36: diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 95f91d4..c9e3b81 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -1174,6 +1174,8 @@ typedef enum { /* We are exiting the TB, but have neither emitted a goto_tb, nor updated the PC for the next instruction to be executed. */ EXIT_PC_STALE, + /* We are exiting the TB to the main loop. */ + EXIT_PC_STALE_NOCHAIN, /* We are ending the TB with a noreturn function call, e.g. longjmp. No following code will be executed. */ EXIT_NORETURN, @@ -3796,7 +3798,8 @@ static ExitStatus op_ssm(DisasContext *s, DisasOps *o) { check_privileged(s); tcg_gen_deposit_i64(psw_mask, psw_mask, o->in2, 56, 8); - return NO_EXIT; + /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ + return EXIT_PC_STALE_NOCHAIN; } =20 static ExitStatus op_stap(DisasContext *s, DisasOps *o) @@ -4044,7 +4047,9 @@ static ExitStatus op_stnosm(DisasContext *s, DisasOps= *o) } else { tcg_gen_ori_i64(psw_mask, psw_mask, i2 << 56); } - return NO_EXIT; + + /* Exit to main loop to reevaluate s390_cpu_exec_interrupt. */ + return EXIT_PC_STALE_NOCHAIN; } =20 static ExitStatus op_stura(DisasContext *s, DisasOps *o) @@ -5794,6 +5799,7 @@ void gen_intermediate_code(CPUS390XState *env, struct= TranslationBlock *tb) case EXIT_NORETURN: break; case EXIT_PC_STALE: + case EXIT_PC_STALE_NOCHAIN: update_psw_addr(&dc); /* FALLTHRU */ case EXIT_PC_UPDATED: @@ -5805,14 +5811,14 @@ void gen_intermediate_code(CPUS390XState *env, stru= ct TranslationBlock *tb) /* Exit the TB, either by raising a debug exception or by return. = */ if (do_debug) { gen_exception(EXCP_DEBUG); - } else if (use_exit_tb(&dc)) { + } else if (use_exit_tb(&dc) || status =3D=3D EXIT_PC_STALE_NOCHAIN= ) { tcg_gen_exit_tb(0); } else { tcg_gen_lookup_and_goto_ptr(psw_addr); } break; default: - abort(); + g_assert_not_reached(); } =20 gen_tb_end(tb, num_insns); --=20 2.9.4