Mass-building defconfigs: many fail with assembler errors

Michael Ellerman mpe at ellerman.id.au
Thu Dec 15 23:47:07 AEDT 2022


Jan-Benedict Glaw <jbglaw at lug-owl.de> writes:
> On Tue, 2022-12-13 14:49:20 +1100, Michael Ellerman <mpe at ellerman.id.au> wrote:
> [...]
>> Both treeboot-akebono.c and treeboot-currituck.c are for 476 so should
>> probably be built with -mcpu=476. eg:
>> 
>> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
>> index d32d95aea5d6..acb6eddace8f 100644
>> --- a/arch/powerpc/boot/Makefile
>> +++ b/arch/powerpc/boot/Makefile
>> @@ -88,8 +88,8 @@ $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440
>>  $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440
>>  $(obj)/cuboot-acadia.o: BOOTCFLAGS += -mcpu=405
>>  $(obj)/treeboot-iss4xx.o: BOOTCFLAGS += -mcpu=405
>> -$(obj)/treeboot-currituck.o: BOOTCFLAGS += -mcpu=405
>> -$(obj)/treeboot-akebono.o: BOOTCFLAGS += -mcpu=405
>> +$(obj)/treeboot-currituck.o: BOOTCFLAGS += -mcpu=476
>> +$(obj)/treeboot-akebono.o: BOOTCFLAGS += -mcpu=476
>>  
>>  # The pre-boot decompressors pull in a lot of kernel headers and other source
>>  # files. This creates a bit of a dependency headache since we need to copy
>
> With this patch applied, it seems this fixes these asm-related builds:
>
> linux-powerpc-bamboo_defconfig
> linux-powerpc-cell_defconfig
> linux-powerpc-ebony_defconfig
> linux-powerpc-katmai_defconfig
> linux-powerpc-ppc44x_defconfig
> linux-powerpc-rainier_defconfig
> linux-powerpc-sam440ep_defconfig
> linux-powerpc-sequoia_defconfig
> linux-powerpc-taishan_defconfig

Thanks.

> ...while three remain unresolved:
>
> linux-powerpc-asp8347_defconfig

OK. Patch below which I believe fixes that.

diff --git a/arch/powerpc/include/asm/reg_fsl_emb.h b/arch/powerpc/include/asm/reg_fsl_emb.h
index a21f529c43d9..8359c06d92d9 100644
--- a/arch/powerpc/include/asm/reg_fsl_emb.h
+++ b/arch/powerpc/include/asm/reg_fsl_emb.h
@@ -12,9 +12,16 @@
 #ifndef __ASSEMBLY__
 /* Performance Monitor Registers */
 #define mfpmr(rn)	({unsigned int rval; \
-			asm volatile("mfpmr %0," __stringify(rn) \
+			asm volatile(".machine push; " \
+				     ".machine e300; " \
+				     "mfpmr %0," __stringify(rn) ";" \
+				     ".machine pop; " \
 				     : "=r" (rval)); rval;})
-#define mtpmr(rn, v)	asm volatile("mtpmr " __stringify(rn) ",%0" : : "r" (v))
+#define mtpmr(rn, v)	asm volatile(".machine push; " \
+				     ".machine e300; " \
+				     "mtpmr " __stringify(rn) ",%0; " \
+				     ".machine pop; " \
+				     : : "r" (v))
 #endif /* __ASSEMBLY__ */
 
 /* Freescale Book E Performance Monitor APU Registers */

> linux-powerpc-mvme5100_defconfig

And another:

diff --git a/arch/powerpc/kernel/epapr_hcalls.S b/arch/powerpc/kernel/epapr_hcalls.S
index 69a912550577..1ed73ab30288 100644
--- a/arch/powerpc/kernel/epapr_hcalls.S
+++ b/arch/powerpc/kernel/epapr_hcalls.S
@@ -21,7 +21,10 @@ _GLOBAL(epapr_ev_idle)
 	ori	r4, r4,_TLF_NAPPING	/* so when we take an exception */
 	PPC_STL	r4, TI_LOCAL_FLAGS(r2)	/* it will return to our caller */
 
+	.machine push
+	.machine booke
 	wrteei	1
+	.machine pop
 
 idle_loop:
 	LOAD_REG_IMMEDIATE(r11, EV_HCALL_TOKEN(EV_IDLE))


Not sure if that's the best solution, but it will at least unblock you
and allow you to actually test GCC which is I assume your goal.

> linux-powerpc-ppc64e_defconfig

TBD.

> Of course I cannot verify the resulting kernel binaries, but I guess
> you'd push this patch.

I don't have the hardware for most of these old boards, but I'll test
what I can, and yes I'd take the patch.

cheers


More information about the Linuxppc-dev mailing list