aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-10-09 21:53:21 +0200
committerAurelien Jarno <aurelien@aurel32.net>2012-10-31 22:20:49 +0100
commitbc3e45e13a93b883f0369acb2e19c0cec8705a7a (patch)
tree924d530b01e05c8be62eee7a5fde52e40436721c
parente0d002f17d1db1ade2b8d24b4a7c7ab361256726 (diff)
target-mips: fix TLBR wrt SEGMask
Like r4k_map_address(), r4k_helper_tlbp() should use SEGMask to mask the address. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r--target-mips/op_helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 773c7104af..cdd6880efc 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -1856,6 +1856,9 @@ void r4k_helper_tlbp(CPUMIPSState *env)
mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
tag = env->CP0_EntryHi & ~mask;
VPN = tlb->VPN & ~mask;
+#if defined(TARGET_MIPS64)
+ tag &= env->SEGMask;
+#endif
/* Check ASID, virtual page number & size */
if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag) {
/* TLB match */
@@ -1871,6 +1874,9 @@ void r4k_helper_tlbp(CPUMIPSState *env)
mask = tlb->PageMask | ~(TARGET_PAGE_MASK << 1);
tag = env->CP0_EntryHi & ~mask;
VPN = tlb->VPN & ~mask;
+#if defined(TARGET_MIPS64)
+ tag &= env->SEGMask;
+#endif
/* Check ASID, virtual page number & size */
if ((tlb->G == 1 || tlb->ASID == ASID) && VPN == tag) {
r4k_mips_tlb_flush_extra (env, i);