Skip to content

Commit

Permalink
powerpc: Initialise paca->kstack before early_setup_secondary
Browse files Browse the repository at this point in the history
As early setup calls down to slb_initialize(), we must have kstack
initialised before checking "should we add a bolted SLB entry for our kstack?"

Failing to do so means stack access requires an SLB miss exception to refill
an entry dynamically, if the stack isn't accessible via SLB(0) (kernel text
& static data).  It's not always allowable to take such a miss, and
intermittent crashes will result.

Primary CPUs don't have this issue; an SLB entry is not bolted for their
stack anyway (as that lives within SLB(0)).  This patch therefore only
affects the init of secondaries.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Matt Evans authored and Benjamin Herrenschmidt committed Aug 24, 2010
1 parent 7aa241f commit f761622
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/powerpc/kernel/head_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -572,16 +572,16 @@ __secondary_start:
/* Set thread priority to MEDIUM */
HMT_MEDIUM

/* Do early setup for that CPU (stab, slb, hash table pointer) */
bl .early_setup_secondary

/* Initialize the kernel stack. Just a repeat for iSeries. */
LOAD_REG_ADDR(r3, current_set)
sldi r28,r24,3 /* get current_set[cpu#] */
ldx r1,r3,r28
addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD
std r1,PACAKSAVE(r13)

/* Do early setup for that CPU (stab, slb, hash table pointer) */
bl .early_setup_secondary

/* Clear backchain so we get nice backtraces */
li r7,0
mtlr r7
Expand Down

0 comments on commit f761622

Please sign in to comment.