Merge remote-tracking branch 'regulator/fix/core' into regulator-linus
[sfrench/cifs-2.6.git] / arch / arc / mm / tlb.c
index d0126fdfe2d8546d62883cbef419e4b76589cf18..b181f3ee38aab54565d8de8c1e5136375c6358cc 100644 (file)
 /* A copy of the ASID from the PID reg is kept in asid_cache */
 DEFINE_PER_CPU(unsigned int, asid_cache) = MM_CTXT_FIRST_CYCLE;
 
+static int __read_mostly pae_exists;
+
 /*
  * Utility Routine to erase a J-TLB entry
  * Caller needs to setup Index Reg (manually or via getIndex)
@@ -784,7 +786,7 @@ void read_decode_mmu_bcr(void)
                mmu->u_dtlb = mmu4->u_dtlb * 4;
                mmu->u_itlb = mmu4->u_itlb * 4;
                mmu->sasid = mmu4->sasid;
-               mmu->pae = mmu4->pae;
+               pae_exists = mmu->pae = mmu4->pae;
        }
 }
 
@@ -809,6 +811,11 @@ char *arc_mmu_mumbojumbo(int cpu_id, char *buf, int len)
        return buf;
 }
 
+int pae40_exist_but_not_enab(void)
+{
+       return pae_exists && !is_pae40_enabled();
+}
+
 void arc_mmu_init(void)
 {
        char str[256];
@@ -859,6 +866,9 @@ void arc_mmu_init(void)
        /* swapper_pg_dir is the pgd for the kernel, used by vmalloc */
        write_aux_reg(ARC_REG_SCRATCH_DATA0, swapper_pg_dir);
 #endif
+
+       if (pae40_exist_but_not_enab())
+               write_aux_reg(ARC_REG_TLBPD1HI, 0);
 }
 
 /*