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

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

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] powerpc: Avoid panic during boot due to divide by zero in init_cache_info()

2017-03-04 Thread Benjamin Herrenschmidt
On Sun, 2017-03-05 at 11:25 +1100, Benjamin Herrenschmidt wrote: > On Sun, 2017-03-05 at 10:54 +1100, Anton Blanchard wrote: > > From: Anton Blanchard > > > > I see a panic in early boot when building with a recent gcc > > toolchain. > > The issue is a divide by zero, which is

Re: [PATCH] powerpc: Avoid panic during boot due to divide by zero in init_cache_info()

2017-03-04 Thread Benjamin Herrenschmidt
On Sun, 2017-03-05 at 10:54 +1100, Anton Blanchard wrote: > From: Anton Blanchard > > I see a panic in early boot when building with a recent gcc > toolchain. > The issue is a divide by zero, which is undefined. Older toolchains > let us get away with it: Maybe we should panic

[PATCH] powerpc: Avoid panic during boot due to divide by zero in init_cache_info()

2017-03-04 Thread Anton Blanchard
From: Anton Blanchard I see a panic in early boot when building with a recent gcc toolchain. The issue is a divide by zero, which is undefined. Older toolchains let us get away with it: int foo(int a) { return a / 0; } foo: li 9,0 divw 3,3,9 extsw 3,3

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 @@

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

[PATCH v3] powerpc/xics: Work around limitations of OPAL XICS priority handling

2017-03-04 Thread Michael Ellerman
From: Balbir Singh The CPPR (Current Processor Priority Register) of a XICS interrupt presentation controller contains a value N, such that only interrupts with a priority "more favoured" than N will be received by the CPU, where "more favoured" means "less than". So if