Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-07-11 Thread Steven Rostedt
On Wed, 11 Jul 2018 15:31:57 +0200 Sebastian Andrzej Siewior wrote: > On 2018-07-11 09:25:55 [-0400], Steven Rostedt wrote: > > Did you decide to create a local_lock_bh(lock) function? I don't see it. > > > > And should this be backported to 4.14-rt too? You state you saw this in > > 4.16-rt, bu

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-07-11 Thread Sebastian Andrzej Siewior
On 2018-07-11 09:25:55 [-0400], Steven Rostedt wrote: > Did you decide to create a local_lock_bh(lock) function? I don't see it. > > And should this be backported to 4.14-rt too? You state you saw this in > 4.16-rt, but did you start doing something different then, or did the > kernel change? I w

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-07-11 Thread Steven Rostedt
On Tue, 22 May 2018 19:33:33 +0200 Sebastian Andrzej Siewior wrote: > On 2018-05-22 13:24:29 [-0400], Steven Rostedt wrote: > > On Tue, 22 May 2018 19:21:16 +0200 > > Sebastian Andrzej Siewior wrote: > > > > > On 2018-05-22 13:10:04 [-0400], Steven Rostedt wrote: > > > > On Thu, 17 May 2018

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-23 Thread Dave Martin
On Wed, May 23, 2018 at 04:31:56PM +0200, Sebastian Andrzej Siewior wrote: > On 2018-05-17 19:19:43 [+0100], Dave Martin wrote: > > On Thu, May 17, 2018 at 02:40:06PM +0200, Sebastian Andrzej Siewior wrote: > > > In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The > > > code dis

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-23 Thread Sebastian Andrzej Siewior
On 2018-05-18 13:46:36 [+0100], Dave Martin wrote: > On Thu, May 17, 2018 at 07:19:43PM +0100, Dave Martin wrote: > > [...] > > > kernel_neon_begin() could then do > > > > local_fpsimd_context_lock(); > > > > /* ... */ > > > > preempt_disable(); > > local_unlock(fpsimd_context_

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-23 Thread Sebastian Andrzej Siewior
On 2018-05-17 19:19:43 [+0100], Dave Martin wrote: > On Thu, May 17, 2018 at 02:40:06PM +0200, Sebastian Andrzej Siewior wrote: > > In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The > > code disables BH and expects that it is not preemptible. On -RT the > > task remains preemp

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-22 Thread Sebastian Andrzej Siewior
On 2018-05-22 13:24:29 [-0400], Steven Rostedt wrote: > On Tue, 22 May 2018 19:21:16 +0200 > Sebastian Andrzej Siewior wrote: > > > On 2018-05-22 13:10:04 [-0400], Steven Rostedt wrote: > > > On Thu, 17 May 2018 14:40:06 +0200 > > > Sebastian Andrzej Siewior wrote: > > > > > > > +static DEFIN

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-22 Thread Steven Rostedt
On Tue, 22 May 2018 19:21:16 +0200 Sebastian Andrzej Siewior wrote: > On 2018-05-22 13:10:04 [-0400], Steven Rostedt wrote: > > On Thu, 17 May 2018 14:40:06 +0200 > > Sebastian Andrzej Siewior wrote: > > > > > +static DEFINE_LOCAL_IRQ_LOCK(fpsimd_lock); > > > /* > > > * Update current's FP

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-22 Thread Sebastian Andrzej Siewior
On 2018-05-22 13:10:04 [-0400], Steven Rostedt wrote: > On Thu, 17 May 2018 14:40:06 +0200 > Sebastian Andrzej Siewior wrote: > > > +static DEFINE_LOCAL_IRQ_LOCK(fpsimd_lock); > > /* > > * Update current's FPSIMD/SVE registers from thread_struct. > > * > > @@ -594,6 +595,7 @@ int sve_set_vec

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-22 Thread Steven Rostedt
On Thu, 17 May 2018 14:40:06 +0200 Sebastian Andrzej Siewior wrote: > +static DEFINE_LOCAL_IRQ_LOCK(fpsimd_lock); > /* > * Update current's FPSIMD/SVE registers from thread_struct. > * > @@ -594,6 +595,7 @@ int sve_set_vector_length(struct task_struct *task, >* non-SVE thread. >

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-18 Thread Dave Martin
On Thu, May 17, 2018 at 07:19:43PM +0100, Dave Martin wrote: [...] > kernel_neon_begin() could then do > > local_fpsimd_context_lock(); > > /* ... */ > > preempt_disable(); > local_unlock(fpsimd_context_lock); > > ... with the following in kernel_neon_end(): > >

Re: [PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-17 Thread Dave Martin
On Thu, May 17, 2018 at 02:40:06PM +0200, Sebastian Andrzej Siewior wrote: > In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The > code disables BH and expects that it is not preemptible. On -RT the > task remains preemptible but remains the same CPU. This may corrupt the Also,

[PATCH RT] arm64: fpsimd: use a local_lock() in addition to local_bh_disable()

2018-05-17 Thread Sebastian Andrzej Siewior
In v4.16-RT I noticed a number of warnings from task_fpsimd_load(). The code disables BH and expects that it is not preemptible. On -RT the task remains preemptible but remains the same CPU. This may corrupt the content of the SIMD registers if the task is preempted during saving/restoring those re