Skip to contentSkip to conversation

PowerPC: kernel: cross compiling issue with allmodconfig

Suggestion In review Chen Gang 6 participants 19 messages Mar 15, 2013 – Mar 25, 2013 PowerPC

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

Hello Maintainers:

do next-* tree support powerpc POWER7 with allmodconfig ?

I met an issue, can we bear it (or I need additional trying) ?

Compiling:
make V=1 EXTRA_CFLAGS=-W ARCH=powerpc allmodconfig
set cpu type POWER7 in menuconfig.
set cross-compiler in menuconfig.
under Fedora 16 x86_64 laptop /usr/bin/powerpc64-linux-gnu-gcc -v
gcc version 4.7.1 20120606 (Red Hat 4.7.1-0.1.20120606) (GCC)

Issue:
error:
/android/public-kernel/linux-next/arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
/android/public-kernel/linux-next/arch/powerpc/kernel/exceptions-64s.S:1304: Error: attempt to move .org backwards

command:
powerpc64-linux-gnu-gcc -m64 -Wp,-MD,arch/powerpc/kernel/.head_64.o.d -nostdinc -isystem /usr/lib/gcc/powerpc64-linux-gnu/4.7.1/include -I/android/public-kernel/linux-next/arch/powerpc/include -Iarch/powerpc/include/generated -I/android/public-kernel/linux-next/include -Iinclude -I/android/public-kernel/linux-next/arch/powerpc/include/uapi -Iarch/powerpc/include/generated/uapi -I/android/public-kernel/linux-next/include/uapi -Iinclude/generated/uapi -include /android/public-kernel/linux-next/include/linux/kconfig.h -D__KERNEL__ -I/android/public-kernel/linux-next/arch/powerpc -Iarch/powerpc -D__ASSEMBLY__ -I/android/public-kernel/linux-next/arch/powerpc -Iarch/powerpc -Wa,-maltivec -gdwarf-2 -c -o arch/powerpc/kernel/head_64.o /android/public-kernel/linux-next/arch/powerpc/kernel/head_64.S

(head_64.S includes exceptions-64.S)

thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
#1 lore raw
Quoted 18 lines

do next-* tree support powerpc POWER7 with allmodconfig ?

I met an issue, can we bear it (or I need additional trying) ?

Compiling:
make V=1 EXTRA_CFLAGS=-W ARCH=powerpc allmodconfig
set cpu type POWER7 in menuconfig.
set cross-compiler in menuconfig.
under Fedora 16 x86_64 laptop /usr/bin/powerpc64-linux-gnu-gcc -v
gcc version 4.7.1 20120606 (Red Hat 4.7.1-0.1.20120606) (GCC)

Issue:
error:
/android/public-kernel/linux-next/arch/powerpc/kernel/exceptions-64s.S: Assembler messages:
/android/public-kernel/linux-next/arch/powerpc/kernel/exceptions-64s.S:1304: Error: attempt to move .org backwards

Quoted 4 lines

command:
powerpc64-linux-gnu-gcc -m64 -Wp,-MD,arch/powerpc/kernel/.head_64.o.d -nostdinc -isystem /usr/lib/gcc/powerpc64-linux-gnu/4.7.1/include -I/android/public-kernel/linux-next/arch/powerpc/include -Iarch/powerpc/include/generated -I/android/public-kernel/linux-next/include -Iinclude -I/android/public-kernel/linux-next/arch/powerpc/include/uapi -Iarch/powerpc/include/generated/uapi -I/android/public-kernel/linux-next/include/uapi -Iinclude/generated/uapi -include /android/public-kernel/linux-next/include/linux/kconfig.h -D__KERNEL__ -I/android/public-kernel/linux-next/arch/powerpc -Iarch/powerpc -D__ASSEMBLY__ -I/android/public-kernel/linux-next/arch/powerpc -Iarch/powerpc -Wa,-maltivec -gdwarf-2 -c -o arch/powerpc/kernel/head_64.o /android/public-kernel/linux-next/arch/powerpc/kernel/head_64.S

(head_64.S includes exceptions-64.S)

Yep it's a known problem but no one has bothered to fix it since it doesn't happen in a config that anyone cares about like pseries_defconfig and ppc64_defconfig. We've been moving code around in this area a lot recently hence the breakage.

It should be fixed though. Patches welcome. :-)

Mikey

author
#2 lore raw
Quoted 6 lines · Michael Neuling

Yep it's a known problem but no one has bothered to fix it since it doesn't happen in a config that anyone cares about like pseries_defconfig and ppc64_defconfig. We've been moving code around in this area a lot recently hence the breakage.

It should be fixed though. Patches welcome. :-)

thanks, and I should try, and very glad to try.

:-) :-)

excuse me, I try to provide related patch within this month (2013-03-31), is it ok ? the reason is:
I am not familiar with ppc assembly code, neither ppc kernel,
so need additional time resource.
(originally, I worked for x86(_64) core dump analysing for kernel and user programs)

thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
author
#3 lore raw

Hello All:

summary:
the root cause is no enough room in exception area (0x5500 -- 0x7000).

it is caused by the patches "for saving/restre PPR":
they consumed much space of this area (0x5500 -- 0x7000). for pseries_defconfig and ppc64_defconfig, it is still ok. but for allmodconfig and "some additional config", it will cause issue.

the solving patch "Make room in exception vector area" can make room larger.
it can let "some additional config" ok.
but for allmodconfig, it is still not enough.

details
reason:
it is caused by:
commit number: 13e7a8e846c2ea38a552b986ea49332f965bbb7a commit number: 44e9309f1f357794b7ae93d5f3e3e6f11d2b8a7f
they are "for saving/restore PPR"
by Haren Myneni <[email protected]> Thu, 6 Dec 2012 compiling result:
pseries_defconfig: pass (cpu for POWER7)
ppc64_defconfig: pass (cpu for POWER7)
allmodconfig: failed (cpu for POWER7)

analysing:
solving patch:
------------------------------------------------------------------
commit number: 61383407677aef05928541a00678591abea2d84c
Author: Benjamin Herrenschmidt <[email protected]>
Date: Thu Jan 10 17:44:19 2013 +1100

powerpc: Make room in exception vector area

The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with some configurations. Fix that by moving some hash management code out of that region as it doesn't need to be that close to the call sites (isn't accessed using conditional branches).
------------------------------------------------------------------

but for allmodconfig (not only for "some configurations"):
it really can reduce much overflow bytes,
(maybe from hundreds bytes to dozens bytes)
but still not enough (still content overflow bytes)

