diff options
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r-- | arch/powerpc/kernel/entry_64.S | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index 13019845536b..c0db5b769e55 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/firmware.h> | 30 | #include <asm/firmware.h> |
31 | #include <asm/bug.h> | 31 | #include <asm/bug.h> |
32 | #include <asm/ptrace.h> | 32 | #include <asm/ptrace.h> |
33 | #include <asm/irqflags.h> | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * System calls. | 36 | * System calls. |
@@ -89,6 +90,14 @@ system_call_common: | |||
89 | addi r9,r1,STACK_FRAME_OVERHEAD | 90 | addi r9,r1,STACK_FRAME_OVERHEAD |
90 | ld r11,exception_marker@toc(r2) | 91 | ld r11,exception_marker@toc(r2) |
91 | std r11,-16(r9) /* "regshere" marker */ | 92 | std r11,-16(r9) /* "regshere" marker */ |
93 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
94 | bl .trace_hardirqs_on | ||
95 | REST_GPR(0,r1) | ||
96 | REST_4GPRS(3,r1) | ||
97 | REST_2GPRS(7,r1) | ||
98 | addi r9,r1,STACK_FRAME_OVERHEAD | ||
99 | ld r12,_MSR(r1) | ||
100 | #endif /* CONFIG_TRACE_IRQFLAGS */ | ||
92 | li r10,1 | 101 | li r10,1 |
93 | stb r10,PACASOFTIRQEN(r13) | 102 | stb r10,PACASOFTIRQEN(r13) |
94 | stb r10,PACAHARDIRQEN(r13) | 103 | stb r10,PACAHARDIRQEN(r13) |
@@ -103,7 +112,7 @@ BEGIN_FW_FTR_SECTION | |||
103 | b hardware_interrupt_entry | 112 | b hardware_interrupt_entry |
104 | 2: | 113 | 2: |
105 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | 114 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) |
106 | #endif | 115 | #endif /* CONFIG_PPC_ISERIES */ |
107 | mfmsr r11 | 116 | mfmsr r11 |
108 | ori r11,r11,MSR_EE | 117 | ori r11,r11,MSR_EE |
109 | mtmsrd r11,1 | 118 | mtmsrd r11,1 |
@@ -505,6 +514,10 @@ BEGIN_FW_FTR_SECTION | |||
505 | 514 | ||
506 | li r3,0 | 515 | li r3,0 |
507 | stb r3,PACASOFTIRQEN(r13) /* ensure we are soft-disabled */ | 516 | stb r3,PACASOFTIRQEN(r13) /* ensure we are soft-disabled */ |
517 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
518 | bl .trace_hardirqs_off | ||
519 | mfmsr r10 | ||
520 | #endif | ||
508 | ori r10,r10,MSR_EE | 521 | ori r10,r10,MSR_EE |
509 | mtmsrd r10 /* hard-enable again */ | 522 | mtmsrd r10 /* hard-enable again */ |
510 | addi r3,r1,STACK_FRAME_OVERHEAD | 523 | addi r3,r1,STACK_FRAME_OVERHEAD |
@@ -513,7 +526,7 @@ BEGIN_FW_FTR_SECTION | |||
513 | 4: | 526 | 4: |
514 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) | 527 | END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES) |
515 | #endif | 528 | #endif |
516 | stb r5,PACASOFTIRQEN(r13) | 529 | TRACE_AND_RESTORE_IRQ(r5); |
517 | 530 | ||
518 | /* extract EE bit and use it to restore paca->hard_enabled */ | 531 | /* extract EE bit and use it to restore paca->hard_enabled */ |
519 | ld r3,_MSR(r1) | 532 | ld r3,_MSR(r1) |
@@ -581,6 +594,16 @@ do_work: | |||
581 | bne restore | 594 | bne restore |
582 | /* here we are preempting the current task */ | 595 | /* here we are preempting the current task */ |
583 | 1: | 596 | 1: |
597 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
598 | bl .trace_hardirqs_on | ||
599 | /* Note: we just clobbered r10 which used to contain the previous | ||
600 | * MSR before the hard-disabling done by the caller of do_work. | ||
601 | * We don't have that value anymore, but it doesn't matter as | ||
602 | * we will hard-enable unconditionally, we can just reload the | ||
603 | * current MSR into r10 | ||
604 | */ | ||
605 | mfmsr r10 | ||
606 | #endif /* CONFIG_TRACE_IRQFLAGS */ | ||
584 | li r0,1 | 607 | li r0,1 |
585 | stb r0,PACASOFTIRQEN(r13) | 608 | stb r0,PACASOFTIRQEN(r13) |
586 | stb r0,PACAHARDIRQEN(r13) | 609 | stb r0,PACAHARDIRQEN(r13) |