Skip to content

Commit

Permalink
powerpc: Set stack limit properly in crit_transfer_to_handler
Browse files Browse the repository at this point in the history
Commit 9778b69 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 <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
Stuart Yoder authored and ozbenh committed Jul 27, 2012
1 parent bdc0077 commit 1f8b0bc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions arch/powerpc/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1f8b0bc

Please sign in to comment.