additional trying:
after del CONFIG_VSX and CONFIG_PPC_970_NAP in allmodconfig,
(will reduce dozens bytes in the region .0x5500 -- .0x7000)
it can pass compiling (not overflow).

next:
I am sorry:
I am not quite familiar with the detail features of powerpc. it seems I am not the suitable member to continue trying.

I prefer Benjamin to continue trying (just like what he has done).

if Benjamin will not do it (e.g. maybe no time to do)
I should continue: "make additional room in exception vector area".
(if get no reply within a week: before 2013-03-28, I should continue)

welcome any members' (especially Benjamin) suggestions or completions.

thanks.

:-)

Quoted 20 lines · Chen Gang
Quoted 6 lines · Michael Neuling

Yep it's a known problem but no one has bothered to fix it since it doesn't happen in a config that anyone cares about like pseries_defconfig and ppc64_defconfig. We've been moving code around in this area a lot recently hence the breakage.

It should be fixed though. Patches welcome. :-)

thanks, and I should try, and very glad to try.

:-) :-)

excuse me, I try to provide related patch within this month (2013-03-31), is it ok ? the reason is:
I am not familiar with ppc assembly code, neither ppc kernel,
so need additional time resource.
(originally, I worked for x86(_64) core dump analysing for kernel and user programs)

thanks.

Signature · 3 lines
Chen Gang

Asianux Corporation
#4 lore raw

it seems:
only move slb_miss_realmode to the end, can fix this issue without negative effect.

arch/powerpc/kernel/exceptions-64s.S +72 -72
index 200afa5..56bd923 100644
@@ -1066,78 +1066,6 @@ unrecov_user_slb:
 #endif /* __DISABLED__ */
 
 
-/*
- * r13 points to the PACA, r9 contains the saved CR,
- * r12 contain the saved SRR1, SRR0 is still ready for return
- * r3 has the faulting address
- * r9 - r13 are saved in paca->exslb.
- * r3 is saved in paca->slb_r3
- * We assume we aren't going to take any exceptions during this procedure.
- */
-_GLOBAL(slb_miss_realmode)
-	mflr	r10
-#ifdef CONFIG_RELOCATABLE
-	mtctr	r11
-#endif
-
-	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
-	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
-
-	bl	.slb_allocate_realmode
-
-	/* All done -- return from exception. */
-
-	ld	r10,PACA_EXSLB+EX_LR(r13)
-	ld	r3,PACA_EXSLB+EX_R3(r13)
-	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
-
-	mtlr	r10
-
-	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
-	beq-	2f
-
-.machine	push
-.machine	"power4"
-	mtcrf	0x80,r9
-	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
-.machine	pop
-
-	RESTORE_PPR_PACA(PACA_EXSLB, r9)
-	ld	r9,PACA_EXSLB+EX_R9(r13)
-	ld	r10,PACA_EXSLB+EX_R10(r13)
-	ld	r11,PACA_EXSLB+EX_R11(r13)
-	ld	r12,PACA_EXSLB+EX_R12(r13)
-	ld	r13,PACA_EXSLB+EX_R13(r13)
-	rfid
-	b	.	/* prevent speculative execution */
-
-2:	mfspr	r11,SPRN_SRR0
-	ld	r10,PACAKBASE(r13)
-	LOAD_HANDLER(r10,unrecov_slb)
-	mtspr	SPRN_SRR0,r10
-	ld	r10,PACAKMSR(r13)
-	mtspr	SPRN_SRR1,r10
-	rfid
-	b	.
-
-unrecov_slb:
-	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
-	DISABLE_INTS
-	bl	.save_nvgprs
-1:	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.unrecoverable_exception
-	b	1b
-
-
-#ifdef CONFIG_PPC_970_NAP
-power4_fixup_nap:
-	andc	r9,r9,r10
-	std	r9,TI_LOCAL_FLAGS(r11)
-	ld	r10,_LINK(r1)		/* make idle task do the */
-	std	r10,_NIP(r1)		/* equivalent of a blr */
-	blr
-#endif
-
 	.align	7
 	.globl alignment_common
 alignment_common:
@@ -1336,6 +1264,78 @@ _GLOBAL(opal_mc_secondary_handler)
 
 
 /*
+ * r13 points to the PACA, r9 contains the saved CR,
+ * r12 contain the saved SRR1, SRR0 is still ready for return
+ * r3 has the faulting address
+ * r9 - r13 are saved in paca->exslb.
+ * r3 is saved in paca->slb_r3
+ * We assume we aren't going to take any exceptions during this procedure.
+ */
+_GLOBAL(slb_miss_realmode)
+	mflr	r10
+#ifdef CONFIG_RELOCATABLE
+	mtctr	r11
+#endif
+
+	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
+	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
+
+	bl	.slb_allocate_realmode
+
+	/* All done -- return from exception. */
+
+	ld	r10,PACA_EXSLB+EX_LR(r13)
+	ld	r3,PACA_EXSLB+EX_R3(r13)
+	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
+
+	mtlr	r10
+
+	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
+	beq-	2f
+
+.machine	push
+.machine	"power4"
+	mtcrf	0x80,r9
+	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
+.machine	pop
+
+	RESTORE_PPR_PACA(PACA_EXSLB, r9)
+	ld	r9,PACA_EXSLB+EX_R9(r13)
+	ld	r10,PACA_EXSLB+EX_R10(r13)
+	ld	r11,PACA_EXSLB+EX_R11(r13)
+	ld	r12,PACA_EXSLB+EX_R12(r13)
+	ld	r13,PACA_EXSLB+EX_R13(r13)
+	rfid
+	b	.	/* prevent speculative execution */
+
+2:	mfspr	r11,SPRN_SRR0
+	ld	r10,PACAKBASE(r13)
+	LOAD_HANDLER(r10,unrecov_slb)
+	mtspr	SPRN_SRR0,r10
+	ld	r10,PACAKMSR(r13)
+	mtspr	SPRN_SRR1,r10
+	rfid
+	b	.
+
+unrecov_slb:
+	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
+	DISABLE_INTS
+	bl	.save_nvgprs
+1:	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.unrecoverable_exception
+	b	1b
+
+
+#ifdef CONFIG_PPC_970_NAP
+power4_fixup_nap:
+	andc	r9,r9,r10
+	std	r9,TI_LOCAL_FLAGS(r11)
+	ld	r10,_LINK(r1)		/* make idle task do the */
+	std	r10,_NIP(r1)		/* equivalent of a blr */
+	blr
+#endif
+
+/*
  * Hash table stuff
  */
 	.align	7
