All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: Mass-building defconfigs: many fail with assembler errors
Date: Thu, 15 Dec 2022 23:47:07 +1100	[thread overview]
Message-ID: <87359gkf5g.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20221214144525.pecvb4cmnvth6n62@lug-owl.de>

Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:
> On Tue, 2022-12-13 14:49:20 +1100, Michael Ellerman <mpe@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

      parent reply	other threads:[~2022-12-15 12:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 21:51 Mass-building defconfigs: many fail with assembler errors Jan-Benedict Glaw
2022-12-13  0:26 ` Segher Boessenkool
2022-12-13 10:00   ` Jan-Benedict Glaw
2022-12-14  9:00     ` Jan-Benedict Glaw
2022-12-14 18:36       ` Jan-Benedict Glaw
2022-12-14 20:08         ` Segher Boessenkool
2022-12-15  8:47       ` Jan-Benedict Glaw
2022-12-13  3:49 ` Michael Ellerman
2022-12-13  8:41   ` Jan-Benedict Glaw
2022-12-13 12:23     ` Segher Boessenkool
2022-12-14 14:45   ` Jan-Benedict Glaw
2022-12-15  6:49     ` Christophe Leroy
2022-12-15  6:55       ` Christophe Leroy
2022-12-15 12:47     ` Michael Ellerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87359gkf5g.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=jbglaw@lug-owl.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.