From: David Hildenbrand <david@redhat.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 2/3] s390x/tcg: Fix BRCL with a large negative offset
Date: Fri, 11 Mar 2022 19:55:39 +0100	[thread overview]
Message-ID: <add09a29-594c-d5c3-bd8a-9fb924353dee@redhat.com> (raw)
In-Reply-To: <20220311184911.557245-3-iii@linux.ibm.com>
On 11.03.22 19:49, Ilya Leoshkevich wrote:
> When RI2 is 0x80000000, qemu enters an infinite loop instead of jumping
> backwards. Fix by adding a missing cast, like in in2_ri2().
> 
> Fixes: 7233f2ed1717 ("target-s390: Convert BRANCH ON CONDITION")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.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 41c8696185..5acfc0ff9b 100644
> --- a/target/s390x/tcg/translate.c
> +++ b/target/s390x/tcg/translate.c
> @@ -1201,7 +1201,7 @@ static DisasJumpType help_branch(DisasContext *s, DisasCompare *c,
>                                   bool is_imm, int imm, TCGv_i64 cdest)
>  {
>      DisasJumpType ret;
> -    uint64_t dest = s->base.pc_next + 2 * imm;
> +    uint64_t dest = s->base.pc_next + (int64_t)imm * 2;
>      TCGLabel *lab;
>  
>      /* Take care of the special cases first.  */
Reviewed-by: David Hildenbrand <david@redhat.com>
-- 
Thanks,
David / dhildenb
next prev parent reply	other threads:[~2022-03-11 18:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 18:49 [PATCH 0/3] Fix BRASL and BRCL with large negative offsets Ilya Leoshkevich
2022-03-11 18:49 ` [PATCH 1/3] s390x/tcg: Fix BRASL with a large negative offset Ilya Leoshkevich
2022-03-11 18:55   ` David Hildenbrand
2022-03-11 18:49 ` [PATCH 2/3] s390x/tcg: Fix BRCL " Ilya Leoshkevich
2022-03-11 18:55   ` David Hildenbrand [this message]
2022-03-11 18:49 ` [PATCH 3/3] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets Ilya Leoshkevich
2022-03-11 18:57   ` David Hildenbrand
2022-03-11 19:01     ` Ilya Leoshkevich
2022-03-11 20:32   ` Richard Henderson
2022-03-14  8:30     ` Christian Borntraeger
2022-03-14 10:17       ` David Hildenbrand
2022-03-14 17:59       ` Richard Henderson
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=add09a29-594c-d5c3-bd8a-9fb924353dee@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=iii@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.com \
    /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).