aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/mm/slb.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 227056c21eee..6bc8b4aeba5c 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -184,7 +184,7 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
184 unsigned long slbie_data = 0; 184 unsigned long slbie_data = 0;
185 unsigned long pc = KSTK_EIP(tsk); 185 unsigned long pc = KSTK_EIP(tsk);
186 unsigned long stack = KSTK_ESP(tsk); 186 unsigned long stack = KSTK_ESP(tsk);
187 unsigned long unmapped_base; 187 unsigned long exec_base;
188 188
189 if (!cpu_has_feature(CPU_FTR_NO_SLBIE_B) && 189 if (!cpu_has_feature(CPU_FTR_NO_SLBIE_B) &&
190 offset <= SLB_CACHE_ENTRIES) { 190 offset <= SLB_CACHE_ENTRIES) {
@@ -212,14 +212,13 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
212 212
213 /* 213 /*
214 * preload some userspace segments into the SLB. 214 * preload some userspace segments into the SLB.
215 * Almost all 32 and 64bit PowerPC executables are linked at
216 * 0x10000000 so it makes sense to preload this segment.
215 */ 217 */
216 if (test_tsk_thread_flag(tsk, TIF_32BIT)) 218 exec_base = 0x10000000;
217 unmapped_base = TASK_UNMAPPED_BASE_USER32;
218 else
219 unmapped_base = TASK_UNMAPPED_BASE_USER64;
220 219
221 if (is_kernel_addr(pc) || is_kernel_addr(stack) || 220 if (is_kernel_addr(pc) || is_kernel_addr(stack) ||
222 is_kernel_addr(unmapped_base)) 221 is_kernel_addr(exec_base))
223 return; 222 return;
224 223
225 slb_allocate(pc); 224 slb_allocate(pc);
@@ -227,9 +226,9 @@ void switch_slb(struct task_struct *tsk, struct mm_struct *mm)
227 if (!esids_match(pc, stack)) 226 if (!esids_match(pc, stack))
228 slb_allocate(stack); 227 slb_allocate(stack);
229 228
230 if (!esids_match(pc, unmapped_base) && 229 if (!esids_match(pc, exec_base) &&
231 !esids_match(stack, unmapped_base)) 230 !esids_match(stack, exec_base))
232 slb_allocate(unmapped_base); 231 slb_allocate(exec_base);
233} 232}
234 233
235static inline void patch_slb_encoding(unsigned int *insn_addr, 234static inline void patch_slb_encoding(unsigned int *insn_addr,