Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-29 Thread Arnd Bergmann
On Wed, Apr 29, 2020 at 8:33 AM Jeremy Kerr wrote: > > Hi Christoph, > > > And another one that should go on top of this one to address Al's other > > compaint: > > Yeah, I was pondering that one. The access_ok() is kinda redundant, but > it does avoid forcing a SPU context save on those errors. >

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Jeremy Kerr
Hi Christoph, > And another one that should go on top of this one to address Al's other > compaint: Yeah, I was pondering that one. The access_ok() is kinda redundant, but it does avoid forcing a SPU context save on those errors. However, it's not like we really need to optimise for the case of

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Christoph Hellwig
And another one that should go on top of this one to address Al's other compaint: --- >From 1b7ced3de0b3a4addec61f61ac5278c3ff141657 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 22 Apr 2020 09:05:30 +0200 Subject: powerpc/spufs: stop using access_ok Just use the proper non __-pref

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Christoph Hellwig
On Wed, Apr 29, 2020 at 08:05:53AM +0200, Christoph Hellwig wrote: > On Wed, Apr 29, 2020 at 09:36:30AM +0800, Jeremy Kerr wrote: > > Hi Christoph, > > > > > FYI, these little hunks reduce the difference to my version, maybe > > > you can fold them in? > > > > Sure, no problem. > > > > How do yo

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Christoph Hellwig
On Wed, Apr 29, 2020 at 09:36:30AM +0800, Jeremy Kerr wrote: > Hi Christoph, > > > FYI, these little hunks reduce the difference to my version, maybe > > you can fold them in? > > Sure, no problem. > > How do you want to coordinate these? I can submit mine through mpe, but > that may make it tri

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Jeremy Kerr
Hi Christoph, > FYI, these little hunks reduce the difference to my version, maybe > you can fold them in? Sure, no problem. How do you want to coordinate these? I can submit mine through mpe, but that may make it tricky to synchronise with your changes. Or, you can include this change in your s

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Christoph Hellwig
FYI, these little hunks reduce the difference to my version, maybe you can fold them in? diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index c62d77ddaf7d3..1861436a6091d 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/pla

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Arnd Bergmann
On Tue, Apr 28, 2020 at 2:05 PM Jeremy Kerr wrote: > > Currently, we may perform a copy_to_user (through > simple_read_from_buffer()) while holding a context's register_lock, > while accessing the context save area. > > This change uses a temporary buffers for the context save area data, > which w

Re: [RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Christoph Hellwig
On Tue, Apr 28, 2020 at 08:02:07PM +0800, Jeremy Kerr wrote: > Currently, we may perform a copy_to_user (through > simple_read_from_buffer()) while holding a context's register_lock, > while accessing the context save area. > > This change uses a temporary buffers for the context save area data, >

[RFC PATCH] powerpc/spufs: fix copy_to_user while atomic

2020-04-28 Thread Jeremy Kerr
Currently, we may perform a copy_to_user (through simple_read_from_buffer()) while holding a context's register_lock, while accessing the context save area. This change uses a temporary buffers for the context save area data, which we then pass to simple_read_from_buffer. Signed-off-by: Jeremy Ke