From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMB5z-0002eM-JJ for qemu-devel@nongnu.org; Mon, 03 Aug 2015 04:27:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMB5y-0005EF-PJ for qemu-devel@nongnu.org; Mon, 03 Aug 2015 04:27:43 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:32812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMAz8-0003H2-VJ for qemu-devel@nongnu.org; Mon, 03 Aug 2015 04:20:39 -0400 From: Aurelien Jarno Date: Mon, 3 Aug 2015 10:20:16 +0200 Message-Id: <1438590019-16932-2-git-send-email-aurelien@aurel32.net> In-Reply-To: <1438590019-16932-1-git-send-email-aurelien@aurel32.net> References: <1438590019-16932-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] [PULL 1/4] tcg/mips: fix TLB loading for BE host with 32-bit guests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Aurelien Jarno , Richard Henderson For 32-bit guest, we load a 32-bit address from the TLB, so there is no need to compensate for the low or high part. This fixes 32-bit guests on big-endian hosts. Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Aurelien Jarno --- tcg/mips/tcg-target.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c index 6680299..8dce19c 100644 --- a/tcg/mips/tcg-target.c +++ b/tcg/mips/tcg-target.c @@ -963,9 +963,11 @@ static void tcg_out_tlb_load(TCGContext *s, TCGReg base, TCGReg addrl, } /* Load the tlb comparator. */ - tcg_out_opc_imm(s, OPC_LW, TCG_TMP0, TCG_REG_A0, cmp_off + LO_OFF); if (TARGET_LONG_BITS == 64) { + tcg_out_opc_imm(s, OPC_LW, TCG_TMP0, TCG_REG_A0, cmp_off + LO_OFF); tcg_out_opc_imm(s, OPC_LW, base, TCG_REG_A0, cmp_off + HI_OFF); + } else { + tcg_out_opc_imm(s, OPC_LW, TCG_TMP0, TCG_REG_A0, cmp_off); } /* Mask the page bits, keeping the alignment bits to compare against. -- 2.1.4