aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r--arch/powerpc/kernel/entry_64.S69
1 files changed, 36 insertions, 33 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 2d802e97097c..fd8b4bae9b04 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -512,31 +512,12 @@ _GLOBAL(ret_from_except_lite)
512#endif 512#endif
513 513
514restore: 514restore:
515 ld r5,SOFTE(r1)
516#ifdef CONFIG_PPC_ISERIES
517BEGIN_FW_FTR_SECTION 515BEGIN_FW_FTR_SECTION
518 cmpdi 0,r5,0 516 ld r5,SOFTE(r1)
519 beq 4f 517FW_FTR_SECTION_ELSE
520 /* Check for pending interrupts (iSeries) */ 518 b iseries_check_pending_irqs
521 ld r3,PACALPPACAPTR(r13) 519ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
522 ld r3,LPPACAANYINT(r3) 5202:
523 cmpdi r3,0
524 beq+ 4f /* skip do_IRQ if no interrupts */
525
526 li r3,0
527 stb r3,PACASOFTIRQEN(r13) /* ensure we are soft-disabled */
528#ifdef CONFIG_TRACE_IRQFLAGS
529 bl .trace_hardirqs_off
530 mfmsr r10
531#endif
532 ori r10,r10,MSR_EE
533 mtmsrd r10 /* hard-enable again */
534 addi r3,r1,STACK_FRAME_OVERHEAD
535 bl .do_IRQ
536 b .ret_from_except_lite /* loop back and handle more */
5374:
538END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
539#endif
540 TRACE_AND_RESTORE_IRQ(r5); 521 TRACE_AND_RESTORE_IRQ(r5);
541 522
542 /* extract EE bit and use it to restore paca->hard_enabled */ 523 /* extract EE bit and use it to restore paca->hard_enabled */
@@ -592,6 +573,30 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
592 rfid 573 rfid
593 b . /* prevent speculative execution */ 574 b . /* prevent speculative execution */
594 575
576iseries_check_pending_irqs:
577#ifdef CONFIG_PPC_ISERIES
578 ld r5,SOFTE(r1)
579 cmpdi 0,r5,0
580 beq 2b
581 /* Check for pending interrupts (iSeries) */
582 ld r3,PACALPPACAPTR(r13)
583 ld r3,LPPACAANYINT(r3)
584 cmpdi r3,0
585 beq+ 2b /* skip do_IRQ if no interrupts */
586
587 li r3,0
588 stb r3,PACASOFTIRQEN(r13) /* ensure we are soft-disabled */
589#ifdef CONFIG_TRACE_IRQFLAGS
590 bl .trace_hardirqs_off
591 mfmsr r10
592#endif
593 ori r10,r10,MSR_EE
594 mtmsrd r10 /* hard-enable again */
595 addi r3,r1,STACK_FRAME_OVERHEAD
596 bl .do_IRQ
597 b .ret_from_except_lite /* loop back and handle more */
598#endif
599
595do_work: 600do_work:
596#ifdef CONFIG_PREEMPT 601#ifdef CONFIG_PREEMPT
597 andi. r0,r3,MSR_PR /* Returning to user mode? */ 602 andi. r0,r3,MSR_PR /* Returning to user mode? */
@@ -685,10 +690,6 @@ _GLOBAL(enter_rtas)
685 std r7,_DAR(r1) 690 std r7,_DAR(r1)
686 mfdsisr r8 691 mfdsisr r8
687 std r8,_DSISR(r1) 692 std r8,_DSISR(r1)
688 mfsrr0 r9
689 std r9,_SRR0(r1)
690 mfsrr1 r10
691 std r10,_SRR1(r1)
692 693
693 /* Temporary workaround to clear CR until RTAS can be modified to 694 /* Temporary workaround to clear CR until RTAS can be modified to
694 * ignore all bits. 695 * ignore all bits.
@@ -749,6 +750,10 @@ _STATIC(rtas_return_loc)
749 mfspr r4,SPRN_SPRG3 /* Get PACA */ 750 mfspr r4,SPRN_SPRG3 /* Get PACA */
750 clrldi r4,r4,2 /* convert to realmode address */ 751 clrldi r4,r4,2 /* convert to realmode address */
751 752
753 bcl 20,31,$+4
7540: mflr r3
755 ld r3,(1f-0b)(r3) /* get &.rtas_restore_regs */
756
752 mfmsr r6 757 mfmsr r6
753 li r0,MSR_RI 758 li r0,MSR_RI
754 andc r6,r6,r0 759 andc r6,r6,r0
@@ -756,7 +761,6 @@ _STATIC(rtas_return_loc)
756 mtmsrd r6 761 mtmsrd r6
757 762
758 ld r1,PACAR1(r4) /* Restore our SP */ 763 ld r1,PACAR1(r4) /* Restore our SP */
759 LOAD_REG_IMMEDIATE(r3,.rtas_restore_regs)
760 ld r4,PACASAVEDMSR(r4) /* Restore our MSR */ 764 ld r4,PACASAVEDMSR(r4) /* Restore our MSR */
761 765
762 mtspr SPRN_SRR0,r3 766 mtspr SPRN_SRR0,r3
@@ -764,6 +768,9 @@ _STATIC(rtas_return_loc)
764 rfid 768 rfid
765 b . /* prevent speculative execution */ 769 b . /* prevent speculative execution */
766 770
771 .align 3
7721: .llong .rtas_restore_regs
773
767_STATIC(rtas_restore_regs) 774_STATIC(rtas_restore_regs)
768 /* relocation is on at this point */ 775 /* relocation is on at this point */
769 REST_GPR(2, r1) /* Restore the TOC */ 776 REST_GPR(2, r1) /* Restore the TOC */
@@ -783,10 +790,6 @@ _STATIC(rtas_restore_regs)
783 mtdar r7 790 mtdar r7
784 ld r8,_DSISR(r1) 791 ld r8,_DSISR(r1)
785 mtdsisr r8 792 mtdsisr r8
786 ld r9,_SRR0(r1)
787 mtsrr0 r9
788 ld r10,_SRR1(r1)
789 mtsrr1 r10
790 793
791 addi r1,r1,RTAS_FRAME_SIZE /* Unstack our frame */ 794 addi r1,r1,RTAS_FRAME_SIZE /* Unstack our frame */
792 ld r0,16(r1) /* get return address */ 795 ld r0,16(r1) /* get return address */