Re: [RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-17 Thread Mathieu Desnoyers
why all these BUG_ON's can't be turned >> into: > > +1 > >> if (WARN_ON(x)) >> return; > > Given that this somewhat MM-related, I'd may be say VM_WARN_ON(). Good point, will do! So I'll do one cleanup patch for vm_unmap_ram(), and I'll modify the new vm_unmap_user_ram(). Thanks, Mathieu > > -ss -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 2:30 PM, rostedt rost...@goodmis.org wrote: > On Wed, 10 Oct 2018 15:19:24 -0400 > Mathieu Desnoyers wrote: > >> + * vm_unmap_user_ram - unmap linear kernel address space set up by >> vm_map_user_ram >> + * @mem: the pointer returned by vm

Re: [RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 2:30 PM, rostedt rost...@goodmis.org wrote: > On Wed, 10 Oct 2018 15:19:24 -0400 > Mathieu Desnoyers wrote: > >> + * vm_unmap_user_ram - unmap linear kernel address space set up by >> vm_map_user_ram >> + * @mem: the pointer returned by vm

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 4:10 AM, Sergey Senozhatsky sergey.senozhatsky.w...@gmail.com wrote: > Hi Mathieu, > > On (10/10/18 15:19), Mathieu Desnoyers wrote: > [..] >> +SYSCALL_DEFINE4(cpu_opv, struct cpu_op __user *, ucpuopv, int, cpuopcnt, >> +

Re: [RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-16 Thread Mathieu Desnoyers
- On Oct 16, 2018, at 4:10 AM, Sergey Senozhatsky sergey.senozhatsky.w...@gmail.com wrote: > Hi Mathieu, > > On (10/10/18 15:19), Mathieu Desnoyers wrote: > [..] >> +SYSCALL_DEFINE4(cpu_opv, struct cpu_op __user *, ucpuopv, int, cpuopcnt, >> +

rseq system call incompletely wired up in microblaze

2018-10-14 Thread Mathieu Desnoyers
system call Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Also, please make sure the tools/testing/selftests/rseq/ tests pass before pushing a commit enabling it for your architecture. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

rseq system call incompletely wired up in microblaze

2018-10-14 Thread Mathieu Desnoyers
system call Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky Also, please make sure the tools/testing/selftests/rseq/ tests pass before pushing a commit enabling it for your architecture. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

[PATCH for 4.19] tracepoint: Fix: tracepoint array element size mismatch

2018-10-13 Thread Mathieu Desnoyers
rc kernels, and should ideally be fixed before the end of the rc cycle. Signed-off-by: Mathieu Desnoyers Acked-by: Ard Biesheuvel Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheu...@linaro.org Cc: Michael Ellerman Cc: Ingo Molnar Cc: Steven Rostedt (VMware) Cc: Ard Biesheuvel

[PATCH for 4.19] tracepoint: Fix: tracepoint array element size mismatch

2018-10-13 Thread Mathieu Desnoyers
rc kernels, and should ideally be fixed before the end of the rc cycle. Signed-off-by: Mathieu Desnoyers Acked-by: Ard Biesheuvel Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheu...@linaro.org Cc: Michael Ellerman Cc: Ingo Molnar Cc: Steven Rostedt (VMware) Cc: Ard Biesheuvel

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-13 Thread Mathieu Desnoyers
- On Oct 13, 2018, at 2:34 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 13, 2018, at 11:24 AM, Ard Biesheuvel ard.biesheu...@linaro.org > wrote: > >> On 12 October 2018 at 23:07, Ard Biesheuvel >> wrote: >>> Hi Mathieu, >&

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-13 Thread Mathieu Desnoyers
- On Oct 13, 2018, at 2:34 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > - On Oct 13, 2018, at 11:24 AM, Ard Biesheuvel ard.biesheu...@linaro.org > wrote: > >> On 12 October 2018 at 23:07, Ard Biesheuvel >> wrote: >>> Hi Mathieu, >&

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-13 Thread Mathieu Desnoyers
- On Oct 13, 2018, at 11:24 AM, Ard Biesheuvel ard.biesheu...@linaro.org wrote: > On 12 October 2018 at 23:07, Ard Biesheuvel wrote: >> Hi Mathieu, >> >> On 12 October 2018 at 22:05, Mathieu Desnoyers >> wrote: >>> commit 46e0c9be206f ("kern

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-13 Thread Mathieu Desnoyers
- On Oct 13, 2018, at 11:24 AM, Ard Biesheuvel ard.biesheu...@linaro.org wrote: > On 12 October 2018 at 23:07, Ard Biesheuvel wrote: >> Hi Mathieu, >> >> On 12 October 2018 at 22:05, Mathieu Desnoyers >> wrote: >>> commit 46e0c9be206f ("kern

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-12 Thread Mathieu Desnoyers
- On Oct 12, 2018, at 4:05 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > commit 46e0c9be206f ("kernel: tracepoints: add support for relative > references") changes the layout of the __tracepoint_ptrs section on > architectures supporting relative reference

Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-12 Thread Mathieu Desnoyers
- On Oct 12, 2018, at 4:05 PM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > commit 46e0c9be206f ("kernel: tracepoints: add support for relative > references") changes the layout of the __tracepoint_ptrs section on > architectures supporting relative reference

[PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-12 Thread Mathieu Desnoyers
epoint_range() implementation. This issue appears in 4.19-rc kernels, and should ideally be fixed before the end of the rc cycle. Signed-off-by: Mathieu Desnoyers Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheu...@linaro.org Cc: Michael Ellerman Cc: Ingo Molnar Cc: Steven Rost

[PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array iteration

2018-10-12 Thread Mathieu Desnoyers
epoint_range() implementation. This issue appears in 4.19-rc kernels, and should ideally be fixed before the end of the rc cycle. Signed-off-by: Mathieu Desnoyers Link: http://lkml.kernel.org/r/20180704083651.24360-7-ard.biesheu...@linaro.org Cc: Michael Ellerman Cc: Ingo Molnar Cc: Steven Rost

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 1:04 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 11/10/18 17:37, Mathieu Desnoyers wrote: >> - On Oct 11, 2018, at 12:20 PM, Szabolcs Nagy szabolcs.n...@arm.com >> wrote: >>> On 11/10/18 16:13, Mathieu Desnoyers wrote: >>>&g

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 1:04 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 11/10/18 17:37, Mathieu Desnoyers wrote: >> - On Oct 11, 2018, at 12:20 PM, Szabolcs Nagy szabolcs.n...@arm.com >> wrote: >>> On 11/10/18 16:13, Mathieu Desnoyers wrote: >>>&g

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 12:20 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 11/10/18 16:13, Mathieu Desnoyers wrote: >> - On Oct 11, 2018, at 6:37 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: >> >>> On 10/10/18 20:19, Mathieu Desnoyers wrote: >>

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 12:20 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 11/10/18 16:13, Mathieu Desnoyers wrote: >> - On Oct 11, 2018, at 6:37 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: >> >>> On 10/10/18 20:19, Mathieu Desnoyers wrote: >>

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 6:37 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 10/10/18 20:19, Mathieu Desnoyers wrote: >> In order to integrate rseq into user-space applications, add a reference >> counter field after the struct rseq TLS ABI so many rseq users can be >>

Re: [RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-11 Thread Mathieu Desnoyers
- On Oct 11, 2018, at 6:37 AM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 10/10/18 20:19, Mathieu Desnoyers wrote: >> In order to integrate rseq into user-space applications, add a reference >> counter field after the struct rseq TLS ABI so many rseq users can be >>

[RFC PATCH for 4.21 08/16] x86: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: "H. Peter Anvin" CC: Ben Maurer CC: Steven Rostedt CC: Josh

[RFC PATCH for 4.21 09/16] powerpc: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: linuxppc-...@lists.ozlabs.org --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/uapi/asm/unistd.

[RFC PATCH for 4.21 03/16] sched: Implement push_task_to_cpu (v2)

2018-10-10 Thread Mathieu Desnoyers
executes. Code invoking push_task_to_cpu() must be prepared to retry in that case. Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Moln

[RFC PATCH for 4.21 07/16] cpu_opv: limit amount of virtual address space used by cpu_opv

2018-10-10 Thread Mathieu Desnoyers
Introduce sysctl cpu_opv_va_max_bytes, which limits the amount of virtual address space that can be used by cpu_opv. Its default value is the maximum amount of virtual address space which can be used by a single cpu_opv system call (256 kB on x86). Signed-off-by: Mathieu Desnoyers CC: "P

[RFC PATCH for 4.21 09/16] powerpc: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Boqun Feng CC: Peter Zijlstra CC: "Paul E. McKenney" CC: linuxppc-...@lists.ozlabs.org --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/uapi/asm/unistd.

[RFC PATCH for 4.21 03/16] sched: Implement push_task_to_cpu (v2)

2018-10-10 Thread Mathieu Desnoyers
executes. Code invoking push_task_to_cpu() must be prepared to retry in that case. Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Moln

[RFC PATCH for 4.21 07/16] cpu_opv: limit amount of virtual address space used by cpu_opv

2018-10-10 Thread Mathieu Desnoyers
Introduce sysctl cpu_opv_va_max_bytes, which limits the amount of virtual address space that can be used by cpu_opv. Its default value is the maximum amount of virtual address space which can be used by a single cpu_opv system call (256 kB on x86). Signed-off-by: Mathieu Desnoyers CC: "P

[RFC PATCH for 4.21 08/16] x86: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: "H. Peter Anvin" CC: Ben Maurer CC: Steven Rostedt CC: Josh

[RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-10 Thread Mathieu Desnoyers
and userspace mappings for virtually aliased architectures. Signed-off-by: Mathieu Desnoyers Reviewed-by: Matthew Wilcox CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC:

[RFC PATCH for 4.21 04/16] mm: Introduce vm_map_user_ram, vm_unmap_user_ram

2018-10-10 Thread Mathieu Desnoyers
and userspace mappings for virtually aliased architectures. Signed-off-by: Mathieu Desnoyers Reviewed-by: Matthew Wilcox CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC:

[RFC PATCH for 4.21 14/16] cpu-opv/selftests: Provide basic percpu ops test

2018-10-10 Thread Mathieu Desnoyers
"basic_percpu_ops_test" implements a few simple per-cpu operations and testing their correctness. Signed-off-by: Mathieu Desnoyers CC: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: li

[RFC PATCH for 4.21 14/16] cpu-opv/selftests: Provide basic percpu ops test

2018-10-10 Thread Mathieu Desnoyers
"basic_percpu_ops_test" implements a few simple per-cpu operations and testing their correctness. Signed-off-by: Mathieu Desnoyers CC: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: li

[RFC PATCH for 4.21 10/16] arm: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC: Paul Turner CC: Peter Zijlstra CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: Ben Maurer CC: Steven Rostedt CC: "Paul E. McK

[RFC PATCH for 4.21 10/16] arm: Wire up cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC: Paul Turner CC: Peter Zijlstra CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: Ben Maurer CC: Steven Rostedt CC: "Paul E. McK

[RFC PATCH for 4.21 16/16] cpu-opv/selftests: Provide Makefile, scripts, gitignore

2018-10-10 Thread Mathieu Desnoyers
A run_param_test.sh script runs many variants of the parametrizable tests. Wire up the cpu-opv Makefile, add directory entry into MAINTAINERS file. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon

[RFC PATCH for 4.21 00/16] rseq updates, new cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
interfering with cpu affinity masks, and using rseq from signal handlers nested between thread creation and rseq registration by glibc, or between rseq unregistration by glibc and thread teardown. Thanks, Mathieu Mathieu Desnoyers (16): rseq/selftests: Add reference counter to coexist with glibc

[RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-10 Thread Mathieu Desnoyers
formed on the same per-cpu ring buffer, even if a migration happens between those operations. In the typical case, both operations will happens on the same CPU and use rseq. In the unlikely event of a migration, the cpu_opv system call will ensure the commit can be performed on the right CPU by migrating

[RFC PATCH for 4.21 13/16] cpu-opv/selftests: Provide percpu_op API

2018-10-10 Thread Mathieu Desnoyers
= percpu_current_cpu(); ret = percpu_addv(>c[cpu].count, 1, cpu); if (unlikely(ret)) { perror("percpu_addv"); return -1; } return 0; Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC

[RFC PATCH for 4.21 02/16] rseq/selftests: Adapt number of threads to the number of detected cpus

2018-10-10 Thread Mathieu Desnoyers
On smaller systems, running a test with 200 threads can take a long time on machines with smaller number of CPUs. Detect the number of online cpus at test runtime, and multiply that by 6 to have 6 rseq threads per cpu preempting each other. Signed-off-by: Mathieu Desnoyers Cc: Shuah Khan Cc

[RFC PATCH for 4.21 16/16] cpu-opv/selftests: Provide Makefile, scripts, gitignore

2018-10-10 Thread Mathieu Desnoyers
A run_param_test.sh script runs many variants of the parametrizable tests. Wire up the cpu-opv Makefile, add directory entry into MAINTAINERS file. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon

[RFC PATCH for 4.21 00/16] rseq updates, new cpu_opv system call

2018-10-10 Thread Mathieu Desnoyers
interfering with cpu affinity masks, and using rseq from signal handlers nested between thread creation and rseq registration by glibc, or between rseq unregistration by glibc and thread teardown. Thanks, Mathieu Mathieu Desnoyers (16): rseq/selftests: Add reference counter to coexist with glibc

[RFC PATCH for 4.21 06/16] cpu_opv: Provide cpu_opv system call (v8)

2018-10-10 Thread Mathieu Desnoyers
formed on the same per-cpu ring buffer, even if a migration happens between those operations. In the typical case, both operations will happens on the same CPU and use rseq. In the unlikely event of a migration, the cpu_opv system call will ensure the commit can be performed on the right CPU by migrating

[RFC PATCH for 4.21 13/16] cpu-opv/selftests: Provide percpu_op API

2018-10-10 Thread Mathieu Desnoyers
= percpu_current_cpu(); ret = percpu_addv(>c[cpu].count, 1, cpu); if (unlikely(ret)) { perror("percpu_addv"); return -1; } return 0; Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Russell King CC: Catalin Marinas CC: Will Deacon CC: Thomas Gleixner CC

[RFC PATCH for 4.21 02/16] rseq/selftests: Adapt number of threads to the number of detected cpus

2018-10-10 Thread Mathieu Desnoyers
On smaller systems, running a test with 200 threads can take a long time on machines with smaller number of CPUs. Detect the number of online cpus at test runtime, and multiply that by 6 to have 6 rseq threads per cpu preempting each other. Signed-off-by: Mathieu Desnoyers Cc: Shuah Khan Cc

[RFC PATCH for 4.21 12/16] cpu-opv/selftests: Provide basic test

2018-10-10 Thread Mathieu Desnoyers
"basic_cpu_opv_test" tests basic functionality of cpu_opv. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft...@vger.kernel.org Cc: "

[RFC PATCH for 4.21 12/16] cpu-opv/selftests: Provide basic test

2018-10-10 Thread Mathieu Desnoyers
"basic_cpu_opv_test" tests basic functionality of cpu_opv. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft...@vger.kernel.org Cc: "

[RFC PATCH for 4.21 05/16] mm: Provide is_vma_noncached

2018-10-10 Thread Mathieu Desnoyers
Provide is_vma_noncached() static inline to allow generic code to check whether the given vma consists of noncached memory. Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave

[RFC PATCH for 4.21 11/16] cpu-opv/selftests: Provide cpu-op library

2018-10-10 Thread Mathieu Desnoyers
This cpu-op helper library provides a user-space API to the cpu_opv() system call. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft

[RFC PATCH for 4.21 15/16] cpu-opv/selftests: Provide parametrized tests

2018-10-10 Thread Mathieu Desnoyers
e benchmarks. "param_test_compare_twice" is the same as "param_test", but it performs each comparison within rseq critical section twice, thus validating invariants. If any of the second comparisons fails, an error message is printed and the test aborts. Signed-off-by: Mathieu Desnoyers

[RFC PATCH for 4.21 05/16] mm: Provide is_vma_noncached

2018-10-10 Thread Mathieu Desnoyers
Provide is_vma_noncached() static inline to allow generic code to check whether the given vma consists of noncached memory. Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave

[RFC PATCH for 4.21 11/16] cpu-opv/selftests: Provide cpu-op library

2018-10-10 Thread Mathieu Desnoyers
This cpu-op helper library provides a user-space API to the cpu_opv() system call. Signed-off-by: Mathieu Desnoyers Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc: Andi Kleen Cc: linux-kselft

[RFC PATCH for 4.21 15/16] cpu-opv/selftests: Provide parametrized tests

2018-10-10 Thread Mathieu Desnoyers
e benchmarks. "param_test_compare_twice" is the same as "param_test", but it performs each comparison within rseq critical section twice, thus validating invariants. If any of the second comparisons fails, an error message is printed and the test aborts. Signed-off-by: Mathieu Desnoyers

[RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-10 Thread Mathieu Desnoyers
struct rseq is an ABI between user-space executable and libraries, but the kernel does not care about that field, so it is not part of the Linux uapi. Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC

[RFC PATCH for 4.21 01/16] rseq/selftests: Add reference counter to coexist with glibc

2018-10-10 Thread Mathieu Desnoyers
struct rseq is an ABI between user-space executable and libraries, but the kernel does not care about that field, so it is not part of the Linux uapi. Signed-off-by: Mathieu Desnoyers CC: Shuah Khan CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC

[RFC PATCH v2] glibc: Perform rseq(2) registration at nptl init and thread creation (v2)

2018-10-09 Thread Mathieu Desnoyers
NEWS entry. - Update ABI test baselines. - Update abilist for non-x86-64 architectures. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun F

[RFC PATCH v2] glibc: Perform rseq(2) registration at nptl init and thread creation (v2)

2018-10-09 Thread Mathieu Desnoyers
NEWS entry. - Update ABI test baselines. - Update abilist for non-x86-64 architectures. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKenney" CC: Boqun F

[PATCH backport for 4.18] rseq/selftests: fix parametrized test with -fpie

2018-10-04 Thread Mathieu Desnoyers
register to hold the address of the loop counter variable. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Acked-by: "Paul E . McKenney" Cc: # v4.18 Cc: Shuah Khan Cc: Thomas Gleixner

[PATCH backport for 4.18] rseq/selftests: fix parametrized test with -fpie

2018-10-04 Thread Mathieu Desnoyers
register to hold the address of the loop counter variable. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Acked-by: "Paul E . McKenney" Cc: # v4.18 Cc: Shuah Khan Cc: Thomas Gleixner

[PATCH v2] rseq/selftests: fix parametrized test with -fpie

2018-09-27 Thread Mathieu Desnoyers
. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Acked-by: "Paul E . McKenney" Cc: # v4.18 Cc: Shuah Khan Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin M

[PATCH v2] rseq/selftests: fix parametrized test with -fpie

2018-09-27 Thread Mathieu Desnoyers
. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Acked-by: "Paul E . McKenney" Cc: # v4.18 Cc: Shuah Khan Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin M

Re: [PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-27 Thread Mathieu Desnoyers
- On Sep 27, 2018, at 9:58 AM, Shuah Khan shuah...@samsung.com wrote: > On 09/27/2018 07:22 AM, Steven Rostedt wrote: >> On Tue, 25 Sep 2018 13:39:36 -0400 (EDT) >> Mathieu Desnoyers wrote: >> >>> - On Sep 18, 2018, at 9:53 AM, Mathieu Desnoyers >>&g

Re: [PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-27 Thread Mathieu Desnoyers
- On Sep 27, 2018, at 9:58 AM, Shuah Khan shuah...@samsung.com wrote: > On 09/27/2018 07:22 AM, Steven Rostedt wrote: >> On Tue, 25 Sep 2018 13:39:36 -0400 (EDT) >> Mathieu Desnoyers wrote: >> >>> - On Sep 18, 2018, at 9:53 AM, Mathieu Desnoyers >>&g

Re: [PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-25 Thread Mathieu Desnoyers
- On Sep 18, 2018, at 9:53 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > On x86-64, the parametrized selftest code for rseq crashes with a > segmentation fault when compiled with -fpie. This happens when the > param_test binary is loaded at an address beyond 32-bit

Re: [PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-25 Thread Mathieu Desnoyers
- On Sep 18, 2018, at 9:53 AM, Mathieu Desnoyers mathieu.desnoy...@efficios.com wrote: > On x86-64, the parametrized selftest code for rseq crashes with a > segmentation fault when compiled with -fpie. This happens when the > param_test binary is loaded at an address beyond 32-bit

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-21 Thread Mathieu Desnoyers
- On Sep 20, 2018, at 4:20 PM, Joseph Myers jos...@codesourcery.com wrote: > On Thu, 20 Sep 2018, Mathieu Desnoyers wrote: > >> Are you saying glibc has an explicit check for the kernel version visible >> from /proc before using specific features ? If so,

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-21 Thread Mathieu Desnoyers
- On Sep 20, 2018, at 4:20 PM, Joseph Myers jos...@codesourcery.com wrote: > On Thu, 20 Sep 2018, Mathieu Desnoyers wrote: > >> Are you saying glibc has an explicit check for the kernel version visible >> from /proc before using specific features ? If so,

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-20 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 1:10 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> > This looks like it's coming from the Linux kernel. Can't the relevant >> > uapi header just be used directly without copying into g

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-20 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 1:10 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> > This looks like it's coming from the Linux kernel. Can't the relevant >> > uapi header just be used directly without copying into g

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-20 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 12:37 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> Here is a rough prototype registering rseq(2) TLS for each thread >> (including main), and unregistering for each thread (excluding >&

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-20 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 12:37 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> Here is a rough prototype registering rseq(2) TLS for each thread >> (including main), and unregistering for each thread (excluding >&

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 1:38 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 19/09/18 15:44, Mathieu Desnoyers wrote: >> Things to consider: >> >> - Move __rseq_refcount to an extra field at the end of __rseq_abi to >>eliminate one symbol. This would

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 1:38 PM, Szabolcs Nagy szabolcs.n...@arm.com wrote: > On 19/09/18 15:44, Mathieu Desnoyers wrote: >> Things to consider: >> >> - Move __rseq_refcount to an extra field at the end of __rseq_abi to >>eliminate one symbol. This would

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
I'm using the initial-exec tls model rather than the global-dynamic: I want to make sure no function call is generated there. > The ABI tests have code that would list .tbss symbols as "T" in ABI test > baselines, but no existing ABI baselines use that. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
I'm using the initial-exec tls model rather than the global-dynamic: I want to make sure no function call is generated there. > The ABI tests have code that would list .tbss symbols as "T" in ABI test > baselines, but no existing ABI baselines use that. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 12:37 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> Here is a rough prototype registering rseq(2) TLS for each thread >> (including main), and unregistering for each thread (excluding >&

Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
- On Sep 19, 2018, at 12:37 PM, Joseph Myers jos...@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> Here is a rough prototype registering rseq(2) TLS for each thread >> (including main), and unregistering for each thread (excluding >&

[RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
how late do we want to unregister it ? It's important to consider if we expect rseq to be used by the memory allocator and within destructor callbacks. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKe

[RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation

2018-09-19 Thread Mathieu Desnoyers
how late do we want to unregister it ? It's important to consider if we expect rseq to be used by the memory allocator and within destructor callbacks. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Thomas Gleixner CC: Ben Maurer CC: Peter Zijlstra CC: "Paul E. McKe

[PATCH man-pages] Add rseq manpage

2018-09-19 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: "H. Peter Anvin" CC: Ben Maurer CC: Steven Rostedt CC: Josh

[PATCH man-pages] Add rseq manpage

2018-09-19 Thread Mathieu Desnoyers
Signed-off-by: Mathieu Desnoyers CC: "Paul E. McKenney" CC: Peter Zijlstra CC: Paul Turner CC: Thomas Gleixner CC: Andy Lutomirski CC: Andi Kleen CC: Dave Watson CC: Chris Lameter CC: Ingo Molnar CC: "H. Peter Anvin" CC: Ben Maurer CC: Steven Rostedt CC: Josh

[PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-18 Thread Mathieu Desnoyers
. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Cc: # v4.18 Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc

[PATCH] rseq/selftests: fix parametrized test with -fpie

2018-09-18 Thread Mathieu Desnoyers
. Fix this by using a 64-bit register to calculate the address of the loop counter variables as an offset from rip. Signed-off-by: Mathieu Desnoyers Cc: # v4.18 Cc: Thomas Gleixner Cc: Joel Fernandes Cc: Peter Zijlstra Cc: Catalin Marinas Cc: Dave Watson Cc: Will Deacon Cc: Shuah Khan Cc

Re: [PATCH 0/1] rseq/selftests: add __rseq_abi misalignment check

2018-08-07 Thread Mathieu Desnoyers
erneath it ? Thanks, Mathieu > > Vasily Gorbik (1): > rseq/selftests: add __rseq_abi misalignment check > > tools/testing/selftests/rseq/rseq.c | 19 +++ > .../testing/selftests/rseq/run_param_test.sh | 4 ++-- > 2 files changed, 21 inserti

Re: [PATCH 0/1] rseq/selftests: add __rseq_abi misalignment check

2018-08-07 Thread Mathieu Desnoyers
erneath it ? Thanks, Mathieu > > Vasily Gorbik (1): > rseq/selftests: add __rseq_abi misalignment check > > tools/testing/selftests/rseq/rseq.c | 19 +++ > .../testing/selftests/rseq/run_param_test.sh | 4 ++-- > 2 files changed, 21 inserti

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-30 Thread Mathieu Desnoyers
ucture has a fixed size of 32 bytes." > Now it says structure size is passed with every syscalls. Now I'm > confused (but maybe that's caused by reading source, not formatted > document). This is the layout for struct rseq_cs version 0. The variable-sized structure is struct rseq. struct rseq is typically in a TLS, and contains a "rseq_cs" field which is a pointer to the struct rseq_cs descriptor describing the currently active rseq critical section. Hoping this clears up the confusion. Thanks for the review! Mathieu > > Best regards, > Pavel > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-30 Thread Mathieu Desnoyers
ucture has a fixed size of 32 bytes." > Now it says structure size is passed with every syscalls. Now I'm > confused (but maybe that's caused by reading source, not formatted > document). This is the layout for struct rseq_cs version 0. The variable-sized structure is struct rseq. struct rseq is typically in a TLS, and contains a "rseq_cs" field which is a pointer to the struct rseq_cs descriptor describing the currently active rseq critical section. Hoping this clears up the confusion. Thanks for the review! Mathieu > > Best regards, > Pavel > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-30 Thread Mathieu Desnoyers
aligning struct rseq on larger boundaries, it is free to do so. It will still respect the requirement of alignment on 32 bytes boundaries. Thoughts ? Thanks, Mathieu > > Thanks, > Pavel > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-30 Thread Mathieu Desnoyers
aligning struct rseq on larger boundaries, it is free to do so. It will still respect the requirement of alignment on 32 bytes boundaries. Thoughts ? Thanks, Mathieu > > Thanks, > Pavel > > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) > http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH] selftests: membarrier: fix test by checking supported commands

2018-07-30 Thread Mathieu Desnoyers
> Signed-off-by: Rafael David Tinoco > Cc: #v4.17 Acked-by: Mathieu Desnoyers Thanks! Mathieu > --- > .../selftests/membarrier/membarrier_test.c| 69 +++ > 1 file changed, 41 insertions(+), 28 deletions(-) > > diff --git a/tools/testing/selftests/memba

Re: [PATCH] selftests: membarrier: fix test by checking supported commands

2018-07-30 Thread Mathieu Desnoyers
> Signed-off-by: Rafael David Tinoco > Cc: #v4.17 Acked-by: Mathieu Desnoyers Thanks! Mathieu > --- > .../selftests/membarrier/membarrier_test.c| 69 +++ > 1 file changed, 41 insertions(+), 28 deletions(-) > > diff --git a/tools/testing/selftests/memba

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-28 Thread Mathieu Desnoyers
f rseq thread registration into glibc. Once this is settled, I plan to provide a librseq which will contain headers and documentation on how to use rseq without having to re-create the low-level assembly every time. Does this plan make sense to you ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [RFC PATCH for 4.18 00/16] Restartable Sequences

2018-07-28 Thread Mathieu Desnoyers
f rseq thread registration into glibc. Once this is settled, I plan to provide a librseq which will contain headers and documentation on how to use rseq without having to re-create the low-level assembly every time. Does this plan make sense to you ? Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

Re: [PATCH v10 2/3] tracepoint: Make rcuidle tracepoint callers use SRCU

2018-07-14 Thread Mathieu Desnoyers
sing irq tracepoints with SRCU implementation (this series): > Mean: 3.020 (I would consider the improvement against the "without > this series" case as just noise). > Median: 3.013 > Std Dev: 0.033 > > [1] https://patchwork.kernel.org/patch/10344297/ >

Re: [PATCH v10 2/3] tracepoint: Make rcuidle tracepoint callers use SRCU

2018-07-14 Thread Mathieu Desnoyers
sing irq tracepoints with SRCU implementation (this series): > Mean: 3.020 (I would consider the improvement against the "without > this series" case as just noise). > Median: 3.013 > Std Dev: 0.033 > > [1] https://patchwork.kernel.org/patch/10344297/ >

Re: [PATCH v9 4/7] tracepoint: Make rcuidle tracepoint callers use SRCU

2018-07-11 Thread Mathieu Desnoyers
visible to >> either sched or srcu tracepoint users. > > Yeah, but I think it is still good to change the order. It doesn't > hurt, and in my opinion makes the code a bit more robust. I don't mind. It makes the code more regular. It does not change anything wrt robustness here tho

Re: [PATCH v9 4/7] tracepoint: Make rcuidle tracepoint callers use SRCU

2018-07-11 Thread Mathieu Desnoyers
visible to >> either sched or srcu tracepoint users. > > Yeah, but I think it is still good to change the order. It doesn't > hurt, and in my opinion makes the code a bit more robust. I don't mind. It makes the code more regular. It does not change anything wrt robustness here tho

Re: [PATCH v9 4/7] tracepoint: Make rcuidle tracepoint callers use SRCU

2018-07-11 Thread Mathieu Desnoyers
queued >> >> Here tracepoint_synchronize_unregister() returned before the srcu >> portion ran. > > I just read the comment that goes with that function; the order doesn't > matter. All we want to ensure is that the unregistration is visible to > either sched or srcu tracepoint users. Exactly, the order does not matter here. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com

<    4   5   6   7   8   9   10   11   12   13   >