Skip to contentSkip to conversation

powerpc: Fix "attempt to move .org backwards" error (again)

PATCH In review Guenter Roeck 2 participants 8 messages May 10, 2014 – May 12, 2014 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix "attempt to move .org backwards" error (again)

Commit 4e243b7 (powerpc: Fix "attempt to move .org backwards" error) fixes the allyesconfig build by moving machine_check_common to a different location. While this fixes most of the errors, both allmodconfig and allyesconfig still fail as follows.

arch/powerpc/kernel/exceptions-64s.S:1315: Error: attempt to move .org backwards

Fix by moving machine_check_common after the offending address.

---
This fixes the build error, but unfortunately I don't have a system to test the resulting image.

 arch/powerpc/kernel/exceptions-64s.S | 49 ++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 25 deletions(-)
arch/powerpc/kernel/exceptions-64s.S +24 -25
index 3afd391..25398be 100644
@@ -1138,31 +1138,6 @@ unrecov_user_slb:
 
 #endif /* __DISABLED__ */
 
-
-	/*
-	 * Machine check is different because we use a different
-	 * save area: PACA_EXMC instead of PACA_EXGEN.
-	 */
-	.align	7
-	.globl machine_check_common
-machine_check_common:
-
-	mfspr	r10,SPRN_DAR
-	std	r10,PACA_EXGEN+EX_DAR(r13)
-	mfspr	r10,SPRN_DSISR
-	stw	r10,PACA_EXGEN+EX_DSISR(r13)
-	EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
-	FINISH_NAP
-	DISABLE_INTS
-	ld	r3,PACA_EXGEN+EX_DAR(r13)
-	lwz	r4,PACA_EXGEN+EX_DSISR(r13)
-	std	r3,_DAR(r1)
-	std	r4,_DSISR(r1)
-	bl	.save_nvgprs
-	addi	r3,r1,STACK_FRAME_OVERHEAD
-	bl	.machine_check_exception
-	b	.ret_from_except
-
 	.align	7
 	.globl alignment_common
 alignment_common:
@@ -1328,6 +1303,30 @@ fwnmi_data_area:
 initial_stab:
 	.space	4096
 
+	/*
+	 * Machine check is different because we use a different
+	 * save area: PACA_EXMC instead of PACA_EXGEN.
+	 */
+	.align	7
+	.globl machine_check_common
+machine_check_common:
+
+	mfspr	r10,SPRN_DAR
+	std	r10,PACA_EXGEN+EX_DAR(r13)
+	mfspr	r10,SPRN_DSISR
+	stw	r10,PACA_EXGEN+EX_DSISR(r13)
+	EXCEPTION_PROLOG_COMMON(0x200, PACA_EXMC)
+	FINISH_NAP
+	DISABLE_INTS
+	ld	r3,PACA_EXGEN+EX_DAR(r13)
+	lwz	r4,PACA_EXGEN+EX_DSISR(r13)
+	std	r3,_DAR(r1)
+	std	r4,_DSISR(r1)
+	bl	.save_nvgprs
+	addi	r3,r1,STACK_FRAME_OVERHEAD
+	bl	.machine_check_exception
+	b	.ret_from_except
+
 #ifdef CONFIG_PPC_POWERNV
 _GLOBAL(opal_mc_secondary_handler)
 	HMT_MEDIUM_PPR_DISCARD
Signature · 1 line
1.9.1
#1 lore raw
Quoted 8 lines · Guenter Roeck

Commit 4e243b7 (powerpc: Fix "attempt to move .org backwards" error) fixes the allyesconfig build by moving machine_check_common to a different location. While this fixes most of the errors, both allmodconfig and allyesconfig still fail as follows.

arch/powerpc/kernel/exceptions-64s.S:1315: Error: attempt to move .org backwards

Fix by moving machine_check_common after the offending address.

This suffers from the same problem as previous attempts, on some of my test configs I get:

arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0xb0): relocation truncated to fit: R_PPC64_REL14 against `.text'+1c90 make[1]: *** [vmlinux] Error 1
make: *** [sub-make] Error 2

IE, it breaks currently working configs.

So we need to move more things around and I haven't had a chance to sort it out.

Cheers,
Ben.

#2 lore raw
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 8 lines · Guenter Roeck

Commit 4e243b7 (powerpc: Fix "attempt to move .org backwards" error) fixes the allyesconfig build by moving machine_check_common to a different location. While this fixes most of the errors, both allmodconfig and allyesconfig still fail as follows.

arch/powerpc/kernel/exceptions-64s.S:1315: Error: attempt to move .org backwards

Fix by moving machine_check_common after the offending address.

Quoted 9 lines

This suffers from the same problem as previous attempts, on some of my test configs I get:

arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0xb0): relocation truncated to fit: R_PPC64_REL14 against `.text'+1c90 make[1]: *** [vmlinux] Error 1
make: *** [sub-make] Error 2

IE, it breaks currently working configs.

Oh well, it was worth a try. Can you give me an example for a failing configuration ?

Thanks,
Guenter

#3 lore raw
Quoted 2 lines · Guenter Roeck

Oh well, it was worth a try. Can you give me an example for a failing configuration ?

My g5 config which is close to g5_defconfig with PR KVM enabled.

In any case, see my other messages. I'm waiting for all my test builders to come back and if it's clear I'll post a new patch.

Cheers,
Ben.

#4 lore raw
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 2 lines · Guenter Roeck

Oh well, it was worth a try. Can you give me an example for a failing configuration ?

My g5 config which is close to g5_defconfig with PR KVM enabled.

In any case, see my other messages. I'm waiting for all my test builders to come back and if it's clear I'll post a new patch.

I'll be more than happy to wait. Let me know if I can test something.

Thanks,
Guenter

#5 lore raw
Quoted 11 lines · Guenter Roeck
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 2 lines · Guenter Roeck

Oh well, it was worth a try. Can you give me an example for a failing configuration ?

My g5 config which is close to g5_defconfig with PR KVM enabled.

In any case, see my other messages. I'm waiting for all my test builders to come back and if it's clear I'll post a new patch.

I'll be more than happy to wait. Let me know if I can test something.

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

Cheers,
Ben.

#6 lore raw
In reply to Benjamin Herrenschmidt
Quoted 13 lines · Benjamin Herrenschmidt
Quoted 8 lines · Guenter Roeck

Commit 4e243b7 (powerpc: Fix "attempt to move .org backwards" error) fixes the allyesconfig build by moving machine_check_common to a different location. While this fixes most of the errors, both allmodconfig and allyesconfig still fail as follows.

arch/powerpc/kernel/exceptions-64s.S:1315: Error: attempt to move .org backwards

Fix by moving machine_check_common after the offending address.

This suffers from the same problem as previous attempts, on some of my test configs I get:

Quoted 8 lines

arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0xb0): relocation truncated to fit: R_PPC64_REL14 against `.text'+1c90 make[1]: *** [vmlinux] Error 1
make: *** [sub-make] Error 2

IE, it breaks currently working configs.

So we need to move more things around and I haven't had a chance to sort it out.

Ok, I think I sorted it out for now. It's a mess and likely to break again until we do something more drastic like moving everything that's after 0x8000 to a separate file but for now that will do. Patch on its way, I'll also shoot it to Linus today along with a few other things.

Cheers,
Ben.

#7 lore raw
Quoted 20 lines · Benjamin Herrenschmidt
Quoted 19 lines · Benjamin Herrenschmidt
Quoted 8 lines · Guenter Roeck

Commit 4e243b7 (powerpc: Fix "attempt to move .org backwards" error) fixes the allyesconfig build by moving machine_check_common to a different location. While this fixes most of the errors, both allmodconfig and allyesconfig still fail as follows.

arch/powerpc/kernel/exceptions-64s.S:1315: Error: attempt to move .org backwards

Fix by moving machine_check_common after the offending address.

This suffers from the same problem as previous attempts, on some of my test configs I get:

arch/powerpc/kernel/head_64.o:(__ftr_alt_97+0xb0): relocation truncated to fit: R_PPC64_REL14 against `.text'+1c90 make[1]: *** [vmlinux] Error 1
make: *** [sub-make] Error 2

IE, it breaks currently working configs.

Quoted 8 lines
Quoted 2 lines

So we need to move more things around and I haven't had a chance to sort it out.

Ok, I think I sorted it out for now. It's a mess and likely to break again until we do something more drastic like moving everything that's after 0x8000 to a separate file but for now that will do. Patch on its way, I'll also shoot it to Linus today along with a few other things.

Great, thanks a lot!

Guenter