aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorLEROY Christophe <christophe.leroy@c-s.fr>2014-08-29 05:14:38 -0400
committerScott Wood <scottwood@freescale.com>2014-09-04 20:23:43 -0400
commit5bcbe24f6c7aec918b8cb75e53f8f7f897e3a091 (patch)
tree68316ab609768408be48ff9dcebb3c69a0fee3e0 /arch/powerpc/kernel
parent140a6a60ba18da6b36e7fe1cafbffd09bc805f21 (diff)
powerpc/8xx: No need to save r10 and r3 when not calling FixupDAR
r10 and r3 are only used inside FixupDAR function. So lets save them inside that function only. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/head_8xx.S27
1 files changed, 13 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 899c70174db4..6f544eab983e 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -485,20 +485,12 @@ InstructionTLBError:
485 */ 485 */
486 . = 0x1400 486 . = 0x1400
487DataTLBError: 487DataTLBError:
488#ifdef CONFIG_8xx_CPU6
489 stw r3, 8(r0)
490#endif
491 EXCEPTION_PROLOG_0 488 EXCEPTION_PROLOG_0
492 mtspr SPRN_SPRG_SCRATCH2, r10
493 489
494 mfspr r10, SPRN_DAR 490 mfspr r11, SPRN_DAR
495 cmpwi cr0, r10, 0x00f0 491 cmpwi cr0, r11, 0x00f0
496 beq- FixupDAR /* must be a buggy dcbX, icbi insn. */ 492 beq- FixupDAR /* must be a buggy dcbX, icbi insn. */
497DARFixed:/* Return from dcbx instruction bug workaround */ 493DARFixed:/* Return from dcbx instruction bug workaround */
498#ifdef CONFIG_8xx_CPU6
499 lwz r3, 8(r0)
500#endif
501 mfspr r10,SPRN_SPRG_SCRATCH2
502 EXCEPTION_EPILOG_0 494 EXCEPTION_EPILOG_0
503 b DataAccess 495 b DataAccess
504 496
@@ -528,6 +520,10 @@ DARFixed:/* Return from dcbx instruction bug workaround */
528 /* define if you don't want to use self modifying code */ 520 /* define if you don't want to use self modifying code */
529#define NO_SELF_MODIFYING_CODE 521#define NO_SELF_MODIFYING_CODE
530FixupDAR:/* Entry point for dcbx workaround. */ 522FixupDAR:/* Entry point for dcbx workaround. */
523#ifdef CONFIG_8xx_CPU6
524 stw r3, 8(r0)
525#endif
526 mtspr SPRN_SPRG_SCRATCH2, r10
531 /* fetch instruction from memory. */ 527 /* fetch instruction from memory. */
532 mfspr r10, SPRN_SRR0 528 mfspr r10, SPRN_SRR0
533 andis. r11, r10, 0x8000 /* Address >= 0x80000000 */ 529 andis. r11, r10, 0x8000 /* Address >= 0x80000000 */
@@ -543,6 +539,9 @@ FixupDAR:/* Entry point for dcbx workaround. */
543 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */ 539 mtspr SPRN_MD_TWC, r11 /* Load pte table base address */
544 mfspr r11, SPRN_MD_TWC /* ....and get the pte address */ 540 mfspr r11, SPRN_MD_TWC /* ....and get the pte address */
545 lwz r11, 0(r11) /* Get the pte */ 541 lwz r11, 0(r11) /* Get the pte */
542#ifdef CONFIG_8xx_CPU6
543 lwz r3, 8(r0) /* restore r3 from memory */
544#endif
546 /* concat physical page address(r11) and page offset(r10) */ 545 /* concat physical page address(r11) and page offset(r10) */
547 rlwimi r11, r10, 0, 20, 31 546 rlwimi r11, r10, 0, 20, 31
548 lwz r11,0(r11) 547 lwz r11,0(r11)
@@ -563,15 +562,13 @@ FixupDAR:/* Entry point for dcbx workaround. */
563 beq+ 142f 562 beq+ 142f
564 cmpwi cr0, r10, 1964 /* Is icbi? */ 563 cmpwi cr0, r10, 1964 /* Is icbi? */
565 beq+ 142f 564 beq+ 142f
566141: b DARFixed /* Nope, go back to normal TLB processing */ 565141: mfspr r10,SPRN_SPRG_SCRATCH2
566 b DARFixed /* Nope, go back to normal TLB processing */
567 567
568144: mfspr r10, SPRN_DSISR 568144: mfspr r10, SPRN_DSISR
569 rlwinm r10, r10,0,7,5 /* Clear store bit for buggy dcbst insn */ 569 rlwinm r10, r10,0,7,5 /* Clear store bit for buggy dcbst insn */
570 mtspr SPRN_DSISR, r10 570 mtspr SPRN_DSISR, r10
571142: /* continue, it was a dcbx, dcbi instruction. */ 571142: /* continue, it was a dcbx, dcbi instruction. */
572#ifdef CONFIG_8xx_CPU6
573 lwz r3, 8(r0) /* restore r3 from memory */
574#endif
575#ifndef NO_SELF_MODIFYING_CODE 572#ifndef NO_SELF_MODIFYING_CODE
576 andis. r10,r11,0x1f /* test if reg RA is r0 */ 573 andis. r10,r11,0x1f /* test if reg RA is r0 */
577 li r10,modified_instr@l 574 li r10,modified_instr@l
@@ -590,6 +587,7 @@ modified_instr:
590 bne+ 143f 587 bne+ 143f
591 subf r10,r0,r10 /* r10=r10-r0, only if reg RA is r0 */ 588 subf r10,r0,r10 /* r10=r10-r0, only if reg RA is r0 */
592143: mtdar r10 /* store faulting EA in DAR */ 589143: mtdar r10 /* store faulting EA in DAR */
590 mfspr r10,SPRN_SPRG_SCRATCH2
593 b DARFixed /* Go back to normal TLB handling */ 591 b DARFixed /* Go back to normal TLB handling */
594#else 592#else
595 mfctr r10 593 mfctr r10
@@ -643,6 +641,7 @@ modified_instr:
643 mfdar r11 641 mfdar r11
644 mtctr r11 /* restore ctr reg from DAR */ 642 mtctr r11 /* restore ctr reg from DAR */
645 mtdar r10 /* save fault EA to DAR */ 643 mtdar r10 /* save fault EA to DAR */
644 mfspr r10,SPRN_SPRG_SCRATCH2
646 b DARFixed /* Go back to normal TLB handling */ 645 b DARFixed /* Go back to normal TLB handling */
647 646
648 /* special handling for r10,r11 since these are modified already */ 647 /* special handling for r10,r11 since these are modified already */