Quoted 97 lines · Chen Gang

Hello All:

summary:
the root cause is no enough room in exception area (0x5500 -- 0x7000).

it is caused by the patches "for saving/restre PPR":
they consumed much space of this area (0x5500 -- 0x7000). for pseries_defconfig and ppc64_defconfig, it is still ok. but for allmodconfig and "some additional config", it will cause issue.

the solving patch "Make room in exception vector area" can make room larger.
it can let "some additional config" ok.
but for allmodconfig, it is still not enough.

details
reason:
it is caused by:
commit number: 13e7a8e846c2ea38a552b986ea49332f965bbb7a commit number: 44e9309f1f357794b7ae93d5f3e3e6f11d2b8a7f
they are "for saving/restore PPR"
by Haren Myneni <[email protected]> Thu, 6 Dec 2012 compiling result:
pseries_defconfig: pass (cpu for POWER7)
ppc64_defconfig: pass (cpu for POWER7)
allmodconfig: failed (cpu for POWER7)

analysing:
solving patch:
------------------------------------------------------------------
commit number: 61383407677aef05928541a00678591abea2d84c
Author: Benjamin Herrenschmidt <[email protected]>
Date: Thu Jan 10 17:44:19 2013 +1100

powerpc: Make room in exception vector area

The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with some configurations. Fix that by moving some hash management code out of that region as it doesn't need to be that close to the call sites (isn't accessed using conditional branches).
------------------------------------------------------------------

but for allmodconfig (not only for "some configurations"):
it really can reduce much overflow bytes,
(maybe from hundreds bytes to dozens bytes)
but still not enough (still content overflow bytes)

additional trying:
after del CONFIG_VSX and CONFIG_PPC_970_NAP in allmodconfig,
(will reduce dozens bytes in the region .0x5500 -- .0x7000)
it can pass compiling (not overflow).

next:
I am sorry:
I am not quite familiar with the detail features of powerpc. it seems I am not the suitable member to continue trying.

I prefer Benjamin to continue trying (just like what he has done).

if Benjamin will not do it (e.g. maybe no time to do)
I should continue: "make additional room in exception vector area".
(if get no reply within a week: before 2013-03-28, I should continue)

welcome any members' (especially Benjamin) suggestions or completions.

thanks.

:-)

Quoted 20 lines · Chen Gang
Quoted 6 lines · Michael Neuling

Yep it's a known problem but no one has bothered to fix it since it doesn't happen in a config that anyone cares about like pseries_defconfig and ppc64_defconfig. We've been moving code around in this area a lot recently hence the breakage.

It should be fixed though. Patches welcome. :-)

thanks, and I should try, and very glad to try.

:-) :-)

excuse me, I try to provide related patch within this month (2013-03-31), is it ok ? the reason is:
I am not familiar with ppc assembly code, neither ppc kernel,
so need additional time resource.
(originally, I worked for x86(_64) core dump analysing for kernel and user programs)

thanks.

Signature · 3 lines
Chen Gang

Flying Transformer
#5 lore raw
Quoted 2 lines · Chen Gang F T

it seems:
only move slb_miss_realmode to the end, can fix this issue without negative effect.

Thanks. I'm currently on vacation, I'll have a closer look when I'm back unless Stephen or Paulus wants to shoot that to Linus while I'm away.

Cheers,
Ben.

Quoted 265 lines
arch/powerpc/kernel/exceptions-64s.S +72 -72
index 200afa5..56bd923 100644
@@ -1066,78 +1066,6 @@ unrecov_user_slb:
 #endif /* __DISABLED__ */
 
 
-/*
- * r13 points to the PACA, r9 contains the saved CR,
- * r12 contain the saved SRR1, SRR0 is still ready for return
- * r3 has the faulting address
- * r9 - r13 are saved in paca->exslb.
- * r3 is saved in paca->slb_r3
- * We assume we aren't going to take any exceptions during this procedure.
- */
-_GLOBAL(slb_miss_realmode)
-	mflr	r10
-#ifdef CONFIG_RELOCATABLE
-	mtctr	r11
-#endif
-
-	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
-	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
-
-	bl	.slb_allocate_realmode
-
-	/* All done -- return from exception. */
-
-	ld	r10,PACA_EXSLB+EX_LR(r13)
-	ld	r3,PACA_EXSLB+EX_R3(r13)
-	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
-
-	mtlr	r10
-
-	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
-	beq-	2f
-
-.machine	push
-.machine	"power4"
-	mtcrf	0x80,r9
-	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
-.machine	pop
-
-	RESTORE_PPR_PACA(PACA_EXSLB, r9)
-	ld	r9,PACA_EXSLB+EX_R9(r13)
-	ld	r10,PACA_EXSLB+EX_R10(r13)
-	ld	r11,PACA_EXSLB+EX_R11(r13)
-	ld	r12,PACA_EXSLB+EX_R12(r13)
-	ld	r13,PACA_EXSLB+EX_R13(r13)
-	rfid
-	b	.	/* prevent speculative execution */
-
-2:	mfspr	r11,SPRN_SRR0
-	ld	r10,PACAKBASE(r13)
-	LOAD_HANDLER(r10,unrecov_slb)
-	mtspr	SPRN_SRR0,r10
-	ld	r10,PACAKMSR(r13)
-	mtspr	SPRN_SRR1,r10
-	rfid
-	b	.
-
-unrecov_slb:
-	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
-	DISABLE_INTS
-	bl	.save_nvgprs
-1:	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.unrecoverable_exception
-	b	1b
-
-
-#ifdef CONFIG_PPC_970_NAP
-power4_fixup_nap:
-	andc	r9,r9,r10
-	std	r9,TI_LOCAL_FLAGS(r11)
-	ld	r10,_LINK(r1)		/* make idle task do the */
-	std	r10,_NIP(r1)		/* equivalent of a blr */
-	blr
-#endif
-
 	.align	7
 	.globl alignment_common
 alignment_common:
