Re: [PATCH] compiler-gcc.h: Remove ancient workaround for gcc PR 58670

2022-08-25 Thread Uros Bizjak
On Thu, Aug 25, 2022 at 12:30 PM Naveen N. Rao wrote: > > Uros Bizjak wrote: > > The workaround for 'asm goto' miscompilation introduces a compiler > > barrier quirk that inhibits many useful compiler optimizations. For > > example, __try_cmpxchg_user compiles to: > &

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-03-24 Thread Uros Bizjak
On Fri, Mar 24, 2023 at 3:13 PM Mark Rutland wrote: > > On Sun, Mar 05, 2023 at 09:56:19PM +0100, Uros Bizjak wrote: > > Cast _oldp to the type of _ptr to avoid incompatible-pointer-types warning. > > Can you give an example of where we are passing an incompatible pointer? An e

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-03-26 Thread Uros Bizjak
On Fri, Mar 24, 2023 at 5:33 PM Mark Rutland wrote: > > On Fri, Mar 24, 2023 at 04:14:22PM +, Mark Rutland wrote: > > On Fri, Mar 24, 2023 at 04:43:32PM +0100, Uros Bizjak wrote: > > > On Fri, Mar 24, 2023 at 3:13 PM Mark Rutland wrote: > > > > > >

[PATCH 05/10] locking/mips: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Thomas Bogendoerfer Signed-off-by: Uros Bizjak --- arch/mips/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h index 08366b1fd273..b611361a760b

[PATCH 07/10] locking/x86: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: Uros Bizjak --- arch/x86/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/i

[PATCH 02/10] locking/atomic: Add generic try_cmpxchg{,64}_local support

2023-03-05 Thread Uros Bizjak
Add generic support for try_cmpxchg{,64}_local and their falbacks. Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Signed-off-by: Uros Bizjak --- include/linux/atomic/atomic-arch-fallback.h | 24 - include/linux/atomic/atomic-instrumented.h | 20

[PATCH 00/10] locking: Introduce local{,64}_try_cmpxchg

2023-03-05 Thread Uros Bizjak
jlstra Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Ian Rogers Cc: Will Deacon Cc: Boqun Feng Cc: Jiaxun Yang Cc: Jun Yi Uros Bizjak (10): locking/atomic: Add missing cast to try_cmpxchg() fallbacks locking/atomic: Add ge

[PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-03-05 Thread Uros Bizjak
Cast _oldp to the type of _ptr to avoid incompatible-pointer-types warning. Fixes: 29f006fdefe6 ("asm-generic/atomic: Add try_cmpxchg() fallbacks") Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Signed-off-by: Uros Bizjak --- include/linux/atomic/atomic-arch-

[PATCH 03/10] locking/alpha: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Signed-off-by: Uros Bizjak --- arch/alpha/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/alpha/include/asm/local.h b/arch/alpha/include/asm

[PATCH 09/10] locking/x86: Enable local{,64}_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Enable local_try_cmpxchg and also local64_try_cmpxchg for x86_64. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: Uros Bizjak --- arch/x86/include/asm/cmpxchg.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH 10/10] perf/ring_buffer: use local_try_cmpxchg in __perf_output_begin

2023-03-05 Thread Uros Bizjak
is no need to re-read the value in the loop. No functional change intended. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Ian Rogers Signed-off-by: Uros Bizjak --- kernel/events/ring_buffer.c |

[PATCH 04/10] locking/loongarch: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Huacai Chen Cc: WANG Xuerui Cc: Jiaxun Yang Cc: Jun Yi Signed-off-by: Uros Bizjak --- arch/loongarch/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/loongarch/include/asm/local.h b/arch/loongarch

[PATCH 08/10] locking/generic: Wire up local{,64}_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement generic support for local{,64}_try_cmpxchg. Cc: Arnd Bergmann Signed-off-by: Uros Bizjak --- include/asm-generic/local.h | 1 + include/asm-generic/local64.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index

[PATCH 06/10] locking/powerpc: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Signed-off-by: Uros Bizjak Signed-off-by: Uros Bizjak --- arch/powerpc/include/asm/local.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/powerpc

