diff options
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index f9fd54bfcc84..9763267e38b4 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -658,42 +658,43 @@ do_work: | |||
658 | cmpdi r0,0 | 658 | cmpdi r0,0 |
659 | crandc eq,cr1*4+eq,eq | 659 | crandc eq,cr1*4+eq,eq |
660 | bne restore | 660 | bne restore |
661 | /* here we are preempting the current task */ | 661 | |
662 | 1: | 662 | /* Here we are preempting the current task. |
663 | #ifdef CONFIG_TRACE_IRQFLAGS | 663 | * |
664 | bl .trace_hardirqs_on | 664 | * Ensure interrupts are soft-disabled. We also properly mark |
665 | /* Note: we just clobbered r10 which used to contain the previous | 665 | * the PACA to reflect the fact that they are hard-disabled |
666 | * MSR before the hard-disabling done by the caller of do_work. | 666 | * and trace the change |
667 | * We don't have that value anymore, but it doesn't matter as | ||
668 | * we will hard-enable unconditionally, we can just reload the | ||
669 | * current MSR into r10 | ||
670 | */ | 667 | */ |
671 | mfmsr r10 | 668 | li r0,0 |
672 | #endif /* CONFIG_TRACE_IRQFLAGS */ | ||
673 | li r0,1 | ||
674 | stb r0,PACASOFTIRQEN(r13) | 669 | stb r0,PACASOFTIRQEN(r13) |
675 | stb r0,PACAHARDIRQEN(r13) | 670 | stb r0,PACAHARDIRQEN(r13) |
671 | TRACE_DISABLE_INTS | ||
672 | |||
673 | /* Call the scheduler with soft IRQs off */ | ||
674 | 1: bl .preempt_schedule_irq | ||
675 | |||
676 | /* Hard-disable interrupts again (and update PACA) */ | ||
676 | #ifdef CONFIG_PPC_BOOK3E | 677 | #ifdef CONFIG_PPC_BOOK3E |
677 | wrteei 1 | ||
678 | bl .preempt_schedule | ||
679 | wrteei 0 | 678 | wrteei 0 |
680 | #else | 679 | #else |
681 | ori r10,r10,MSR_EE | ||
682 | mtmsrd r10,1 /* reenable interrupts */ | ||
683 | bl .preempt_schedule | ||
684 | mfmsr r10 | 680 | mfmsr r10 |
685 | clrrdi r9,r1,THREAD_SHIFT | 681 | rldicl r10,r10,48,1 |
686 | rldicl r10,r10,48,1 /* disable interrupts again */ | ||
687 | rotldi r10,r10,16 | 682 | rotldi r10,r10,16 |
688 | mtmsrd r10,1 | 683 | mtmsrd r10,1 |
689 | #endif /* CONFIG_PPC_BOOK3E */ | 684 | #endif /* CONFIG_PPC_BOOK3E */ |
685 | li r0,0 | ||
686 | stb r0,PACAHARDIRQEN(r13) | ||
687 | |||
688 | /* Re-test flags and eventually loop */ | ||
689 | clrrdi r9,r1,THREAD_SHIFT | ||
690 | ld r4,TI_FLAGS(r9) | 690 | ld r4,TI_FLAGS(r9) |
691 | andi. r0,r4,_TIF_NEED_RESCHED | 691 | andi. r0,r4,_TIF_NEED_RESCHED |
692 | bne 1b | 692 | bne 1b |
693 | b restore | 693 | b restore |
694 | 694 | ||
695 | user_work: | 695 | user_work: |
696 | #endif | 696 | #endif /* CONFIG_PREEMPT */ |
697 | |||
697 | /* Enable interrupts */ | 698 | /* Enable interrupts */ |
698 | #ifdef CONFIG_PPC_BOOK3E | 699 | #ifdef CONFIG_PPC_BOOK3E |
699 | wrteei 1 | 700 | wrteei 1 |