@@ -1336,6 +1264,78 @@ _GLOBAL(opal_mc_secondary_handler)
 
 
 /*
+ * r13 points to the PACA, r9 contains the saved CR,
+ * r12 contain the saved SRR1, SRR0 is still ready for return
+ * r3 has the faulting address
+ * r9 - r13 are saved in paca->exslb.
+ * r3 is saved in paca->slb_r3
+ * We assume we aren't going to take any exceptions during this procedure.
+ */
+_GLOBAL(slb_miss_realmode)
+	mflr	r10
+#ifdef CONFIG_RELOCATABLE
+	mtctr	r11
+#endif
+
+	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
+	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
+
+	bl	.slb_allocate_realmode
+
+	/* All done -- return from exception. */
+
+	ld	r10,PACA_EXSLB+EX_LR(r13)
+	ld	r3,PACA_EXSLB+EX_R3(r13)
+	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
+
+	mtlr	r10
+
+	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
+	beq-	2f
+
+.machine	push
+.machine	"power4"
+	mtcrf	0x80,r9
+	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
+.machine	pop
+
+	RESTORE_PPR_PACA(PACA_EXSLB, r9)
+	ld	r9,PACA_EXSLB+EX_R9(r13)
+	ld	r10,PACA_EXSLB+EX_R10(r13)
+	ld	r11,PACA_EXSLB+EX_R11(r13)
+	ld	r12,PACA_EXSLB+EX_R12(r13)
+	ld	r13,PACA_EXSLB+EX_R13(r13)
+	rfid
+	b	.	/* prevent speculative execution */
+
+2:	mfspr	r11,SPRN_SRR0
+	ld	r10,PACAKBASE(r13)
+	LOAD_HANDLER(r10,unrecov_slb)
+	mtspr	SPRN_SRR0,r10
+	ld	r10,PACAKMSR(r13)
+	mtspr	SPRN_SRR1,r10
+	rfid
+	b	.
+
+unrecov_slb:
+	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
+	DISABLE_INTS
+	bl	.save_nvgprs
+1:	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.unrecoverable_exception
+	b	1b
+
+
+#ifdef CONFIG_PPC_970_NAP
+power4_fixup_nap:
+	andc	r9,r9,r10
+	std	r9,TI_LOCAL_FLAGS(r11)
+	ld	r10,_LINK(r1)		/* make idle task do the */
+	std	r10,_NIP(r1)		/* equivalent of a blr */
+	blr
+#endif
+
+/*
  * Hash table stuff
  */
 	.align	7
Quoted 97 lines · Chen Gang

Hello All:

summary:
the root cause is no enough room in exception area (0x5500 -- 0x7000).

it is caused by the patches "for saving/restre PPR":
they consumed much space of this area (0x5500 -- 0x7000). for pseries_defconfig and ppc64_defconfig, it is still ok. but for allmodconfig and "some additional config", it will cause issue.

the solving patch "Make room in exception vector area" can make room larger.
it can let "some additional config" ok.
but for allmodconfig, it is still not enough.

details
reason:
it is caused by:
commit number: 13e7a8e846c2ea38a552b986ea49332f965bbb7a commit number: 44e9309f1f357794b7ae93d5f3e3e6f11d2b8a7f
they are "for saving/restore PPR"
by Haren Myneni <[email protected]> Thu, 6 Dec 2012 compiling result:
pseries_defconfig: pass (cpu for POWER7)
ppc64_defconfig: pass (cpu for POWER7)
allmodconfig: failed (cpu for POWER7)

analysing:
solving patch:
------------------------------------------------------------------
commit number: 61383407677aef05928541a00678591abea2d84c
Author: Benjamin Herrenschmidt <[email protected]>
Date: Thu Jan 10 17:44:19 2013 +1100

powerpc: Make room in exception vector area

The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with some configurations. Fix that by moving some hash management code out of that region as it doesn't need to be that close to the call sites (isn't accessed using conditional branches).
------------------------------------------------------------------

but for allmodconfig (not only for "some configurations"):
it really can reduce much overflow bytes,
(maybe from hundreds bytes to dozens bytes)
but still not enough (still content overflow bytes)

additional trying:
after del CONFIG_VSX and CONFIG_PPC_970_NAP in allmodconfig,
(will reduce dozens bytes in the region .0x5500 -- .0x7000)
it can pass compiling (not overflow).

next:
I am sorry:
I am not quite familiar with the detail features of powerpc. it seems I am not the suitable member to continue trying.

I prefer Benjamin to continue trying (just like what he has done).

if Benjamin will not do it (e.g. maybe no time to do)
I should continue: "make additional room in exception vector area".
(if get no reply within a week: before 2013-03-28, I should continue)

welcome any members' (especially Benjamin) suggestions or completions.

thanks.

:-)

Quoted 20 lines · Chen Gang
Quoted 6 lines · Michael Neuling

Yep it's a known problem but no one has bothered to fix it since it doesn't happen in a config that anyone cares about like pseries_defconfig and ppc64_defconfig. We've been moving code around in this area a lot recently hence the breakage.

It should be fixed though. Patches welcome. :-)

thanks, and I should try, and very glad to try.

:-) :-)

excuse me, I try to provide related patch within this month (2013-03-31), is it ok ? the reason is:
I am not familiar with ppc assembly code, neither ppc kernel,
so need additional time resource.
(originally, I worked for x86(_64) core dump analysing for kernel and user programs)

thanks.

author
#6 lore raw
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 2 lines · Chen Gang F T
Quoted 2 lines

it seems:
only move slb_miss_realmode to the end, can fix this issue without negative effect.

Thanks. I'm currently on vacation, I'll have a closer look when I'm back unless Stephen or Paulus wants to shoot that to Linus while I'm away.

ok, I prefer to wait you back to have a closer look.

thanks.

:-)

Quoted 3 lines

Cheers,
Ben.

Signature · 3 lines
Chen Gang

Asianux Corporation
#7 lore raw
In reply to Chen Gang F T
Quoted 3 lines · Chen Gang F T

=20
it seems:
only move slb_miss_realmode to the end, can fix this issue without ne=

gative effect.

So this works but uncovers a new bug.

Stuart: if you apply this patch allmodconfig now gets this build error on linux-next.

