From: Stuart Yoder Date: Mon, 16 Jul 2012 09:06:48 +0000 (+0000) Subject: powerpc: Set stack limit properly in crit_transfer_to_handler X-Git-Tag: upstream/snapshot3+hdmi~6945^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f8b0bc81ac283adcda68805e0e2f5108614db44;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git powerpc: Set stack limit properly in crit_transfer_to_handler Commit 9778b696a0188ad3b3524b383953ee73b31b7b68 incorrectly changes the code setting the stack limit on entry to the kernel to mark the thread_info at the bottom of the stack out of bounds anymore. This fixes it. Signed-off-by: Stuart Yoder Signed-off-by: Benjamin Herrenschmidt --- diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 5207d5a..ead5016 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -89,10 +89,14 @@ crit_transfer_to_handler: mfspr r0,SPRN_SRR1 stw r0,_SRR1(r11) + /* set the stack limit to the current stack + * and set the limit to protect the thread_info + * struct + */ mfspr r8,SPRN_SPRG_THREAD lwz r0,KSP_LIMIT(r8) stw r0,SAVED_KSP_LIMIT(r11) - CURRENT_THREAD_INFO(r0, r1) + rlwimi r0,r1,0,0,(31-THREAD_SHIFT) stw r0,KSP_LIMIT(r8) /* fall through */ #endif @@ -109,10 +113,14 @@ crit_transfer_to_handler: mfspr r0,SPRN_SRR1 stw r0,crit_srr1@l(0) + /* set the stack limit to the current stack + * and set the limit to protect the thread_info + * struct + */ mfspr r8,SPRN_SPRG_THREAD lwz r0,KSP_LIMIT(r8) stw r0,saved_ksp_limit@l(0) - CURRENT_THREAD_INFO(r0, r1) + rlwimi r0,r1,0,0,(31-THREAD_SHIFT) stw r0,KSP_LIMIT(r8) /* fall through */ #endif