From nobody Wed Nov 5 18:19:38 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 149668168586053.40113911498872; Mon, 5 Jun 2017 09:54:45 -0700 (PDT) Received: from localhost ([::1]:34363 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvH9-0005jd-6Q for importer@patchew.org; Mon, 05 Jun 2017 12:54:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHvFK-0004Kk-L1 for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHvFJ-0003kS-FQ for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:50 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:33463) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHvFJ-0003js-9r for qemu-devel@nongnu.org; Mon, 05 Jun 2017 12:52:49 -0400 Received: by mail-qt0-x241.google.com with SMTP id w1so17234949qtg.0 for ; Mon, 05 Jun 2017 09:52:49 -0700 (PDT) Received: from bigtime.twiddle.net.com ([2602:47:d954:1500:5e51:4fff:fe40:9c64]) by smtp.gmail.com with ESMTPSA id c6sm1637044qtb.56.2017.06.05.09.52.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 09:52:47 -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 :mime-version:content-transfer-encoding; bh=ODgEOUXtOP5u+0r4KSrkLaiHF6qvKPzuGm9NOWrNqzA=; b=FjmJemfPIy96ytrZe5ehYZ02pKSh9lYTSU9c0gV3VPTXos5A5zVtA//GE7/a9SMAqU q1yorgvG4Nsbf5RZEBzfhum8MgMmqgxEuvYf9QSA520P6YSRXN8ayy0fUavZ9NqsTbUm Sdv/yIZxC2RYxQAy+iALMztisdecEId6GhERjmTH1t80YLdgJS6uWlip5XWtN3vsKF0f MR8z/vGsd6siexnEYc2nCsdanbBHlUS3+EIgFpSNR1OsRVL1oLDz3KnO0vFC3KikCO4Z 6cnQAIDSX8dfEMbz1w1AQAU+1VLnom871WsqeFo4QjhLD2PFAC+qMrsb5E53aFu01/s2 z3jQ== 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:mime-version:content-transfer-encoding; bh=ODgEOUXtOP5u+0r4KSrkLaiHF6qvKPzuGm9NOWrNqzA=; b=K1UGkdwpj+ZpdnxefRcwSzp5K8W82Bwo3G6qT8mt7sUhVCdWp+XtGb5FvqQteNdx48 g8he7rebhW7GMEN2UUkR1OVwFxGAecGv0GQlrRzWitksQ5QOK0GMp2iX729r0wYrejZY IGH20rleW9QuNp0vUTnnN/i9SwLix0lhWlKrgoX6/3JL8znRHNHTMdv1SyGScj9od+s7 28PA6MpYFkZtXuIuBX1DKVnjbVgq2MRZmA7/RdcloDfPlDneofiTf+h38Vnxd3lkdfhT PgYNMSOZCVoLuEa1Qb/IGTl2XrRI4+efbYbD/YxRi4RdNgEF4gVCAdAE9bRg3LqfQXXs ZiKw== X-Gm-Message-State: AODbwcD57XKQiLpRTFdUV2HpBTk/MHxJBZ+JlbdMytaDiLCmk1A6kxlF eWn8Ylnfev5j5+0qFAM= X-Received: by 10.55.116.66 with SMTP id p63mr23255130qkc.250.1496681568452; Mon, 05 Jun 2017 09:52:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 5 Jun 2017 09:52:15 -0700 Message-Id: <20170605165233.4135-9-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170605165233.4135-1-rth@twiddle.net> References: <20170605165233.4135-1-rth@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PULL 08/26] target/i386: introduce gen_jr helper to generate lookup_and_goto_ptr 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, "Emilio G. Cota" 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 From: "Emilio G. Cota" This helper will be used by subsequent changes. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota Message-Id: <1493263764-18657-9-git-send-email-cota@braap.org> Signed-off-by: Richard Henderson --- target/i386/translate.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 1d1372f..f0e48dc 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -141,6 +141,7 @@ typedef struct DisasContext { } DisasContext; =20 static void gen_eob(DisasContext *s); +static void gen_jr(DisasContext *s, TCGv dest); static void gen_jmp(DisasContext *s, target_ulong eip); static void gen_jmp_tb(DisasContext *s, target_ulong eip, int tb_num); static void gen_op(DisasContext *s1, int op, TCGMemOp ot, int d); @@ -2509,7 +2510,8 @@ static void gen_bnd_jmp(DisasContext *s) If INHIBIT, set HF_INHIBIT_IRQ_MASK if it isn't already set. If RECHECK_TF, emit a rechecking helper for #DB, ignoring the state of S->TF. This is used by the syscall/sysret insns. */ -static void gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf) +static void +do_gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf, TCGv jr) { gen_update_cc_op(s); =20 @@ -2530,12 +2532,27 @@ static void gen_eob_worker(DisasContext *s, bool in= hibit, bool recheck_tf) tcg_gen_exit_tb(0); } else if (s->tf) { gen_helper_single_step(cpu_env); + } else if (!TCGV_IS_UNUSED(jr)) { + TCGv vaddr =3D tcg_temp_new(); + + tcg_gen_add_tl(vaddr, jr, cpu_seg_base[R_CS]); + tcg_gen_lookup_and_goto_ptr(vaddr); + tcg_temp_free(vaddr); } else { tcg_gen_exit_tb(0); } s->is_jmp =3D DISAS_TB_JUMP; } =20 +static inline void +gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf) +{ + TCGv unused; + + TCGV_UNUSED(unused); + do_gen_eob_worker(s, inhibit, recheck_tf, unused); +} + /* End of block. If INHIBIT, set HF_INHIBIT_IRQ_MASK if it isn't already set. */ static void gen_eob_inhibit_irq(DisasContext *s, bool inhibit) @@ -2549,6 +2566,12 @@ static void gen_eob(DisasContext *s) gen_eob_worker(s, false, false); } =20 +/* Jump to register */ +static void gen_jr(DisasContext *s, TCGv dest) +{ + do_gen_eob_worker(s, false, false, dest); +} + /* generate a jump to eip. No segment change must happen before as a direct call to the next block may occur */ static void gen_jmp_tb(DisasContext *s, target_ulong eip, int tb_num) --=20 2.9.4