Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-07-04 Thread Michael Ellerman
On Tue, 31 May 2022 16:59:36 +1000, Michael Ellerman wrote: > The ppc_inst_as_str() macro tries to make printing variable length, > aka "prefixed", instructions convenient. It mostly succeeds, but it does > hide an on-stack buffer, which triggers stack protector. > > More problematically it

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-06-03 Thread Segher Boessenkool
Hi! On Fri, Jun 03, 2022 at 03:03:05PM +1000, Jordan Niethe wrote: > On Thu, Jun 2, 2022 at 6:49 PM Segher Boessenkool > wrote: > > On Thu, Jun 02, 2022 at 01:01:04PM +1000, Jordan Niethe wrote: > > > > What about the more fundamental thing? Have the order of the two halves > > > > of a

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-06-02 Thread Jordan Niethe
On Thu, Jun 2, 2022 at 6:49 PM Segher Boessenkool wrote: > > On Thu, Jun 02, 2022 at 01:01:04PM +1000, Jordan Niethe wrote: > > > What about the more fundamental thing? Have the order of the two halves > > > of a prefixed insn as ulong not depend on endianness? It really is two > > > opcodes,

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-06-02 Thread Segher Boessenkool
On Thu, Jun 02, 2022 at 01:01:04PM +1000, Jordan Niethe wrote: > > What about the more fundamental thing? Have the order of the two halves > > of a prefixed insn as ulong not depend on endianness? It really is two > > opcodes, and the prefixed one is first, always, even in LE. > The reason would

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-06-01 Thread Jordan Niethe
On Thu, Jun 2, 2022 at 2:22 AM Segher Boessenkool wrote: > > On Wed, Jun 01, 2022 at 08:43:01PM +1000, Michael Ellerman wrote: > > Segher Boessenkool writes: > > > Hi! > > > > > > On Tue, May 31, 2022 at 04:59:36PM +1000, Michael Ellerman wrote: > > >> More problematically it doesn't compile at

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-06-01 Thread Segher Boessenkool
On Wed, Jun 01, 2022 at 08:43:01PM +1000, Michael Ellerman wrote: > Segher Boessenkool writes: > > Hi! > > > > On Tue, May 31, 2022 at 04:59:36PM +1000, Michael Ellerman wrote: > >> More problematically it doesn't compile at all with GCC 12, due to the > >> fact that it returns the char buffer

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-06-01 Thread Michael Ellerman
Segher Boessenkool writes: > Hi! > > On Tue, May 31, 2022 at 04:59:36PM +1000, Michael Ellerman wrote: >> More problematically it doesn't compile at all with GCC 12, due to the >> fact that it returns the char buffer declared inside the macro: > > It returns a pointer to a buffer on stack. It is

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-05-31 Thread Bagas Sanjaya
On 6/1/22 10:03, Bagas Sanjaya wrote: >> >> Reported-by: Bagas Sanjaya >> Reported-by: Petr Mladek >> Signed-off-by: Michael Ellerman > > The arch/powerpc/kernel/trace/ftrace.c builds successfully, however > there is also other build error for which I have reported at [1]. > > Thanks. > >

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-05-31 Thread Bagas Sanjaya
Hi, On Tue, May 31, 2022 at 04:59:36PM +1000, Michael Ellerman wrote: > The ppc_inst_as_str() macro tries to make printing variable length, > aka "prefixed", instructions convenient. It mostly succeeds, but it does > hide an on-stack buffer, which triggers stack protector. > > More

Re: [PATCH] powerpc/64: Drop ppc_inst_as_str()

2022-05-31 Thread Segher Boessenkool
Hi! On Tue, May 31, 2022 at 04:59:36PM +1000, Michael Ellerman wrote: > More problematically it doesn't compile at all with GCC 12, due to the > fact that it returns the char buffer declared inside the macro: It returns a pointer to a buffer on stack. It is not valid C to access that buffer