powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning again
authorLi Zhong <zhong@linux.vnet.ibm.com>
Mon, 6 May 2013 22:44:41 +0000 (22:44 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 14 May 2013 04:36:35 +0000 (14:36 +1000)
Saw this warning again, and this time from the ret_from_fork path.

It seems we could clear the back chain earlier in copy_thread(), which
could cover both path, and also fix potential lockdep usage in
schedule_tail(), or exception occurred before we clear the back chain.

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/entry_32.S
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/process.c

index e514de57a125333a4ce174cb399070b6cc62e3b4..d22e73e4618b7924879517f1f59cb99dcd63b43e 100644 (file)
@@ -439,8 +439,6 @@ ret_from_fork:
 ret_from_kernel_thread:
        REST_NVGPRS(r1)
        bl      schedule_tail
-       li      r3,0
-       stw     r3,0(r1)
        mtlr    r14
        mr      r3,r15
        PPC440EP_ERR42
index 3fe5259e2fea872be5da2e333427a935f8a012d0..48e8a86e7cb24c0c29af6c1ce1defbeca0079c29 100644 (file)
@@ -376,8 +376,6 @@ _GLOBAL(ret_from_fork)
 _GLOBAL(ret_from_kernel_thread)
        bl      .schedule_tail
        REST_NVGPRS(r1)
-       li      r3,0
-       std     r3,0(r1)
        ld      r14, 0(r14)
        mtlr    r14
        mr      r3,r15
index ceb4e7b62cf441ed6237499d11ef15cc6e2e4d50..21981a89e394e378873fb7330cc69d72d31b50a2 100644 (file)
@@ -971,6 +971,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
         * do some house keeping and then return from the fork or clone
         * system call, using the stack frame created above.
         */
+       ((unsigned long *)sp)[0] = 0;
        sp -= sizeof(struct pt_regs);
        kregs = (struct pt_regs *) sp;
        sp -= STACK_FRAME_OVERHEAD;