[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.2.3 50/87] target/loongarch: Fix qemu-loongarch64 hang when ex
From: |
Michael Tokarev |
Subject: |
[Stable-8.2.3 50/87] target/loongarch: Fix qemu-loongarch64 hang when executing 'll.d $t0, $t0, 0' |
Date: |
Wed, 10 Apr 2024 10:22:23 +0300 |
From: Song Gao <gaosong@loongson.cn>
On gen_ll, if a->imm is zero, make_address_x return src1,
but the load to destination may clobber src1. We use a new
destination to fix this problem.
Fixes: c5af6628f4be (target/loongarch: Extract make_address_i() helper)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20240320013955.1561311-1-gaosong@loongson.cn>
(cherry picked from commit 77642f92c0b71a105aba2a4d03bc62328eae703b)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/target/loongarch/insn_trans/trans_atomic.c.inc
b/target/loongarch/insn_trans/trans_atomic.c.inc
index 80c2e286fd..974bc2a70f 100644
--- a/target/loongarch/insn_trans/trans_atomic.c.inc
+++ b/target/loongarch/insn_trans/trans_atomic.c.inc
@@ -5,14 +5,14 @@
static bool gen_ll(DisasContext *ctx, arg_rr_i *a, MemOp mop)
{
- TCGv dest = gpr_dst(ctx, a->rd, EXT_NONE);
+ TCGv t1 = tcg_temp_new();
TCGv src1 = gpr_src(ctx, a->rj, EXT_NONE);
TCGv t0 = make_address_i(ctx, src1, a->imm);
- tcg_gen_qemu_ld_i64(dest, t0, ctx->mem_idx, mop);
+ tcg_gen_qemu_ld_i64(t1, t0, ctx->mem_idx, mop);
tcg_gen_st_tl(t0, tcg_env, offsetof(CPULoongArchState, lladdr));
- tcg_gen_st_tl(dest, tcg_env, offsetof(CPULoongArchState, llval));
- gen_set_gpr(a->rd, dest, EXT_NONE);
+ tcg_gen_st_tl(t1, tcg_env, offsetof(CPULoongArchState, llval));
+ gen_set_gpr(a->rd, t1, EXT_NONE);
return true;
}
--
2.39.2
- [Stable-8.2.3 39/87] ui: compile dbus-display1.c with -fPIC as necessary, (continued)
- [Stable-8.2.3 39/87] ui: compile dbus-display1.c with -fPIC as necessary, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 42/87] target/hppa: Fix assemble_11a insns for wide mode, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 41/87] target/hppa: Fix assemble_16 insns for wide mode, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 40/87] target/i386: Revert monitor_puts() in do_inject_x86_mce(), Michael Tokarev, 2024/04/10
- [Stable-8.2.3 44/87] target/hppa: ldcw,s uses static shift of 3, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 46/87] target/hppa: fix access_id check, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 45/87] target/hppa: fix shrp for wide mode, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 47/87] target/hppa: exit tb on flush cache instructions, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 43/87] target/hppa: Fix assemble_12a insns for wide mode, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 48/87] target/hppa: mask privilege bits in mfia, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 50/87] target/loongarch: Fix qemu-loongarch64 hang when executing 'll.d $t0, $t0, 0',
Michael Tokarev <=
- [Stable-8.2.3 49/87] target/hppa: fix do_stdby_e(), Michael Tokarev, 2024/04/10
- [Stable-8.2.3 51/87] docs/conf.py: Remove usage of distutils, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 52/87] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int', Michael Tokarev, 2024/04/10
- [Stable-8.2.3 54/87] vdpa-dev: Fix initialisation order to restore VDUSE compatibility, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 53/87] target/s390x: Use mutable temporary value for op_ts, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 56/87] block-backend: fix edge case in bdrv_next() where BDS associated to BB changes, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 55/87] block/io: accept NULL qiov in bdrv_pad_request, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 57/87] block-backend: fix edge case in bdrv_next_cleanup() where BDS associated to BB changes, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 59/87] target/i386/tcg: Enable page walking from MMIO memory, Michael Tokarev, 2024/04/10
- [Stable-8.2.3 61/87] monitor/hmp-cmds-target: Append a space in error message in gpa2hva(), Michael Tokarev, 2024/04/10