arch/powerpc/kernel/built-in.o: In function `restore_pblist_ptr':
ftrace.c:(.toc+0xd78): undefined reference to epapr_ev_idle_start' ftrace.c:(.toc+0xd88): undefined reference to epapr_ev_idle' make[1]: *** [vmlinux] Error 1

Reverting your patch below fixes this:

commit f070986a07e514e3b4fc4aef6551b8dffcb19287
Author: Stuart Yoder <[email protected]>
Date: Fri Feb 8 13:22:56 2013 -0600

powerpc: Add paravirt idle loop for 64-bit Book-E

Should we revert your patch or can you send a fix? This is currently broken in linux-next (at least next-20130321).

Mikey

arch/powerpc/kernel/e=

Quoted 4 lines

=20
=20
=20

arch/powerpc/kernel/e= renamed from arch/powerpc/kernel/exceptions-64s.S +0 -0

xceptions-64s.S

Quoted 6 lines

index 200afa5..56bd923 100644

arch/powerpc/kernel/exceptions-64s.S +0 -0
@@ -1066,78 +1066,6 @@ unrecov_user_slb:
 #endif /* __DISABLED__ */

=20=20

Quoted 8 lines

=20=20
-/*
- * r13 points to the PACA, r9 contains the saved CR,
- * r12 contain the saved SRR1, SRR0 is still ready for return
- * r3 has the faulting address
- * r9 - r13 are saved in paca->exslb.
- * r3 is saved in paca->slb_r3
- * We assume we aren't going to take any exceptions during this procedur=

e.

Quoted 70 lines

- */

arch/powerpc/kernel/exceptions-64s.S +0 -64
-_GLOBAL(slb_miss_realmode)
-	mflr	r10
-#ifdef CONFIG_RELOCATABLE
-	mtctr	r11
-#endif
-
-	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
-	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
-
-	bl	.slb_allocate_realmode
-
-	/* All done -- return from exception. */
-
-	ld	r10,PACA_EXSLB+EX_LR(r13)
-	ld	r3,PACA_EXSLB+EX_R3(r13)
-	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
-
-	mtlr	r10
-
-	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
-	beq-	2f
-
-.machine	push
-.machine	"power4"
-	mtcrf	0x80,r9
-	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
-.machine	pop
-
-	RESTORE_PPR_PACA(PACA_EXSLB, r9)
-	ld	r9,PACA_EXSLB+EX_R9(r13)
-	ld	r10,PACA_EXSLB+EX_R10(r13)
-	ld	r11,PACA_EXSLB+EX_R11(r13)
-	ld	r12,PACA_EXSLB+EX_R12(r13)
-	ld	r13,PACA_EXSLB+EX_R13(r13)
-	rfid
-	b	.	/* prevent speculative execution */
-
-2:	mfspr	r11,SPRN_SRR0
-	ld	r10,PACAKBASE(r13)
-	LOAD_HANDLER(r10,unrecov_slb)
-	mtspr	SPRN_SRR0,r10
-	ld	r10,PACAKMSR(r13)
-	mtspr	SPRN_SRR1,r10
-	rfid
-	b	.
-
-unrecov_slb:
-	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
-	DISABLE_INTS
-	bl	.save_nvgprs
-1:	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.unrecoverable_exception
-	b	1b
-
-
-#ifdef CONFIG_PPC_970_NAP
-power4_fixup_nap:
-	andc	r9,r9,r10
-	std	r9,TI_LOCAL_FLAGS(r11)
-	ld	r10,_LINK(r1)		/* make idle task do the */
-	std	r10,_NIP(r1)		/* equivalent of a blr */
-	blr
-#endif
-
 	.align	7
 	.globl alignment_common
 alignment_common:
@@ -1336,6 +1264,78 @@ _GLOBAL(opal_mc_secondary_handler)

=20=20

Quoted 8 lines

=20=20
/*
+ * r13 points to the PACA, r9 contains the saved CR,
+ * r12 contain the saved SRR1, SRR0 is still ready for return
+ * r3 has the faulting address
+ * r9 - r13 are saved in paca->exslb.
+ * r3 is saved in paca->slb_r3
+ * We assume we aren't going to take any exceptions during this procedur=

e.

Quoted 69 lines

+ */

arch/powerpc/kernel/exceptions-64s.S +65 -0
+_GLOBAL(slb_miss_realmode)
+	mflr	r10
+#ifdef CONFIG_RELOCATABLE
+	mtctr	r11
+#endif
+
+	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
+	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
+
+	bl	.slb_allocate_realmode
+
+	/* All done -- return from exception. */
+
+	ld	r10,PACA_EXSLB+EX_LR(r13)
+	ld	r3,PACA_EXSLB+EX_R3(r13)
+	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
+
+	mtlr	r10
+
+	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
+	beq-	2f
+
+.machine	push
+.machine	"power4"
+	mtcrf	0x80,r9
+	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
+.machine	pop
+
+	RESTORE_PPR_PACA(PACA_EXSLB, r9)
+	ld	r9,PACA_EXSLB+EX_R9(r13)
+	ld	r10,PACA_EXSLB+EX_R10(r13)
+	ld	r11,PACA_EXSLB+EX_R11(r13)
+	ld	r12,PACA_EXSLB+EX_R12(r13)
+	ld	r13,PACA_EXSLB+EX_R13(r13)
+	rfid
+	b	.	/* prevent speculative execution */
+
+2:	mfspr	r11,SPRN_SRR0
+	ld	r10,PACAKBASE(r13)
+	LOAD_HANDLER(r10,unrecov_slb)
+	mtspr	SPRN_SRR0,r10
+	ld	r10,PACAKMSR(r13)
+	mtspr	SPRN_SRR1,r10
+	rfid
+	b	.
+
+unrecov_slb:
+	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
+	DISABLE_INTS
+	bl	.save_nvgprs
+1:	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.unrecoverable_exception
+	b	1b
+
+
+#ifdef CONFIG_PPC_970_NAP
+power4_fixup_nap:
+	andc	r9,r9,r10
+	std	r9,TI_LOCAL_FLAGS(r11)
+	ld	r10,_LINK(r1)		/* make idle task do the */
+	std	r10,_NIP(r1)		/* equivalent of a blr */
+	blr
+#endif
+
+/*
  * Hash table stuff
  */
 	.align	7
Quoted 12 lines

=20
=20

Quoted 9 lines · Chen Gang

Hello All:
=20
summary:
the root cause is no enough room in exception area (0x5500 -- 0x7000).
=20
it is caused by the patches "for saving/restre PPR":
they consumed much space of this area (0x5500 -- 0x7000). for pseries_defconfig and ppc64_defconfig, it is still ok. but for allmodconfig and "some additional config", it will cause is=

sue.

Quoted 2 lines
Quoted 2 lines

=20
the solving patch "Make room in exception vector area" can make room =

larger.

Quoted 45 lines
Quoted 45 lines

it can let "some additional config" ok.
but for allmodconfig, it is still not enough.
=20
=20
details
reason:
it is caused by:
commit number: 13e7a8e846c2ea38a552b986ea49332f965bbb7a commit number: 44e9309f1f357794b7ae93d5f3e3e6f11d2b8a7f
they are "for saving/restore PPR"
by Haren Myneni <[email protected]> Thu, 6 Dec 2012 compiling result:
pseries_defconfig: pass (cpu for POWER7)
ppc64_defconfig: pass (cpu for POWER7)
allmodconfig: failed (cpu for POWER7)
=20
analysing:

    solving patch:
      ------------------------------------------------------------------
      commit number: 61383407677aef05928541a00678591abea2d84c
      Author: Benjamin Herrenschmidt <[email protected]>
      Date:   Thu Jan 10 17:44:19 2013 +1100

=20
powerpc: Make room in exception vector area
=20=20=20=20=20
The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with some configurations. Fix that by moving some hash management code out of that region as it doesn't need to be that close to the call sites (isn't accessed using conditional branches).
------------------------------------------------------------------
=20
but for allmodconfig (not only for "some configurations"):
it really can reduce much overflow bytes,
(maybe from hundreds bytes to dozens bytes)
but still not enough (still content overflow bytes)
=20
additional trying:
after del CONFIG_VSX and CONFIG_PPC_970_NAP in allmodconfig,
(will reduce dozens bytes in the region .0x5500 -- .0x7000)
it can pass compiling (not overflow).
=20
=20
next:
I am sorry:

Quoted 8 lines
Quoted 8 lines

I am not quite familiar with the detail features of powerpc. it seems I am not the suitable member to continue trying.
=20
I prefer Benjamin to continue trying (just like what he has done).
=20
if Benjamin will not do it (e.g. maybe no time to do)
I should continue: "make additional room in exception vector area".
(if get no reply within a week: before 2013-03-28, I should conti=

nue)

Quoted 11 lines
Quoted 11 lines

=20
=20
=20
welcome any members' (especially Benjamin) suggestions or completions.
=20
thanks.
=20
:-)
=20
=20
On 2013=E5=B9=B403=E6=9C=8815=E6=97=A5 13:14, Chen Gang wrote:

Quoted 1 line
Quoted 1 line
Quoted 1 line

=E4=BA=8E 2013=E5=B9=B403=E6=9C=8815=E6=97=A5 12:52, Michael Neuling =

=E5=86=99=E9=81=93:

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Yep it's a known problem but no one has bothered to fix it since it doesn't happen in a config that anyone cares about like pseries_defconfig and ppc64_defconfig. We've been moving code around=

in

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines

this area a lot recently hence the breakage.

It should be fixed though. Patches welcome. :-)

thanks, and I should try, and very glad to try.

:-) :-)

excuse me, I try to provide related patch within this month (2013-03=

-31), is it ok ?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

the reason is:
I am not familiar with ppc assembly code, neither ppc kernel, so need additional time resource.
(originally, I worked for x86(_64) core dump analysing for kerne=

l and user programs)

Quoted 12 lines
Quoted 5 lines
Quoted 3 lines

thanks.

=20
=20

=20
=20
--=20
Chen Gang
=20
Flying Transformer
=20

#8 lore raw
Quoted 32 lines

-----Original Message-----
From: Michael Neuling [mailto:[email protected]]
Sent: Thursday, March 21, 2013 6:21 PM
To: Chen Gang F T; Yoder Stuart-B08248; Kumar Gala
Cc: Chen Gang; Benjamin Herrenschmidt; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [Suggestion] PowerPC: kernel: cross compiling issue with allmodconfig

Quoted 3 lines · Chen Gang F T

it seems:
only move slb_miss_realmode to the end, can fix this issue without negative effect.

So this works but uncovers a new bug.

Stuart: if you apply this patch allmodconfig now gets this build error on linux-next.

arch/powerpc/kernel/built-in.o: In function `restore_pblist_ptr':
ftrace.c:(.toc+0xd78): undefined reference to epapr_ev_idle_start' ftrace.c:(.toc+0xd88): undefined reference to epapr_ev_idle' make[1]: *** [vmlinux] Error 1

