Re: [PATCH 1/3] futex: remove duplicated code

2017-03-08 Thread H. Peter Anvin
,Thomas Gleixner ,Ingo Molnar ,Chris Zankel ,Max Filippov ,Arnd Bergmann ,x...@kernel.org,linux-al...@vger.kernel.org,linux-snps-...@lists.infradead.org,linux-arm-ker...@lists.infradead.org,linux-hexa...@vger.kernel.org,linux-i...@vger.kernel.org,linux-m...@linux-mips.org,openr...@lists.librecor

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-08 Thread Rob Landley
On 03/04/2017 07:05 AM, Russell King - ARM Linux wrote: > On Fri, Mar 03, 2017 at 01:27:10PM +0100, Jiri Slaby wrote: >> diff --git a/kernel/futex.c b/kernel/futex.c >> index b687cb22301c..c5ff9850952f 100644 >> --- a/kernel/futex.c >> +++ b/kernel/futex.c >> @@ -1457,6 +1457,42 @@ futex_wake(u32 _

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-05 Thread Rich Felker
On Fri, Mar 03, 2017 at 01:27:10PM +0100, Jiri Slaby wrote: > There is code duplicated over all architecture's headers for > futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr, > and comparison of the result. > > Remove this duplication and leave up to the arches only the needed

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-04 Thread H. Peter Anvin
,Chris Metcalf ,Thomas Gleixner ,Ingo Molnar ,Chris Zankel ,Max Filippov ,Arnd Bergmann ,x...@kernel.org,linux-al...@vger.kernel.org,linux-snps-...@lists.infradead.org,linux-arm-ker...@lists.infradead.org,linux-hexa...@vger.kernel.org,linux-i...@vger.kernel.org,linux-m...@linux-mips.org,openr...

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-04 Thread H. Peter Anvin
,Chris Metcalf ,Thomas Gleixner ,Ingo Molnar ,Chris Zankel ,Max Filippov ,Arnd Bergmann ,x...@kernel.org,linux-al...@vger.kernel.org,linux-snps-...@lists.infradead.org,linux-arm-ker...@lists.infradead.org,linux-hexa...@vger.kernel.org,linux-i...@vger.kernel.org,linux-m...@linux-mips.org,openr...

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-04 Thread Stafford Horne
On Sat, Mar 04, 2017 at 11:15:17AM -0800, H. Peter Anvin wrote: > On 03/04/17 05:05, Russell King - ARM Linux wrote: > >> > >> +static int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) > >> +{ > >> + int op = (encoded_op >> 28) & 7; > >> + int cmp = (encoded_op >> 24) & 15; > >> +

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-04 Thread H. Peter Anvin
On 03/04/17 05:05, Russell King - ARM Linux wrote: >> >> +static int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) >> +{ >> +int op = (encoded_op >> 28) & 7; >> +int cmp = (encoded_op >> 24) & 15; >> +int oparg = (encoded_op << 8) >> 20; >> +int cmparg = (encoded_op <<

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-04 Thread Russell King - ARM Linux
On Fri, Mar 03, 2017 at 01:27:10PM +0100, Jiri Slaby wrote: > diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h > index 6795368ad023..cc414382dab4 100644 > --- a/arch/arm/include/asm/futex.h > +++ b/arch/arm/include/asm/futex.h > @@ -128,20 +128,10 @@ futex_atomic_cmpxchg_ina

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-04 Thread Michael Ellerman
Jiri Slaby writes: > There is code duplicated over all architecture's headers for > futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr, > and comparison of the result. > > Remove this duplication and leave up to the arches only the needed > assembly which is now in arch_futex_a

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-03 Thread Chris Metcalf
On 3/3/2017 7:27 AM, Jiri Slaby wrote: There is code duplicated over all architecture's headers for futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr, and comparison of the result. Remove this duplication and leave up to the arches only the needed assembly which is now in arc

Re: [PATCH 1/3] futex: remove duplicated code

2017-03-03 Thread Heiko Carstens
On Fri, Mar 03, 2017 at 01:27:10PM +0100, Jiri Slaby wrote: > There is code duplicated over all architecture's headers for > futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr, > and comparison of the result. > > Remove this duplication and leave up to the arches only the needed

[PATCH 1/3] futex: remove duplicated code

2017-03-03 Thread Jiri Slaby
There is code duplicated over all architecture's headers for futex_atomic_op_inuser. Namely op decoding, access_ok check for uaddr, and comparison of the result. Remove this duplication and leave up to the arches only the needed assembly which is now in arch_futex_atomic_op_inuser. Note that s390