powerpc: Define/use HUGETLB_NEED_PRELOAD insead of complicated #if
authorBecky Bruce <beckyb@kernel.crashing.org>
Tue, 29 Nov 2011 15:10:39 +0000 (15:10 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 7 Dec 2011 05:26:24 +0000 (16:26 +1100)
Define HUGETLB_NEED_PRELOAD in mmu-book3e.h for CONFIG_PPC64 instead
of having a much more complicated #if block.  This is easier to read
and maintain.

Signed-off-by: Becky Bruce <beckyb@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/hugetlb.h
arch/powerpc/include/asm/mmu-book3e.h

index 863f49d5ea35ed60b2c021175f9e021b9b9c11a8..dfdb95bc59a50a9f89267112dfec3c1b0c10abb2 100644 (file)
@@ -124,8 +124,7 @@ static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
                                             unsigned long addr, pte_t *ptep,
                                             pte_t pte, int dirty)
 {
-#if defined(CONFIG_PPC_MMU_NOHASH) && \
-       !(defined(CONFIG_PPC_FSL_BOOK3E) && defined(CONFIG_PPC32))
+#ifdef HUGETLB_NEED_PRELOAD
        /*
         * The "return 1" forces a call of update_mmu_cache, which will write a
         * TLB entry.  Without this, platforms that don't do a write of the TLB
index 50210b9b014752d4dcc86987e7be92e2e09acd14..f5f89cafebd027c115570651d6bc19f038f29746 100644 (file)
@@ -258,6 +258,13 @@ extern int mmu_vmemmap_psize;
 
 #ifdef CONFIG_PPC64
 extern unsigned long linear_map_top;
+
+/*
+ * 64-bit booke platforms don't load the tlb in the tlb miss handler code.
+ * HUGETLB_NEED_PRELOAD handles this - it causes huge_ptep_set_access_flags to
+ * return 1, indicating that the tlb requires preloading.
+ */
+#define HUGETLB_NEED_PRELOAD
 #endif
 
 #endif /* !__ASSEMBLY__ */