Reverting your patch below fixes this:

commit f070986a07e514e3b4fc4aef6551b8dffcb19287
Author: Stuart Yoder <[email protected]>
Date: Fri Feb 8 13:22:56 2013 -0600

Quoted 7 lines

powerpc: Add paravirt idle loop for 64-bit Book-E

Should we revert your patch or can you send a fix? This is currently broken in linux-next (at least next-20130321).

Sent a patch that resolves this. Not completely happy with it because of the added #ifdefs, but not sure how else to resolve
this. allmodconfig is creating config combinations that don't
happen in a normal build (at least currently)-- 64-bit build that enables EPAPR_PARAVIRT but not PPC_BOOK3E_64.

Stuart ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

#9 lore raw
Quoted 3 lines · On 2013年03月23日 03:17, Yoder Stuart-B08248 wrote:

allmodconfig is creating config combinations that don't happen in a normal build (at least currently)-- 64-bit build that enables EPAPR_PARAVIRT but not PPC_BOOK3E_64.

if it should not happen.
can we add dependency to let it will never happen in any config combinations ?
let allmodconfig can not create this config combinamtions:
"64-bit build that enables EPAPR_PARAVIRT but not PPC_BOOK3E_64".

thanks.

Signature · 3 lines
Chen Gang

Flying Transformer
#10 lore raw
In reply to Chen Gang
Quoted 9 lines · Chen Gang

Hello All:
=20
summary:
the root cause is no enough room in exception area (0x5500 -- 0x7000).
=20
it is caused by the patches "for saving/restre PPR":
they consumed much space of this area (0x5500 -- 0x7000). for pseries_defconfig and ppc64_defconfig, it is still ok. but for allmodconfig and "some additional config", it will cause issu=

e.

Quoted 2 lines

=20
the solving patch "Make room in exception vector area" can make room la=

rger.

Quoted 45 lines

it can let "some additional config" ok.
but for allmodconfig, it is still not enough.
=20
=20
details
reason:
it is caused by:
commit number: 13e7a8e846c2ea38a552b986ea49332f965bbb7a commit number: 44e9309f1f357794b7ae93d5f3e3e6f11d2b8a7f
they are "for saving/restore PPR"
by Haren Myneni <[email protected]> Thu, 6 Dec 2012 compiling result:
pseries_defconfig: pass (cpu for POWER7)
ppc64_defconfig: pass (cpu for POWER7)
allmodconfig: failed (cpu for POWER7)
=20
analysing:

    solving patch:
      ------------------------------------------------------------------
      commit number: 61383407677aef05928541a00678591abea2d84c
      Author: Benjamin Herrenschmidt <[email protected]>
      Date:   Thu Jan 10 17:44:19 2013 +1100

