diff mbox

[13/14] target-mips: fix TLBR wrt SEGMask

Message ID 1349814458-21739-14-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno Oct. 9, 2012, 8:27 p.m. UTC
Like r4k_map_address(), r4k_helper_tlbp() should use SEGMask to mask the
address.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-mips/op_helper.c |    6 ++++++
 1 file changed, 6 insertions(+)

Comments

Richard Henderson Oct. 10, 2012, 8:44 p.m. UTC | #1
On 10/09/2012 01:27 PM, Aurelien Jarno wrote:
>              tag = env->CP0_EntryHi & ~mask;
>              VPN = tlb->VPN & ~mask;
> +#if defined(TARGET_MIPS64)
> +        tag &= env->SEGMask;
> +#endif
>              /* Check ASID, virtual page number & size */

Indentation.


r~
diff mbox

Patch

diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 6ce27c1..ad5d1c2 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -1826,6 +1826,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 */
@@ -1841,6 +1844,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);