Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-26 Thread Segher Boessenkool
On Tue, Mar 26, 2019 at 08:18:07PM +1100, Michael Ellerman wrote: > Segher Boessenkool writes: > > On Mon, Mar 25, 2019 at 11:33:56PM +1100, Michael Ellerman wrote: > >> Segher Boessenkool writes: > >> > On Fri, Mar 22, 2019 at 11:37:24PM +1100, Michael Ellerman wrote: > >> >> + clrldi r6,

Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-26 Thread Michael Ellerman
Segher Boessenkool writes: > On Mon, Mar 25, 2019 at 11:33:56PM +1100, Michael Ellerman wrote: >> Segher Boessenkool writes: >> > On Fri, Mar 22, 2019 at 11:37:24PM +1100, Michael Ellerman wrote: >> >> + clrldi r6,r4,(64-12) // r6 = r4 & 0xfff >> > >> > You can just write >> > rlwinm r6,r4,0

Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-25 Thread Segher Boessenkool
On Mon, Mar 25, 2019 at 11:33:56PM +1100, Michael Ellerman wrote: > Segher Boessenkool writes: > > On Fri, Mar 22, 2019 at 11:37:24PM +1100, Michael Ellerman wrote: > >> + clrldi r6,r4,(64-12) // r6 = r4 & 0xfff > > > > You can just write > > rlwinm r6,r4,0,0x0fff > > > if that is clearer?

Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-25 Thread Michael Ellerman
Segher Boessenkool writes: > On Fri, Mar 22, 2019 at 11:37:24PM +1100, Michael Ellerman wrote: >> .Lcmp_rest_lt8bytes: >> -/* Here we have only less than 8 bytes to compare with. at least s1 >> - * Address is aligned with 8 bytes. >> - * The next double words are load and shift right

Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-24 Thread Chandan Rajendra
On Friday, March 22, 2019 6:07:24 PM IST Michael Ellerman wrote: > Chandan reported that fstests' generic/026 test hit a crash: > > BUG: Unable to handle kernel data access at 0xc0062ac4 > Faulting instruction address: 0xc0092240 > Oops: Kernel access of bad area, sig: 11 [#1

Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-24 Thread Chandan Rajendra
On Friday, March 22, 2019 6:07:24 PM IST Michael Ellerman wrote: > Chandan reported that fstests' generic/026 test hit a crash: > > BUG: Unable to handle kernel data access at 0xc0062ac4 > Faulting instruction address: 0xc0092240 > Oops: Kernel access of bad area, sig: 11 [#1

Re: [PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-22 Thread Segher Boessenkool
On Fri, Mar 22, 2019 at 11:37:24PM +1100, Michael Ellerman wrote: > .Lcmp_rest_lt8bytes: > - /* Here we have only less than 8 bytes to compare with. at least s1 > - * Address is aligned with 8 bytes. > - * The next double words are load and shift right with appropriate > - * bit

[PATCH v3] powerpc/64: Fix memcmp reading past the end of src/dest

2019-03-22 Thread Michael Ellerman
Chandan reported that fstests' generic/026 test hit a crash: BUG: Unable to handle kernel data access at 0xc0062ac4 Faulting instruction address: 0xc0092240 Oops: Kernel access of bad area, sig: 11 [#1] LE SMP NR_CPUS=2048 DEBUG_PAGEALLOC NUMA pSeries CPU: 0 PID: 27828 Co