=20
powerpc: Make room in exception vector area
=20=20=20=20=20
The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with some configurations. Fix that by moving some hash management code out of that region as it doesn't need to be that close to the call sites (isn't accessed using conditional branches).
------------------------------------------------------------------
=20
but for allmodconfig (not only for "some configurations"):
it really can reduce much overflow bytes,
(maybe from hundreds bytes to dozens bytes)
but still not enough (still content overflow bytes)
=20
additional trying:
after del CONFIG_VSX and CONFIG_PPC_970_NAP in allmodconfig,
(will reduce dozens bytes in the region .0x5500 -- .0x7000)
it can pass compiling (not overflow).
=20
=20
next:
I am sorry:

Quoted 8 lines

I am not quite familiar with the detail features of powerpc. it seems I am not the suitable member to continue trying.
=20
I prefer Benjamin to continue trying (just like what he has done).
=20
if Benjamin will not do it (e.g. maybe no time to do)
I should continue: "make additional room in exception vector area".
(if get no reply within a week: before 2013-03-28, I should continu=

e)

Quoted 4 lines

=20
=20
=20
welcome any members' (especially Benjamin) suggestions or completions.

This is great, thanks a lot.=20=20

If you want this to be picked up by the maintainer, you'll need to add your signed-off-by.

The signed-off-by is to indicate that your happy for it to be included and that you're legally allowed to do so. See
http://gerrit.googlecode.com/svn/documentation/2.0/user-signedoffby.html
for more info.

Mikey

Quoted 8 lines

=20
thanks.
=20
:-)
=20
=20

Quoted 1 line · Chen Gang

=E4=BA=8E 2013=E5=B9=B403=E6=9C=8815=E6=97=A5 12:52, Michael Neuling =

=E5=86=99=E9=81=93:

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Yep it's a known problem but no one has bothered to fix it since it doesn't happen in a config that anyone cares about like pseries_defconfig and ppc64_defconfig. We've been moving code around =

in

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines

this area a lot recently hence the breakage.

It should be fixed though. Patches welcome. :-)

=20
thanks, and I should try, and very glad to try.
=20
:-) :-)
=20
excuse me, I try to provide related patch within this month (2013-03-=

31), is it ok ?

Quoted 4 lines
Quoted 4 lines

the reason is:
I am not familiar with ppc assembly code, neither ppc kernel, so need additional time resource.
(originally, I worked for x86(_64) core dump analysing for kernel=

and user programs)

Quoted 10 lines
Quoted 3 lines

=20
thanks.
=20

=20
=20
--=20
Chen Gang
=20
Asianux Corporation
=20

author
#11 lore raw
Quoted 11 lines · Michael Neuling

This is great, thanks a lot.

If you want this to be picked up by the maintainer, you'll need to add your signed-off-by.

The signed-off-by is to indicate that your happy for it to be included and that you're legally allowed to do so. See
http://gerrit.googlecode.com/svn/documentation/2.0/user-signedoffby.html
for more info.

Mikey

thanks, too.
I prefer Benjamin to have a closer look for my fixing. if pass his checking, I will send a patch.
(he is on vacation, now, and he will check it when he is back).

Regards

Signature · 3 lines
Chen Gang

Asianux Corporation
#12 lore raw
Quoted 12 lines · Chen Gang
Quoted 11 lines · Michael Neuling

This is great, thanks a lot.=20=20
=20
If you want this to be picked up by the maintainer, you'll need to add your signed-off-by.
=20
The signed-off-by is to indicate that your happy for it to be included and that you're legally allowed to do so. See
http://gerrit.googlecode.com/svn/documentation/2.0/user-signedoffby.html
for more info.
=20
Mikey

Quoted 5 lines

=20
thanks, too.
I prefer Benjamin to have a closer look for my fixing. if pass his checking, I will send a patch.
(he is on vacation, now, and he will check it when he is back).

benh asked paulus or sfr to send in while he was away.

So please send your signed off by now (if you can), or someone is going to rewrite it, sent it upstream bypassing you.

Mikey

author
#13 lore raw
Quoted 9 lines · Michael Neuling

benh asked paulus or sfr to send in while he was away.

So please send your signed off by now (if you can), or someone is going to rewrite it, sent it upstream bypassing you.

Mikey

thanks, I will send patch now.

:-)

Signature · 3 lines
Chen Gang

Asianux Corporation
author
#14 lore raw

PATCH 1/1 PowerPC:kernel: make additional room in exception vector area

In reply to Michael Neuling

The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with allmodconfig. Fix that by moving slb_miss_realmode code out of that region as it doesn't need to be that close to the call sites (it is a _GLOBAL function)

---
 arch/powerpc/kernel/exceptions-64s.S |  144 +++++++++++++++++-----------------
 1 files changed, 72 insertions(+), 72 deletions(-)
arch/powerpc/kernel/exceptions-64s.S +72 -72
index 200afa5..56bd923 100644
@@ -1066,78 +1066,6 @@ unrecov_user_slb:
 #endif /* __DISABLED__ */
 
 
-/*
- * r13 points to the PACA, r9 contains the saved CR,
- * r12 contain the saved SRR1, SRR0 is still ready for return
- * r3 has the faulting address
- * r9 - r13 are saved in paca->exslb.
- * r3 is saved in paca->slb_r3
- * We assume we aren't going to take any exceptions during this procedure.
- */
-_GLOBAL(slb_miss_realmode)
-	mflr	r10
-#ifdef CONFIG_RELOCATABLE
-	mtctr	r11
-#endif
-
-	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
-	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
-
-	bl	.slb_allocate_realmode
-
-	/* All done -- return from exception. */
-
-	ld	r10,PACA_EXSLB+EX_LR(r13)
-	ld	r3,PACA_EXSLB+EX_R3(r13)
-	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
-
-	mtlr	r10
-
-	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
-	beq-	2f
-
-.machine	push
-.machine	"power4"
-	mtcrf	0x80,r9
-	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
-.machine	pop
-
-	RESTORE_PPR_PACA(PACA_EXSLB, r9)
-	ld	r9,PACA_EXSLB+EX_R9(r13)
-	ld	r10,PACA_EXSLB+EX_R10(r13)
-	ld	r11,PACA_EXSLB+EX_R11(r13)
-	ld	r12,PACA_EXSLB+EX_R12(r13)
-	ld	r13,PACA_EXSLB+EX_R13(r13)
-	rfid
-	b	.	/* prevent speculative execution */
-
-2:	mfspr	r11,SPRN_SRR0
-	ld	r10,PACAKBASE(r13)
-	LOAD_HANDLER(r10,unrecov_slb)
-	mtspr	SPRN_SRR0,r10
-	ld	r10,PACAKMSR(r13)
-	mtspr	SPRN_SRR1,r10
-	rfid
-	b	.
-
-unrecov_slb:
-	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
-	DISABLE_INTS
-	bl	.save_nvgprs
-1:	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.unrecoverable_exception
-	b	1b
-
-
-#ifdef CONFIG_PPC_970_NAP
-power4_fixup_nap:
-	andc	r9,r9,r10
-	std	r9,TI_LOCAL_FLAGS(r11)
-	ld	r10,_LINK(r1)		/* make idle task do the */
-	std	r10,_NIP(r1)		/* equivalent of a blr */
-	blr
-#endif
-
 	.align	7
 	.globl alignment_common
 alignment_common:
@@ -1336,6 +1264,78 @@ _GLOBAL(opal_mc_secondary_handler)
 
 
 /*
+ * r13 points to the PACA, r9 contains the saved CR,
+ * r12 contain the saved SRR1, SRR0 is still ready for return
+ * r3 has the faulting address
+ * r9 - r13 are saved in paca->exslb.
+ * r3 is saved in paca->slb_r3
+ * We assume we aren't going to take any exceptions during this procedure.
+ */
+_GLOBAL(slb_miss_realmode)
+	mflr	r10
+#ifdef CONFIG_RELOCATABLE
+	mtctr	r11
+#endif
+
+	stw	r9,PACA_EXSLB+EX_CCR(r13)	/* save CR in exc. frame */
+	std	r10,PACA_EXSLB+EX_LR(r13)	/* save LR */
+
+	bl	.slb_allocate_realmode
+
+	/* All done -- return from exception. */
+
+	ld	r10,PACA_EXSLB+EX_LR(r13)
+	ld	r3,PACA_EXSLB+EX_R3(r13)
+	lwz	r9,PACA_EXSLB+EX_CCR(r13)	/* get saved CR */
+
+	mtlr	r10
+
+	andi.	r10,r12,MSR_RI	/* check for unrecoverable exception */
+	beq-	2f
+
+.machine	push
+.machine	"power4"
+	mtcrf	0x80,r9
+	mtcrf	0x01,r9		/* slb_allocate uses cr0 and cr7 */
+.machine	pop
+
+	RESTORE_PPR_PACA(PACA_EXSLB, r9)
+	ld	r9,PACA_EXSLB+EX_R9(r13)
+	ld	r10,PACA_EXSLB+EX_R10(r13)
+	ld	r11,PACA_EXSLB+EX_R11(r13)
+	ld	r12,PACA_EXSLB+EX_R12(r13)
+	ld	r13,PACA_EXSLB+EX_R13(r13)
+	rfid
+	b	.	/* prevent speculative execution */
+
+2:	mfspr	r11,SPRN_SRR0
+	ld	r10,PACAKBASE(r13)
+	LOAD_HANDLER(r10,unrecov_slb)
+	mtspr	SPRN_SRR0,r10
+	ld	r10,PACAKMSR(r13)
+	mtspr	SPRN_SRR1,r10
+	rfid
+	b	.
+
+unrecov_slb:
+	EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB)
+	DISABLE_INTS
+	bl	.save_nvgprs
+1:	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.unrecoverable_exception
+	b	1b
+
+
+#ifdef CONFIG_PPC_970_NAP
+power4_fixup_nap:
+	andc	r9,r9,r10
+	std	r9,TI_LOCAL_FLAGS(r11)
+	ld	r10,_LINK(r1)		/* make idle task do the */
+	std	r10,_NIP(r1)		/* equivalent of a blr */
+	blr
+#endif
+
+/*
  * Hash table stuff
  */
 	.align	7
Signature · 1 line
1.7.7.6
#15 lore raw

Re: [PATCH] PowerPC:kernel: make additional room in exception vector area

Hi all,

Quoted 10 lines · On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang <[email protected]> wrote:

The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with allmodconfig. Fix that by moving slb_miss_realmode code out of that region as it doesn't need to be that close to the call sites (it is a _GLOBAL function)

---
 arch/powerpc/kernel/exceptions-64s.S |  144 +++++++++++++++++-----------------
 1 files changed, 72 insertions(+), 72 deletions(-)

Thanks, Chen,

I have applied this to linux-next today and pending the builds overnight, will send it to Linus tomorrow or Wednesday.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
author
#16 lore raw

Re: [PATCH] PowerPC:kernel: make additional room in exception vector area

Quoted 9 lines · Stephen Rothwell

Hi all,

Quoted 6 lines · On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang <[email protected]> wrote:
Quoted 6 lines

The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with allmodconfig. Fix that by moving slb_miss_realmode code out of that region as it doesn't need to be that close to the call sites (it is a _GLOBAL function)

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
---
 arch/powerpc/kernel/exceptions-64s.S |  144 +++++++++++++++++-----------------
 1 files changed, 72 insertions(+), 72 deletions(-)

Thanks, Chen,

I have applied this to linux-next today and pending the builds overnight, will send it to Linus tomorrow or Wednesday.

thanks.

:-)

Signature · 3 lines
Chen Gang

Asianux Corporation
#17 lore raw

Re: [PATCH] PowerPC:kernel: make additional room in exception vector area

In reply to Stephen Rothwell
Quoted 14 lines · Stephen Rothwell

Hi all,

Quoted 10 lines · On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang <[email protected]> wrote:

The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with allmodconfig. Fix that by moving slb_miss_realmode code out of that region as it doesn't need to be that close to the call sites (it is a _GLOBAL function)

---
 arch/powerpc/kernel/exceptions-64s.S |  144 +++++++++++++++++-----------------
 1 files changed, 72 insertions(+), 72 deletions(-)
Quoted 4 lines

Thanks, Chen,

I have applied this to linux-next today and pending the builds overnight, will send it to Linus tomorrow or Wednesday.

sfr,

FYI you're gonna need this one also to make allmodconfig work.

http://patchwork.ozlabs.org/patch/230244/

Mikey