Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-18 Thread Linus Torvalds
On Mon, Jul 18, 2022 at 3:12 PM Segher Boessenkool wrote: > > Assembler language is unforgiving. It isn't easy to write, and most > mistakes will not be diagnosed. If the assmbler language makes it > easier to read the code, that makes it more likely correct code will be > written, and that

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-18 Thread Segher Boessenkool
On Mon, Jul 18, 2022 at 12:06:52PM -0700, Linus Torvalds wrote: > On Sun, Jul 17, 2022 at 9:41 PM Michael Ellerman wrote: > > > li 4,254 #, > > > > Here we load 254 into r4, which is the 2nd parameter to memset (c). > > I love how even powerpc people know that "4" is

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-18 Thread Linus Torvalds
On Sun, Jul 17, 2022 at 9:41 PM Michael Ellerman wrote: > > > li 4,254 #, > > Here we load 254 into r4, which is the 2nd parameter to memset (c). I love how even powerpc people know that "4" is bogus, and have to make it clear that it means "r4". I don't understand why

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-18 Thread Segher Boessenkool
On Mon, Jul 18, 2022 at 01:52:38PM +1000, Michael Ellerman wrote: > Segher Boessenkool writes: > > Can't we simply have a small simple implementation of these functions in > > arch/powerpc/boot/? This stuff is not performance-critical, and this is > > not the first time we hit these problems. >

RE: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-18 Thread David Laight
From: Michael Ellerman > Sent: 18 July 2022 05:41 ... > So we're memsetting all of args to 254, not zero. > > That's happening because allmodconfig with gcc 12 enables > CONFIG_INIT_STACK_ALL_PATTERN, whereas gcc 11 doesn't. I can't help feeling it would be better if that generated a call to a

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Michael Ellerman
Sudip Mukherjee writes: > On Thu, Jul 14, 2022 at 9:55 AM Sudip Mukherjee (Codethink) > wrote: >> >> Hi All, >> >> Not sure if it has been reported before but the latest mainline kernel >> branch fails to build for powerpc allmodconfig with gcc-12 and the error is: >> >> Error: External symbol

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Michael Ellerman
Segher Boessenkool writes: > On Sun, Jul 17, 2022 at 07:44:22AM -0700, Linus Torvalds wrote: >> On Sun, Jul 17, 2022 at 2:13 AM Sudip Mukherjee >> wrote: >> > I was trying to check it. With gcc-11 the assembly code generated is >> > not using memset, but using __memset. >> > But with gcc-12, I

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Linus Torvalds
On Sun, Jul 17, 2022 at 2:49 PM Segher Boessenkool wrote: > > > I can *kind of* see the logic that when you do a whole struct > > assignment, it turns into a "memcpy" without regard for volatile > > members. You're not actually accessing the volatile members in some > > particular order, so the

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Segher Boessenkool
On Sun, Jul 17, 2022 at 02:11:52PM -0700, Linus Torvalds wrote: > On Sun, Jul 17, 2022 at 2:00 PM Segher Boessenkool > wrote: > > Calling mem* on a volatile object (or a struct containing one) is not > > valid. I opened gcc.gnu.org/PR106335. > > Well, that very quickly got marked as a duplicate

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Linus Torvalds
On Sun, Jul 17, 2022 at 2:00 PM Segher Boessenkool wrote: > > Calling mem* on a volatile object (or a struct containing one) is not > valid. I opened gcc.gnu.org/PR106335. Well, that very quickly got marked as a duplicate of a decade-old bug. So I guess we shouldn't expect this to be fixed any

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Segher Boessenkool
On Sun, Jul 17, 2022 at 01:29:07PM -0700, Linus Torvalds wrote: > On Sun, Jul 17, 2022 at 1:25 PM Sudip Mukherjee > wrote: > > > > And the generated assembly still has the memset for "struct prom_args". > > Strange. That smells like a compiler bug to me. > > But I can't read powerpc assembly

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Linus Torvalds
On Sun, Jul 17, 2022 at 1:38 PM Sudip Mukherjee wrote: > > I have also tried adding volatile to all the members of that struct. :( Can you read the code to figure otu what the memcpy is all about? Or maybe there is something that disables 'volatile' with pre-processor hackery. Because a

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Sudip Mukherjee
On Sun, Jul 17, 2022 at 9:29 PM Linus Torvalds wrote: > > On Sun, Jul 17, 2022 at 1:25 PM Sudip Mukherjee > wrote: > > > > And the generated assembly still has the memset for "struct prom_args". > > Strange. That smells like a compiler bug to me. Both gcc-12 and clang gives this error. > > But

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Linus Torvalds
On Sun, Jul 17, 2022 at 1:25 PM Sudip Mukherjee wrote: > > And the generated assembly still has the memset for "struct prom_args". Strange. That smells like a compiler bug to me. But I can't read powerpc assembly code - it's been too many years, and even back when I did read it I hated how the

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Sudip Mukherjee
On Sun, Jul 17, 2022 at 3:44 PM Linus Torvalds wrote: > > On Sun, Jul 17, 2022 at 2:13 AM Sudip Mukherjee > wrote: > > > > I was trying to check it. With gcc-11 the assembly code generated is > > not using memset, but using __memset. > > But with gcc-12, I can see the assembly code is using

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Segher Boessenkool
On Sun, Jul 17, 2022 at 07:44:22AM -0700, Linus Torvalds wrote: > On Sun, Jul 17, 2022 at 2:13 AM Sudip Mukherjee > wrote: > > I was trying to check it. With gcc-11 the assembly code generated is > > not using memset, but using __memset. > > But with gcc-12, I can see the assembly code is using

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Linus Torvalds
On Sun, Jul 17, 2022 at 2:13 AM Sudip Mukherjee wrote: > > I was trying to check it. With gcc-11 the assembly code generated is > not using memset, but using __memset. > But with gcc-12, I can see the assembly code is using memset. One > example from the assembly: You could try making the 'args'

Re: mainline build failure of powerpc allmodconfig for prom_init_check

2022-07-17 Thread Sudip Mukherjee
On Thu, Jul 14, 2022 at 9:55 AM Sudip Mukherjee (Codethink) wrote: > > Hi All, > > Not sure if it has been reported before but the latest mainline kernel > branch fails to build for powerpc allmodconfig with gcc-12 and the error is: > > Error: External symbol 'memset' referenced from prom_init.c