diff options
author | Kevin Hao <kexin.hao@windriver.com> | 2011-11-10 11:04:17 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-11-15 22:47:54 -0500 |
commit | 2cd76629f6c40f7b227ba7b3885ce10e6ec0face (patch) | |
tree | 489086d91c65c749deb3250447b875a22e68a16e /arch/powerpc | |
parent | d715e433b7ad19c02fc4becf0d5e9a59f97925de (diff) |
powerpc/trace: Add a dummy stack frame for trace_hardirqs_off
The trace_hardirqs_off will use CALLER_ADDR0 and CALLER_ADDR1.
If an exception occurs in user mode, there is only one stack frame
on the stack and accessing the CALLER_ADDR1 will causes the following
call trace. So we create a dummy stack frame to make
trace_hardirqs_off happy.
WARNING: at kernel/smp.c:459
Modules linked in:
NIP: c0093280 LR: c00930a0 CTR: c0010780
REGS: edb87ae0 TRAP: 0700 Not tainted (3.1.0)
MSR: 00021002 <ME,CE> CR: 28002888 XER: 00000000
TASK = edce2ac0[17658] 'mthread-lock-on' THREAD: edb86000 CPU: 5
GPR00: 00000001 edb87b90 edce2ac0 00000005 c0019594 edb87bd8 00000001 00000fe3
GPR08: 00041000 c084138c 4e20120d edb87b90 48002888 1001aa7c 00000000 00000000
GPR16: 48830000 10012a8c 00000000 10000af4 00000001 c0810000 00000000 00000000
GPR24: ee9aa920 c0816a18 00000000 00000005 c0019594 edb87bd8 ee20178c edb87b90
NIP [c0093280] smp_call_function_many+0x214/0x2b4
LR [c00930a0] smp_call_function_many+0x34/0x2b4
Call Trace:
[edb87b90] [c00930a0] smp_call_function_many+0x34/0x2b4 (unreliable)
[edb87bd0] [c00194ec] __flush_tlb_page+0xac/0x100
[edb87c00] [c001957c] flush_tlb_page+0x3c/0x54
[edb87c10] [c00180ac] ptep_set_access_flags+0x74/0x12c
[edb87c40] [c0128068] handle_pte_fault+0x2f0/0x9ac
[edb87cb0] [c0128c3c] handle_mm_fault+0x104/0x1dc
[edb87ce0] [c05f40f4] do_page_fault+0x2dc/0x630
[edb87e50] [c001078c] handle_page_fault+0xc/0x80
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/entry_32.S | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 56212bc0ab08..4f80cf1ce77b 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S | |||
@@ -215,7 +215,22 @@ reenable_mmu: /* re-enable mmu so we can */ | |||
215 | stw r9,8(r1) | 215 | stw r9,8(r1) |
216 | stw r11,12(r1) | 216 | stw r11,12(r1) |
217 | stw r3,ORIG_GPR3(r1) | 217 | stw r3,ORIG_GPR3(r1) |
218 | /* | ||
219 | * The trace_hardirqs_off will use CALLER_ADDR0 and CALLER_ADDR1. | ||
220 | * If from user mode there is only one stack frame on the stack, and | ||
221 | * accessing CALLER_ADDR1 will cause oops. So we need create a dummy | ||
222 | * stack frame to make trace_hardirqs_off happy. | ||
223 | */ | ||
224 | andi. r12,r12,MSR_PR | ||
225 | beq 11f | ||
226 | stwu r1,-16(r1) | ||
227 | bl trace_hardirqs_off | ||
228 | addi r1,r1,16 | ||
229 | b 12f | ||
230 | |||
231 | 11: | ||
218 | bl trace_hardirqs_off | 232 | bl trace_hardirqs_off |
233 | 12: | ||
219 | lwz r0,GPR0(r1) | 234 | lwz r0,GPR0(r1) |
220 | lwz r3,ORIG_GPR3(r1) | 235 | lwz r3,ORIG_GPR3(r1) |
221 | lwz r4,GPR4(r1) | 236 | lwz r4,GPR4(r1) |