Re: [PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-12-07 Thread Michael Ellerman
On Tue, 21 Nov 2023 10:54:36 +1100, Michael Ellerman wrote: > Building with GCC 13 (which has -array-bounds enabled) there are several > warnings in sstep.c along the lines of: > > In function ‘do_byte_reverse’, > inlined from ‘do_vec_load’ at arch/powerpc/lib/sstep.c:691:3, >

Re: [PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-11-24 Thread Naveen N Rao
On Thu, Nov 23, 2023 at 09:17:54AM -0600, Gustavo A. R. Silva wrote: > > > > To be honest I don't know how paranoid we want to get, we could end up > > > putting WARN's all over the kernel :) > > > > > > In this case I guess if the size is too large we overflow the buffer on > > > the kernel

Re: [PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-11-23 Thread Gustavo A. R. Silva
To be honest I don't know how paranoid we want to get, we could end up putting WARN's all over the kernel :) In this case I guess if the size is too large we overflow the buffer on the kernel stack, so we should at least check the size. But does it need a WARN? I'm not sure. If we had a case

Re: [PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-11-22 Thread Naveen N Rao
On Wed, Nov 22, 2023 at 03:44:07PM +1100, Michael Ellerman wrote: > Naveen N Rao writes: > > On Tue, Nov 21, 2023 at 10:54:36AM +1100, Michael Ellerman wrote: > >> Building with GCC 13 (which has -array-bounds enabled) there are several > > > > Thanks, gcc13 indeed helps reproduce the warnings. >

Re: [PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-11-21 Thread Michael Ellerman
Naveen N Rao writes: > On Tue, Nov 21, 2023 at 10:54:36AM +1100, Michael Ellerman wrote: >> Building with GCC 13 (which has -array-bounds enabled) there are several > > Thanks, gcc13 indeed helps reproduce the warnings. Actually that part is no longer true since 0da6e5fd6c37 ("gcc: disable

Re: [PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-11-21 Thread Naveen N Rao
On Tue, Nov 21, 2023 at 10:54:36AM +1100, Michael Ellerman wrote: > Building with GCC 13 (which has -array-bounds enabled) there are several Thanks, gcc13 indeed helps reproduce the warnings. > warnings in sstep.c along the lines of: > > In function ‘do_byte_reverse’, > inlined from

Re: [PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-11-20 Thread Gustavo A. R. Silva
On 11/20/23 17:54, Michael Ellerman wrote: Building with GCC 13 (which has -array-bounds enabled) there are several warnings in sstep.c along the lines of: In function ‘do_byte_reverse’, inlined from ‘do_vec_load’ at arch/powerpc/lib/sstep.c:691:3, inlined from

[PATCH] powerpc/lib: Avoid array bounds warnings in vec ops

2023-11-20 Thread Michael Ellerman
Building with GCC 13 (which has -array-bounds enabled) there are several warnings in sstep.c along the lines of: In function ‘do_byte_reverse’, inlined from ‘do_vec_load’ at arch/powerpc/lib/sstep.c:691:3, inlined from ‘emulate_loadstore’ at arch/powerpc/lib/sstep.c:3439:9: