Commit 1f8b0bc8 authored by Stuart Yoder's avatar Stuart Yoder Committed by Benjamin Herrenschmidt

powerpc: Set stack limit properly in crit_transfer_to_handler

Commit 9778b696 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: default avatarStuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent bdc0077a
...@@ -89,10 +89,14 @@ crit_transfer_to_handler: ...@@ -89,10 +89,14 @@ crit_transfer_to_handler:
mfspr r0,SPRN_SRR1 mfspr r0,SPRN_SRR1
stw r0,_SRR1(r11) 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 mfspr r8,SPRN_SPRG_THREAD
lwz r0,KSP_LIMIT(r8) lwz r0,KSP_LIMIT(r8)
stw r0,SAVED_KSP_LIMIT(r11) stw r0,SAVED_KSP_LIMIT(r11)
CURRENT_THREAD_INFO(r0, r1) rlwimi r0,r1,0,0,(31-THREAD_SHIFT)
stw r0,KSP_LIMIT(r8) stw r0,KSP_LIMIT(r8)
/* fall through */ /* fall through */
#endif #endif
...@@ -109,10 +113,14 @@ crit_transfer_to_handler: ...@@ -109,10 +113,14 @@ crit_transfer_to_handler:
mfspr r0,SPRN_SRR1 mfspr r0,SPRN_SRR1
stw r0,crit_srr1@l(0) 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 mfspr r8,SPRN_SPRG_THREAD
lwz r0,KSP_LIMIT(r8) lwz r0,KSP_LIMIT(r8)
stw r0,saved_ksp_limit@l(0) 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) stw r0,KSP_LIMIT(r8)
/* fall through */ /* fall through */
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment