Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / arch / arm / mm / mmu.c
index 7a4e67f..1ca8e17 100644 (file)
@@ -299,21 +299,6 @@ const struct mem_type *get_mem_type(unsigned int type)
 }
 EXPORT_SYMBOL(get_mem_type);
 
-/*
- * If the system supports huge pages and we are running with short descriptors,
- * then compute the pmd and linux pte prot values for a huge page.
- *
- * These values are used by both the HugeTLB and THP code.
- */
-#if defined(CONFIG_SYS_SUPPORTS_HUGETLBFS) && !defined(CONFIG_ARM_LPAE)
-pmdval_t arm_hugepmdprotval;
-EXPORT_SYMBOL(arm_hugepmdprotval);
-
-pteval_t arm_hugepteprotval;
-EXPORT_SYMBOL(arm_hugepteprotval);
-#endif
-
-
 /*
  * Adjust the PMD section entries according to the CPU in use.
  */
@@ -451,6 +436,14 @@ static void __init build_mem_type_table(void)
                mem_types[MT_MEMORY_NONCACHED].prot_sect |= PMD_SECT_S;
                mem_types[MT_MEMORY_NONCACHED].prot_pte |= L_PTE_SHARED;
        }
+       /*
+        * We don't use domains on ARMv6 (since this causes problems with
+        * v6/v7 kernels), so we must use a separate memory type for user
+        * r/o, kernel r/w to map the vectors page.
+        */
+       if (cpu_arch == CPU_ARCH_ARMv6)
+               vecs_pgprot |= L_PTE_MT_VECTORS;
+
        /*
         * ARMv6 and above have extended page tables.
         */
@@ -554,24 +547,6 @@ static void __init build_mem_type_table(void)
                if (t->prot_sect)
                        t->prot_sect |= PMD_DOMAIN(t->domain);
        }
-
-#if defined(CONFIG_SYS_SUPPORTS_HUGETLBFS) && !defined(CONFIG_ARM_LPAE)
-       /*
-        * we assume all huge pages are user pages and that hardware access
-        * flag updates are disabled (i.e. SCTLR.AFE == 0b).
-        */
-       arm_hugepteprotval = mem_types[MT_MEMORY].prot_pte | L_PTE_USER | L_PTE_VALID;
-
-       arm_hugepmdprotval = mem_types[MT_MEMORY].prot_sect | PMD_SECT_AP_READ
-                               | PMD_SECT_nG;
-
-       /* HACK: make huge pages WT
-        * XXX: mm will not know nothing about this..
-        * FIXME: should only do it on Cortex-A8 or below */
-       arm_hugepmdprotval &= ~(PMD_SECT_WB | PMD_SECT_TEX(1));
-       arm_hugepmdprotval |= PMD_SECT_WT;
-#endif
-
 }
 
 #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE