Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-18 Thread Daniel Vetter
On Thu, Aug 18, 2016 at 06:55:12AM -0400, Rob Clark wrote: > On Thu, Aug 18, 2016 at 4:36 AM, Daniel Vetter wrote: > > On Wed, Aug 17, 2016 at 05:29:31PM -0400, Rob Clark wrote: > >> diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c > >> index 6cd4af4..4502e4b 100644 > >>

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-18 Thread Daniel Vetter
On Wed, Aug 17, 2016 at 05:29:31PM -0400, Rob Clark wrote: > On Wed, Aug 17, 2016 at 3:15 PM, Al Viro wrote: > > On Wed, Aug 17, 2016 at 02:49:32PM -0400, Rob Clark wrote: > >> If there is a copy_from_user() variant that will return an error > >> instead of blocking, I think that is really what I

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-18 Thread Daniel Vetter
On Wed, Aug 17, 2016 at 08:31:20PM +0100, Al Viro wrote: > On Wed, Aug 17, 2016 at 03:24:38PM -0400, Rob Clark wrote: > > > hmm, looks like, at least on arm (not sure about arm64), > > > > #define __copy_from_user_inatomic __copy_from_user > > > > ie. copy_from_user() minus the access_ok() and

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-18 Thread Rob Clark
On Thu, Aug 18, 2016 at 9:08 AM, Daniel Vetter wrote: > On Thu, Aug 18, 2016 at 06:55:12AM -0400, Rob Clark wrote: >> On Thu, Aug 18, 2016 at 4:36 AM, Daniel Vetter wrote: >> > On Wed, Aug 17, 2016 at 05:29:31PM -0400, Rob Clark wrote: >> >> diff --git a/drivers/gpu/drm/msm/msm_gem.c

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-18 Thread Rob Clark
On Thu, Aug 18, 2016 at 4:36 AM, Daniel Vetter wrote: > On Wed, Aug 17, 2016 at 05:29:31PM -0400, Rob Clark wrote: >> diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c >> index 6cd4af4..4502e4b 100644 >> --- a/drivers/gpu/drm/msm/msm_gem.c >> +++

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Al Viro
On Wed, Aug 17, 2016 at 03:24:38PM -0400, Rob Clark wrote: > hmm, looks like, at least on arm (not sure about arm64), > > #define __copy_from_user_inatomic __copy_from_user > > ie. copy_from_user() minus the access_ok() and memset in the > !access_ok() path.. but maybe what I want is just the >

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Al Viro
On Wed, Aug 17, 2016 at 02:49:32PM -0400, Rob Clark wrote: > I'm not saying that I shouldn't fix it (although not quite sure how > yet.. taking/dropping the spinlock inside the loop is not a good > option from a performance standpoint). What I am saying is that this > is not something that can

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Al Viro
On Wed, Aug 17, 2016 at 11:08:46AM -0400, Rob Clark wrote: > On Wed, Aug 17, 2016 at 7:40 AM, Vaishali Thakkar > wrote: > > Hello, > > > > I was wondering about the call to copy_from_user in function > > submit_lookup_objects for drive > > /gpu/drm/msm/msm_gem_submit.c It calls

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Rob Clark
On Wed, Aug 17, 2016 at 3:15 PM, Al Viro wrote: > On Wed, Aug 17, 2016 at 02:49:32PM -0400, Rob Clark wrote: >> If there is a copy_from_user() variant that will return an error >> instead of blocking, I think that is really what I want so I can >> implement a slow-path that drops the spin-lock

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Vaishali Thakkar
Hello, I was wondering about the call to copy_from_user in function submit_lookup_objects for drive /gpu/drm/msm/msm_gem_submit.c It calls copy_from_user[1] in a spin_lock, which is not normally allowed, due to the possibility of a deadlock. Is there some reason that I am overlooking why it

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Rob Clark
On Wed, Aug 17, 2016 at 3:15 PM, Al Viro wrote: > On Wed, Aug 17, 2016 at 02:49:32PM -0400, Rob Clark wrote: > >> I'm not saying that I shouldn't fix it (although not quite sure how >> yet.. taking/dropping the spinlock inside the loop is not a good >> option from a performance standpoint). What

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Rob Clark
On Wed, Aug 17, 2016 at 2:49 PM, Rob Clark wrote: > On Wed, Aug 17, 2016 at 1:08 PM, Al Viro wrote: >> On Wed, Aug 17, 2016 at 11:08:46AM -0400, Rob Clark wrote: >>> On Wed, Aug 17, 2016 at 7:40 AM, Vaishali Thakkar >>> wrote: >>> > Hello, >>> > >>> > I was wondering about the call to

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Rob Clark
On Wed, Aug 17, 2016 at 1:08 PM, Al Viro wrote: > On Wed, Aug 17, 2016 at 11:08:46AM -0400, Rob Clark wrote: >> On Wed, Aug 17, 2016 at 7:40 AM, Vaishali Thakkar >> wrote: >> > Hello, >> > >> > I was wondering about the call to copy_from_user in function >> > submit_lookup_objects for drive >>

Use of copy_from_user in msm_gem_submit.c while holding a spin_lock

2016-08-17 Thread Rob Clark
On Wed, Aug 17, 2016 at 7:40 AM, Vaishali Thakkar wrote: > Hello, > > I was wondering about the call to copy_from_user in function > submit_lookup_objects for drive > /gpu/drm/msm/msm_gem_submit.c It calls copy_from_user[1] in a spin_lock, > which is not normally > allowed, due to the