Skip to content

Commit

Permalink
tcg/mips: fix TLB loading for BE host with 32-bit guests
Browse files Browse the repository at this point in the history
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: [email protected]
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
  • Loading branch information
aurel32 committed Aug 1, 2015
1 parent 7008d58 commit e72c4fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tcg/mips/tcg-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e72c4fb

Please sign in to comment.