Re: [49/59] powerpc: Initialise paca->kstack before early_setup_secondary

Previous thread: [46/59] drm/radeon/kms: fix typo in radeon_compute_pll_gain by Greg KH on Tuesday, August 24, 2010 - 3:24 pm. (1 message)

Next thread: [58/59] USB: ftdi_sio: add product ID for Lenz LI-USB by Greg KH on Tuesday, August 24, 2010 - 3:25 pm. (1 message)
From: Greg KH
Date: Tuesday, August 24, 2010 - 3:25 pm

2.6.32-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Matt Evans <matt@ozlabs.org>

commit f761622e59433130bc33ad086ce219feee9eb961 upstream.

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>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/powerpc/kernel/head_64.S |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -563,9 +563,6 @@ __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#]	 */
@@ -573,6 +570,9 @@ __secondary_start:
 	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


--

From: Matt Evans
Date: Thursday, August 26, 2010 - 12:10 am

Hi Greg,


I have an objection!   We've found a problem, it breaks stuff fairly thoroughly.  >:(  Mikey has submitted http://patchwork.ozlabs.org/patch/62757/ to Ben's tree to fix it, but it might be easier all round to drop this and we can resubmit the indivisible pair of commits to -stable later?  (You'd selected this for {34,35}-stable also.)

Really for the inconvenience,



--

From: Greg KH
Date: Thursday, August 26, 2010 - 4:25 pm

I've now dropped it, please let me know when you want it back in, if at
all, in the future.

thanks,

greg k-h
--

Previous thread: [46/59] drm/radeon/kms: fix typo in radeon_compute_pll_gain by Greg KH on Tuesday, August 24, 2010 - 3:24 pm. (1 message)

Next thread: [58/59] USB: ftdi_sio: add product ID for Lenz LI-USB by Greg KH on Tuesday, August 24, 2010 - 3:25 pm. (1 message)