From nobody Wed Nov 5 06:43:54 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499669541743782.8440842601244; Sun, 9 Jul 2017 23:52:21 -0700 (PDT) Received: from localhost ([::1]:38757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUSYO-00070e-13 for importer@patchew.org; Mon, 10 Jul 2017 02:52:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUSXV-0006h2-RJ for qemu-devel@nongnu.org; Mon, 10 Jul 2017 02:51:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUSXS-00078b-PP for qemu-devel@nongnu.org; Mon, 10 Jul 2017 02:51:25 -0400 Received: from mx7.zte.com.cn ([202.103.147.169]:46721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUSXQ-00076A-H9 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 02:51:22 -0400 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 10 Jul 2017 06:38:50 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v6A6ooJp039648; Mon, 10 Jul 2017 14:50:50 +0800 (GMT-8) (envelope-from jiang.biao2@zte.com.cn) Received: from localhost.localdomain ([10.75.9.60]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017071014505247-3523565 ; Mon, 10 Jul 2017 14:50:52 +0800 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170710143850 From: Jiang Biao To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 14:59:39 +0800 Message-Id: <1499669979-25904-1-git-send-email-jiang.biao2@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-10 14:50:52, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-10 14:50:50, Serialize complete at 2017-07-10 14:50:50 X-MAIL: mse01.zte.com.cn v6A6ooJp039648 X-HQIP: 127.0.0.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 202.103.147.169 Subject: [Qemu-devel] [PATCH v3] tcg/mips: Bugfix for crash when running program with qemu-i386. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: james.hogan@imgtec.com, zhong.weidong@zte.com.cn, wang.liang82@zte.com.cn, shi.zhongbing@zte.com.cn, jinguojie@loongson.cn, jiang.yong5@zte.com.cn, jiang.biao2@zte.com.cn, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Richard Henderson --- 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 TCGA= rg *args, bool is_64) } else if (guest_base =3D=3D (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 TCGA= rg *args, bool is_64) } else if (guest_base =3D=3D (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 --=20 2.7.4