From nobody Wed Nov 5 18:23:06 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 1496599256016970.3616651191659; Sun, 4 Jun 2017 11:00:56 -0700 (PDT) Received: from localhost ([::1]:57939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHZpe-0006bg-Gm for importer@patchew.org; Sun, 04 Jun 2017 14:00:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHZRe-0007qR-Ud for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHZRb-0003Tn-3U for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:36:06 -0400 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:34659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHZRa-0003SX-SN for qemu-devel@nongnu.org; Sun, 04 Jun 2017 13:36:03 -0400 Received: by mail-pf0-x241.google.com with SMTP id w69so18143588pfk.1 for ; Sun, 04 Jun 2017 10:36:02 -0700 (PDT) Received: from bigtime.ASUS (cpe-98-155-27-246.hawaii.res.rr.com. [98.155.27.246]) by smtp.gmail.com with ESMTPSA id j191sm52854419pgc.53.2017.06.04.10.36.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jun 2017 10:36:01 -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=Kw4OrTnJoyEXimbYL5T5HOHvoy9StDHdLAgHBj7k14s=; b=Hezr6RKtDvnAS2/XvARSuPJDk9CvQ34z8Kv2UbM6fWVXOYnT3875mxT/TCbUPfyIc7 sgJ9URcto9WjAV5jRl4KESNCTO8Ge/eBOejDlmTBZCWaxQ/FO7nMBq+NCreu5vAZ3g8c 56Y7+NHq4u6oDfJNkTs5jwWCrp9RqbAx3s5ok9C5bhZHoJJq3tk/I4JL4alGdyeCs/QG BkybKPub+TuJqEHLMqljYwtQPZXeGFviux2VrR6jWB1VTNERgaGfKBJiS4AvDPY60sLW xoo5tL70MDlA/aX5xKXW/z1DGPe3vi9c1F3m+Fm2LQqI3S6ENROpqbTy2SW239lx5hyD gCKA== 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=Kw4OrTnJoyEXimbYL5T5HOHvoy9StDHdLAgHBj7k14s=; b=gZlO3+fTL3EejDtrasovO/15wQcaFONr/AqtLJoZHtR6bl9yclgbBPgBC5H+sJgZ4v ahg63ooSuvEHGlXpKMOc1nNa8aACFFOj8u7jMVhFeuWwcGBCZnaWnEBATUmZ8zt0SP8f Vk0fnoOzJb55NTiLaTiW82wYKec0KJXbEHe/TNiG/j9H/7Cy6CEoI6OwhwsYNR4pdi91 EK+rlWZtaTyCu47GMnc5qt9zjxU8WkRLLj1Yx3BSchM/dt2aCFoqXChBYbkrTA4mjKRo Y14SgTWaGftSPVdLy1UASOr6fO0+WWR+ba6rpkByGnyDvPrXwNLZx3FMMEUffIgIRpMj B6zw== X-Gm-Message-State: AODbwcA66NQy4zJ/RdSFfzpzZSpN799wb0Go+vfYJ7OWOurj/EeX9gT0 yZvMkBc/se0TSf3lfco= X-Received: by 10.99.1.88 with SMTP id 85mr17468775pgb.110.1496597761761; Sun, 04 Jun 2017 10:36:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sun, 4 Jun 2017 10:34:36 -0700 Message-Id: <20170604173509.29684-37-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170604173509.29684-1-rth@twiddle.net> References: <20170604173509.29684-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [PULL 36/69] target/s390x: End the TB after EXECUTE 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: peter.maydell@linaro.org, aurelien@aurel32.net 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" This split will be required for implementing EXECUTE properly. Do this now as a separate step to aid comparison of before and after TB listings. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- target/s390x/mem_helper.c | 54 ++++++++++++++++++++++++++++---------------= ---- target/s390x/translate.c | 6 +++++- 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 4b96c27..d57d5b1 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -1234,6 +1234,7 @@ void HELPER(ex)(CPUS390XState *env, uint32_t ilen, ui= nt64_t r1, uint64_t addr) S390CPU *cpu =3D s390_env_get_cpu(env); uint64_t insn =3D cpu_lduw_code(env, addr); uint8_t opc =3D insn >> 8; + uint32_t cc; =20 /* Or in the contents of R1[56:63]. */ insn |=3D r1 & 0xff; @@ -1263,42 +1264,46 @@ void HELPER(ex)(CPUS390XState *env, uint32_t ilen, = uint64_t r1, uint64_t addr) b2 =3D extract64(insn, 28, 4); d1 =3D extract64(insn, 32, 12); d2 =3D extract64(insn, 16, 12); + + cc =3D env->cc_op; switch (opc & 0xf) { case 0x2: do_helper_mvc(env, l, get_address(env, 0, b1, d1), get_address(env, 0, b2, d2), 0); - return; + break; case 0x4: - env->cc_op =3D do_helper_nc(env, l, get_address(env, 0, b1, d1= ), - get_address(env, 0, b2, d2), 0); - return; + cc =3D do_helper_nc(env, l, get_address(env, 0, b1, d1), + get_address(env, 0, b2, d2), 0); + break; case 0x5: - env->cc_op =3D do_helper_clc(env, l, get_address(env, 0, b1, d= 1), - get_address(env, 0, b2, d2), 0); - return; + cc =3D do_helper_clc(env, l, get_address(env, 0, b1, d1), + get_address(env, 0, b2, d2), 0); + break; case 0x6: - env->cc_op =3D do_helper_oc(env, l, get_address(env, 0, b1, d1= ), - get_address(env, 0, b2, d2), 0); - return; + cc =3D do_helper_oc(env, l, get_address(env, 0, b1, d1), + get_address(env, 0, b2, d2), 0); + break; case 0x7: - env->cc_op =3D do_helper_xc(env, l, get_address(env, 0, b1, d1= ), - get_address(env, 0, b2, d2), 0); - return; + cc =3D do_helper_xc(env, l, get_address(env, 0, b1, d1), + get_address(env, 0, b2, d2), 0); + break; case 0xc: do_helper_tr(env, l, get_address(env, 0, b1, d1), get_address(env, 0, b2, d2), 0); - return; + break; case 0xd: - env->cc_op =3D do_helper_trt(env, l, get_address(env, 0, b1, d= 1), - get_address(env, 0, b2, d2), 0); - return; + cc =3D do_helper_trt(env, l, get_address(env, 0, b1, d1), + get_address(env, 0, b2, d2), 0); + break; + default: + goto abort; } } else if (opc =3D=3D 0x0a) { /* supervisor call */ env->int_svc_code =3D extract64(insn, 48, 8); env->int_svc_ilen =3D ilen; helper_exception(env, EXCP_SVC); - return; + g_assert_not_reached(); } else if (opc =3D=3D 0xbf) { uint32_t r1, r3, b2, d2; =20 @@ -1306,10 +1311,15 @@ void HELPER(ex)(CPUS390XState *env, uint32_t ilen, = uint64_t r1, uint64_t addr) r3 =3D extract64(insn, 48, 4); b2 =3D extract64(insn, 44, 4); d2 =3D extract64(insn, 32, 12); - env->cc_op =3D helper_icm(env, r1, get_address(env, 0, b2, d2), r3= ); - return; + cc =3D helper_icm(env, r1, get_address(env, 0, b2, d2), r3); + } else { + abort: + cpu_abort(CPU(cpu), + "EXECUTE on instruction prefix 0x%x not implemented\n", + opc); + g_assert_not_reached(); } =20 - cpu_abort(CPU(cpu), "EXECUTE on instruction prefix 0x%x not implemente= d\n", - opc); + env->cc_op =3D cc; + env->psw.addr +=3D ilen; } diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 5b8333f..70212c8 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -1163,6 +1163,8 @@ typedef enum { the PC (for whatever reason), so there's no need to do it again on exiting the TB. */ EXIT_PC_UPDATED, + /* We have updated the PC and CC values. */ + EXIT_PC_CC_UPDATED, /* 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, @@ -2216,7 +2218,7 @@ static ExitStatus op_ex(DisasContext *s, DisasOps *o) tcg_temp_free_i64(v1); } =20 - return NO_EXIT; + return EXIT_PC_CC_UPDATED; } =20 static ExitStatus op_fieb(DisasContext *s, DisasOps *o) @@ -5489,6 +5491,8 @@ void gen_intermediate_code(CPUS390XState *env, struct= TranslationBlock *tb) /* Next TB starts off with CC_OP_DYNAMIC, so make sure the cc op type is in env */ update_cc_op(&dc); + /* FALLTHRU */ + case EXIT_PC_CC_UPDATED: /* Exit the TB, either by raising a debug exception or by return. = */ if (do_debug) { gen_exception(EXCP_DEBUG); --=20 2.9.4