qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <richard.henderson@linaro.org>,
	Ilya Leoshkevich <iii@linux.ibm.com>,
	David Hildenbrand <david@redhat.com>
Subject: [PULL 2/8] s390x/tcg: Fix BRASL with a large negative offset
Date: Tue, 15 Mar 2022 12:20:46 +0100	[thread overview]
Message-ID: <20220315112052.515467-3-thuth@redhat.com> (raw)
In-Reply-To: <20220315112052.515467-1-thuth@redhat.com>

From: Ilya Leoshkevich <iii@linux.ibm.com>

When RI2 is 0x80000000, qemu enters an infinite loop instead of jumping
backwards. Fix by adding a missing cast, like in in2_ri2().

Fixes: 8ac33cdb8bfb ("Convert BRANCH AND SAVE")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20220314104232.675863-2-iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 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 904b51542f..41c8696185 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -1597,7 +1597,7 @@ static DisasJumpType op_bal(DisasContext *s, DisasOps *o)
 static DisasJumpType op_basi(DisasContext *s, DisasOps *o)
 {
     pc_to_link_info(o->out, s, s->pc_tmp);
-    return help_goto_direct(s, s->base.pc_next + 2 * get_field(s, i2));
+    return help_goto_direct(s, s->base.pc_next + (int64_t)get_field(s, i2) * 2);
 }
 
 static DisasJumpType op_bc(DisasContext *s, DisasOps *o)
-- 
2.27.0



  parent reply	other threads:[~2022-03-15 11:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 11:20 [PULL 0/8] s390x and misc fixes Thomas Huth
2022-03-15 11:20 ` [PULL 1/8] tests/tcg: drop -cpu max from s390x sha512-mvx invocation Thomas Huth
2022-03-15 11:20 ` Thomas Huth [this message]
2022-03-15 11:20 ` [PULL 3/8] s390x/tcg: Fix BRCL with a large negative offset Thomas Huth
2022-03-15 11:20 ` [PULL 4/8] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets Thomas Huth
2022-05-02 13:43   ` Thomas Huth
2022-03-15 11:20 ` [PULL 5/8] tests/avocado: start PhoneServer upfront Thomas Huth
2022-03-15 11:20 ` [PULL 6/8] accel/tcg: Fix cpu_ldq_be_mmu typo Thomas Huth
2022-03-15 11:20 ` [PULL 7/8] softmmu: List CPU types again Thomas Huth
2022-03-15 11:20 ` [PULL 8/8] meson: Update to version 0.61.3 Thomas Huth
2022-03-15 18:58 ` [PULL 0/8] s390x and misc fixes Peter Maydell
2022-03-15 19:30   ` Peter Maydell
2022-03-16  7:35     ` Thomas Huth
2022-03-16 12:14     ` Paolo Bonzini
2022-03-16 12:18   ` Paolo Bonzini
2022-03-16 13:19     ` Peter Maydell
2022-03-16 14:26       ` Paolo Bonzini
2022-03-16 12:30   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220315112052.515467-3-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).