[PATCH 9/12] ppc64: Misc fixups for non-zero KERNELBASE

Michael Ellerman michael at ellerman.id.au
Fri Aug 26 12:53:29 EST 2005


The code to do startup of secondary cpus assumes it only needs to load the low
halfword of the __secondary_hold_* symbols. This won't work if we build the
kernel at 32 MB.

The interrupt prolog code for pSeries assumes it can get the address of the
interrupt handler by just loading the top and bottom halfwords of the address.
This doesn't work if the kernel's linked too far above zero. We'd like to use
SET_REG_TO_LABEL(), but we're short on space, so we simply augment the
existing hack.

Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---

 arch/ppc64/kernel/head.S |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

Index: work/arch/ppc64/kernel/head.S
===================================================================
--- work.orig/arch/ppc64/kernel/head.S
+++ work/arch/ppc64/kernel/head.S
@@ -143,13 +143,12 @@ _GLOBAL(__secondary_hold)
 	mr	r24,r3
 
 	/* Tell the master cpu we're here */
-	/* Relocation is off & we are located at an address less */
-	/* than 0x100, so only need to grab low order offset.    */
-	std	r24,__secondary_hold_acknowledge at l(0)
+	LOADADDR(r4, __secondary_hold_acknowledge)
+	std	r24,0(r4)
 	sync
 
 	/* All secondary cpus wait here until told to start. */
-100:	ld	r4,__secondary_hold_spinloop at l(0)
+100:	LOADADDR(r4, __secondary_hold_spinloop)
 	cmpdi	0,r4,1
 	bne	100b
 
@@ -210,9 +209,10 @@ exception_marker:
 	std	r9,area+EX_R13(r13);					\
 	mfcr	r9;							\
 	clrrdi	r12,r13,32;		/* get high part of &label */	\
+	oris	r12,r12,(label)@h;	/* virt addr of handler ... */	\
+	ori	r12,r12,(label)@l;	/* .. and the rest */		\
 	mfmsr	r10;							\
 	mfspr	r11,SRR0;		/* save SRR0 */			\
-	ori	r12,r12,(label)@l;	/* virt addr of handler */	\
 	ori	r10,r10,MSR_IR|MSR_DR|MSR_RI;				\
 	mtspr	SRR0,r12;						\
 	mfspr	r12,SRR1;		/* and SRR1 */			\
@@ -1446,7 +1446,7 @@ _STATIC(__boot_from_prom)
 _STATIC(__after_prom_start)
 
 /*
- * We need to run with __start at physical address 0.
+ * We need to run with __start at physical address KERNELBASE.
  * This will leave some code in the first 256B of
  * real memory, which are reserved for software use.
  * The remainder of the first page is loaded with the fixed
@@ -1459,7 +1459,7 @@ _STATIC(__after_prom_start)
  */
 	SET_REG_TO_CONST(r27,KERNELBASE)
 
-	li	r3,0			/* target addr */
+	LOADADDR(r3, PHYSICAL_START)	/* target addr */
 
 	mr	r4,r30			/* source, current addr of __start */
 



More information about the Linuxppc64-dev mailing list