[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/5] tcg/mips: Bugfix for crash when running program
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PULL 5/5] tcg/mips: Bugfix for crash when running program with qemu-i386. |
Date: |
Sun, 9 Jul 2017 21:35:01 -1000 |
From: Jiang Biao <address@hidden>
When running a helloworld program with qemu-i386 in linux-user
mode on Loongson 3A3000, it will crash. This patch fix the bug.
Signed-off-by: Jiang Biao <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/mips/tcg-target.inc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c
index 8cff9a6..85756b8 100644
--- a/tcg/mips/tcg-target.inc.c
+++ b/tcg/mips/tcg-target.inc.c
@@ -1547,8 +1547,8 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg
*args, bool is_64)
} else if (guest_base == (int16_t)guest_base) {
tcg_out_opc_imm(s, ALIAS_PADDI, base, addr_regl, guest_base);
} else {
- tcg_out_movi(s, TCG_TYPE_PTR, base, guest_base);
- tcg_out_opc_reg(s, ALIAS_PADD, base, base, addr_regl);
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, guest_base);
+ tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP0, addr_regl);
}
tcg_out_qemu_ld_direct(s, data_regl, data_regh, base, opc, is_64);
#endif
@@ -1652,8 +1652,8 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg
*args, bool is_64)
} else if (guest_base == (int16_t)guest_base) {
tcg_out_opc_imm(s, ALIAS_PADDI, base, addr_regl, guest_base);
} else {
- tcg_out_movi(s, TCG_TYPE_PTR, base, guest_base);
- tcg_out_opc_reg(s, ALIAS_PADD, base, base, addr_regl);
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_TMP0, guest_base);
+ tcg_out_opc_reg(s, ALIAS_PADD, base, TCG_TMP0, addr_regl);
}
tcg_out_qemu_st_direct(s, data_regl, data_regh, base, opc);
#endif
--
2.9.4
- [Qemu-devel] [PULL 0/5] Queued tcg patches, Richard Henderson, 2017/07/10
- [Qemu-devel] [PULL 2/5] tcg/aarch64: Use ADRP+ADD to compute target address, Richard Henderson, 2017/07/10
- [Qemu-devel] [PULL 4/5] util/cacheinfo: Fix warning generated by clang, Richard Henderson, 2017/07/10
- [Qemu-devel] [PULL 5/5] tcg/mips: Bugfix for crash when running program with qemu-i386.,
Richard Henderson <=
- [Qemu-devel] [PULL 1/5] tcg/aarch64: Introduce and use long branch to register, Richard Henderson, 2017/07/10
- [Qemu-devel] [PULL 3/5] tcg/aarch64: Enable indirect jump path using LDR (literal), Richard Henderson, 2017/07/10
- Re: [Qemu-devel] [PULL 0/5] Queued tcg patches, Peter Maydell, 2017/07/10