aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2016-09-16 02:42:04 -0400
committerScott Wood <oss@buserror.net>2016-09-25 03:38:56 -0400
commitd1b9f81456d27dd44c0e7193a8a24ec0bfeda98b (patch)
tree85113d5db6a7d5e4391f6d1bdf28adf09061bd9e
parent5dc6f3fedee58efa343e822558fc3e2f0eb2ad1f (diff)
powerpc/8xx: use r3 to scratch CR in ITLBmiss
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Scott Wood <oss@buserror.net>
-rw-r--r--arch/powerpc/kernel/head_8xx.S21
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index f559f217cd87..451e78929f16 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -321,7 +321,7 @@ SystemCall:
321#endif 321#endif
322 322
323InstructionTLBMiss: 323InstructionTLBMiss:
324#ifdef CONFIG_8xx_CPU6 324#if defined(CONFIG_8xx_CPU6) || defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
325 mtspr SPRN_SPRG_SCRATCH2, r3 325 mtspr SPRN_SPRG_SCRATCH2, r3
326#endif 326#endif
327 EXCEPTION_PROLOG_0 327 EXCEPTION_PROLOG_0
@@ -329,23 +329,20 @@ InstructionTLBMiss:
329 /* If we are faulting a kernel address, we have to use the 329 /* If we are faulting a kernel address, we have to use the
330 * kernel page tables. 330 * kernel page tables.
331 */ 331 */
332 mfspr r10, SPRN_SRR0 /* Get effective address of fault */
333 INVALIDATE_ADJACENT_PAGES_CPU15(r11, r10)
332#if defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC) 334#if defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
333 /* Only modules will cause ITLB Misses as we always 335 /* Only modules will cause ITLB Misses as we always
334 * pin the first 8MB of kernel memory */ 336 * pin the first 8MB of kernel memory */
335 mfspr r11, SPRN_SRR0 /* Get effective address of fault */ 337 mfcr r3
336 INVALIDATE_ADJACENT_PAGES_CPU15(r10, r11) 338 IS_KERNEL(r11, r10)
337 mfcr r10 339#endif
338 IS_KERNEL(r11, r11)
339 mfspr r11, SPRN_M_TW /* Get level 1 table */ 340 mfspr r11, SPRN_M_TW /* Get level 1 table */
341#if defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
340 BRANCH_UNLESS_KERNEL(3f) 342 BRANCH_UNLESS_KERNEL(3f)
341 lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha 343 lis r11, (swapper_pg_dir-PAGE_OFFSET)@ha
3423: 3443:
343 mtcr r10 345 mtcr r3
344 mfspr r10, SPRN_SRR0 /* Get effective address of fault */
345#else
346 mfspr r10, SPRN_SRR0 /* Get effective address of fault */
347 INVALIDATE_ADJACENT_PAGES_CPU15(r11, r10)
348 mfspr r11, SPRN_M_TW /* Get level 1 table base address */
349#endif 346#endif
350 /* Insert level 1 index */ 347 /* Insert level 1 index */
351 rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29 348 rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
@@ -377,7 +374,7 @@ InstructionTLBMiss:
377 MTSPR_CPU6(SPRN_MI_RPN, r10, r3) /* Update TLB entry */ 374 MTSPR_CPU6(SPRN_MI_RPN, r10, r3) /* Update TLB entry */
378 375
379 /* Restore registers */ 376 /* Restore registers */
380#ifdef CONFIG_8xx_CPU6 377#if defined(CONFIG_8xx_CPU6) || defined(CONFIG_MODULES) || defined (CONFIG_DEBUG_PAGEALLOC)
381 mfspr r3, SPRN_SPRG_SCRATCH2 378 mfspr r3, SPRN_SPRG_SCRATCH2
382#endif 379#endif
383 EXCEPTION_EPILOG_0 380 EXCEPTION_EPILOG_0