Re: [PATCH 1/3] s390x/tcg: Fix BRASL with a large negative offset

2022-03-11 Thread David Hildenbrand
On 11.03.22 19:49, Ilya Leoshkevich wrote:
> When RI2 is 0x8000, 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 
> ---
>  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)

Reviewed-by: David Hildenbrand 

Thanks!

-- 
Thanks,

David / dhildenb




[PATCH 1/3] s390x/tcg: Fix BRASL with a large negative offset

2022-03-11 Thread Ilya Leoshkevich
When RI2 is 0x8000, 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 
---
 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.35.1