diff options
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 6 | ||||
-rw-r--r-- | arch/powerpc/mm/mmu_context_64.c | 8 | ||||
-rw-r--r-- | include/asm-powerpc/page_64.h | 7 |
3 files changed, 8 insertions, 13 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index c74af42eb9c1..d525f2eba313 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -601,13 +601,7 @@ static void demote_segment_4k(struct mm_struct *mm, unsigned long addr) | |||
601 | { | 601 | { |
602 | if (mm->context.user_psize == MMU_PAGE_4K) | 602 | if (mm->context.user_psize == MMU_PAGE_4K) |
603 | return; | 603 | return; |
604 | #ifdef CONFIG_PPC_MM_SLICES | ||
605 | slice_set_user_psize(mm, MMU_PAGE_4K); | 604 | slice_set_user_psize(mm, MMU_PAGE_4K); |
606 | #else /* CONFIG_PPC_MM_SLICES */ | ||
607 | mm->context.user_psize = MMU_PAGE_4K; | ||
608 | mm->context.sllp = SLB_VSID_USER | mmu_psize_defs[MMU_PAGE_4K].sllp; | ||
609 | #endif /* CONFIG_PPC_MM_SLICES */ | ||
610 | |||
611 | #ifdef CONFIG_SPU_BASE | 605 | #ifdef CONFIG_SPU_BASE |
612 | spu_flush_all_slbs(mm); | 606 | spu_flush_all_slbs(mm); |
613 | #endif | 607 | #endif |
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c index 901ea765f146..1db38ba1f544 100644 --- a/arch/powerpc/mm/mmu_context_64.c +++ b/arch/powerpc/mm/mmu_context_64.c | |||
@@ -49,18 +49,12 @@ again: | |||
49 | return -ENOMEM; | 49 | return -ENOMEM; |
50 | } | 50 | } |
51 | 51 | ||
52 | #ifdef CONFIG_PPC_MM_SLICES | ||
53 | /* The old code would re-promote on fork, we don't do that | 52 | /* The old code would re-promote on fork, we don't do that |
54 | * when using slices as it could cause problem promoting slices | 53 | * when using slices as it could cause problem promoting slices |
55 | * that have been forced down to 4K | 54 | * that have been forced down to 4K |
56 | */ | 55 | */ |
57 | if (mm->context.id == 0) | 56 | if (slice_mm_new_context(mm)) |
58 | slice_set_user_psize(mm, mmu_virtual_psize); | 57 | slice_set_user_psize(mm, mmu_virtual_psize); |
59 | #else | ||
60 | mm->context.user_psize = mmu_virtual_psize; | ||
61 | mm->context.sllp = SLB_VSID_USER | | ||
62 | mmu_psize_defs[mmu_virtual_psize].sllp; | ||
63 | #endif | ||
64 | mm->context.id = index; | 58 | mm->context.id = index; |
65 | 59 | ||
66 | return 0; | 60 | return 0; |
diff --git a/include/asm-powerpc/page_64.h b/include/asm-powerpc/page_64.h index 3448a3d4bc64..4ceb1132c480 100644 --- a/include/asm-powerpc/page_64.h +++ b/include/asm-powerpc/page_64.h | |||
@@ -121,6 +121,7 @@ extern unsigned int get_slice_psize(struct mm_struct *mm, | |||
121 | 121 | ||
122 | extern void slice_init_context(struct mm_struct *mm, unsigned int psize); | 122 | extern void slice_init_context(struct mm_struct *mm, unsigned int psize); |
123 | extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); | 123 | extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize); |
124 | #define slice_mm_new_context(mm) ((mm)->context.id == 0) | ||
124 | 125 | ||
125 | #define ARCH_HAS_HUGEPAGE_ONLY_RANGE | 126 | #define ARCH_HAS_HUGEPAGE_ONLY_RANGE |
126 | extern int is_hugepage_only_range(struct mm_struct *m, | 127 | extern int is_hugepage_only_range(struct mm_struct *m, |
@@ -130,6 +131,12 @@ extern int is_hugepage_only_range(struct mm_struct *m, | |||
130 | #endif /* __ASSEMBLY__ */ | 131 | #endif /* __ASSEMBLY__ */ |
131 | #else | 132 | #else |
132 | #define slice_init() | 133 | #define slice_init() |
134 | #define slice_set_user_psize(mm, psize) \ | ||
135 | do { \ | ||
136 | (mm)->context.user_psize = (psize); \ | ||
137 | (mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \ | ||
138 | } while (0) | ||
139 | #define slice_mm_new_context(mm) 1 | ||
133 | #endif /* CONFIG_PPC_MM_SLICES */ | 140 | #endif /* CONFIG_PPC_MM_SLICES */ |
134 | 141 | ||
135 | #ifdef CONFIG_HUGETLB_PAGE | 142 | #ifdef CONFIG_HUGETLB_PAGE |