Re: [PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-04-12 Thread Uros Bizjak
On Wed, Apr 12, 2023 at 1:33 PM Peter Zijlstra wrote: > > On Wed, Apr 05, 2023 at 04:17:08PM +0200, Uros Bizjak wrote: > > diff --git a/arch/powerpc/include/asm/local.h > > b/arch/powerpc/include/asm/local.h > > index bc4bd19b7fc2..45492fb5bf22 100644 > > --- a/ar

Re: [PATCH v2 0/5] locking: Introduce local{,64}_try_cmpxchg

2023-04-06 Thread Uros Bizjak
On Thu, Apr 6, 2023 at 10:26 AM David Laight wrote: > > From: Dave Hansen > > Sent: 05 April 2023 17:37 > > > > On 4/5/23 07:17, Uros Bizjak wrote: > > > Add generic and target specific support for local{,64}_try_cmpxchg > > > and wire up support for a

[PATCH v2 4/5] locking/x86: Define arch_try_cmpxchg_local

2023-04-05 Thread Uros Bizjak
t; Signed-off-by: Uros Bizjak --- arch/x86/include/asm/cmpxchg.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h index 94fbe6ae7431..540573f515b7 100644 --- a/arch/x86/include/asm/cmpxchg.h +++ b/arch/x86/include/asm

[PATCH v2 5/5] events: Illustrate the transition to local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
This patch illustrates the transition to local{,64}_try_cmpxchg. It is not intended to be merged as-is. Signed-off-by: Uros Bizjak --- arch/x86/events/core.c | 9 - kernel/events/ring_buffer.c | 5 +++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/events

[PATCH v2 0/5] locking: Introduce local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
Rogers Cc: Will Deacon Cc: Boqun Feng Cc: Jiaxun Yang Cc: Jun Yi Uros Bizjak (5): locking/atomic: Add generic try_cmpxchg{,64}_local support locking/generic: Wire up local{,64}_try_cmpxchg locking/arch: Wire up local_try_cmpxchg locking/x86: Define arch_try_cmpxchg_local event

[PATCH v2 3/5] locking/arch: Wire up local_try_cmpxchg

2023-04-05 Thread Uros Bizjak
Yang Cc: Jun Yi Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: Uros Bizjak --- arch/alpha/include/asm/local.h | 12

[PATCH v2 1/5] locking/atomic: Add generic try_cmpxchg{,64}_local support

2023-04-05 Thread Uros Bizjak
Add generic support for try_cmpxchg{,64}_local and their falbacks. These provides the generic try_cmpxchg_local family of functions from the arch_ prefixed version, also adding explicit instrumentation. Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Signed-off-by: Uros

[PATCH v2 2/5] locking/generic: Wire up local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
and provide additional checking of their input arguments. Cc: Arnd Bergmann Signed-off-by: Uros Bizjak --- include/asm-generic/local.h | 1 + include/asm-generic/local64.h | 12 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/asm-generic/local.h b/include/asm

Re: [PATCH v2 0/5] locking: Introduce local{,64}_try_cmpxchg

2023-04-05 Thread Uros Bizjak
On Wed, Apr 5, 2023 at 6:37 PM Dave Hansen wrote: > > On 4/5/23 07:17, Uros Bizjak wrote: > > Add generic and target specific support for local{,64}_try_cmpxchg > > and wire up support for all targets that use local_t infrastructure. > > I feel like I'm missin

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-04-04 Thread Uros Bizjak
On Mon, Apr 3, 2023 at 12:19 PM Mark Rutland wrote: > > On Sun, Mar 26, 2023 at 09:28:38PM +0200, Uros Bizjak wrote: > > On Fri, Mar 24, 2023 at 5:33 PM Mark Rutland wrote: > > > > > > On Fri, Mar 24, 2023 at 04:14:22PM +, Mark Rutland wrote: > > > >

Re: [PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-04-04 Thread Uros Bizjak
On Tue, Apr 4, 2023 at 3:19 PM Mark Rutland wrote: > > On Tue, Apr 04, 2023 at 02:24:38PM +0200, Uros Bizjak wrote: > > On Mon, Apr 3, 2023 at 12:19 PM Mark Rutland wrote: > > > > > > On Sun, Mar 26, 2023 at 09:28:38PM +0200, Uros Bizjak wrote: > > >