[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 3/8] s390x/tcg: Fix BRCL with a large negative offset
From: |
Thomas Huth |
Subject: |
[PULL 3/8] s390x/tcg: Fix BRCL with a large negative offset |
Date: |
Tue, 15 Mar 2022 12:20:47 +0100 |
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: 7233f2ed1717 ("target-s390: Convert BRANCH ON CONDITION")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20220314104232.675863-3-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 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. */
--
2.27.0
- [PULL 0/8] s390x and misc fixes, Thomas Huth, 2022/03/15
- [PULL 1/8] tests/tcg: drop -cpu max from s390x sha512-mvx invocation, Thomas Huth, 2022/03/15
- [PULL 2/8] s390x/tcg: Fix BRASL with a large negative offset, Thomas Huth, 2022/03/15
- [PULL 3/8] s390x/tcg: Fix BRCL with a large negative offset,
Thomas Huth <=
- [PULL 4/8] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets, Thomas Huth, 2022/03/15
- [PULL 5/8] tests/avocado: start PhoneServer upfront, Thomas Huth, 2022/03/15
- [PULL 7/8] softmmu: List CPU types again, Thomas Huth, 2022/03/15
- [PULL 6/8] accel/tcg: Fix cpu_ldq_be_mmu typo, Thomas Huth, 2022/03/15
- [PULL 8/8] meson: Update to version 0.61.3, Thomas Huth, 2022/03/15
- Re: [PULL 0/8] s390x and misc fixes, Peter Maydell, 2022/03/15