Re: [Intel-gfx] [PATCH] drm/i915: Restrict pagefault disabling to just around copy_from_user()

2016-10-18 Thread Chris Wilson
On Tue, Oct 18, 2016 at 09:54:23AM +0100, Tvrtko Ursulin wrote: > On 18/10/2016 09:38, Chris Wilson wrote: > >>>(a) it is safe to do so, and I can legitimately setup userspace to use > >>>this > >>How what where? :) > >igt, whereelse, has a test case to check we can execute from read only >

Re: [Intel-gfx] [PATCH] drm/i915: Restrict pagefault disabling to just around copy_from_user()

2016-10-18 Thread Tvrtko Ursulin
On 18/10/2016 09:38, Chris Wilson wrote: On Tue, Oct 18, 2016 at 09:22:56AM +0100, Tvrtko Ursulin wrote: On 18/10/2016 09:17, Chris Wilson wrote: On Tue, Oct 18, 2016 at 09:01:30AM +0100, Tvrtko Ursulin wrote: On 17/10/2016 15:10, Chris Wilson wrote: When handling execbuf relocations, we

Re: [Intel-gfx] [PATCH] drm/i915: Restrict pagefault disabling to just around copy_from_user()

2016-10-18 Thread Chris Wilson
On Tue, Oct 18, 2016 at 09:22:56AM +0100, Tvrtko Ursulin wrote: > > On 18/10/2016 09:17, Chris Wilson wrote: > >On Tue, Oct 18, 2016 at 09:01:30AM +0100, Tvrtko Ursulin wrote: > >>On 17/10/2016 15:10, Chris Wilson wrote: > >>>When handling execbuf relocations, we play a delicate dance with >

Re: [Intel-gfx] [PATCH] drm/i915: Restrict pagefault disabling to just around copy_from_user()

2016-10-18 Thread Tvrtko Ursulin
On 18/10/2016 09:17, Chris Wilson wrote: On Tue, Oct 18, 2016 at 09:01:30AM +0100, Tvrtko Ursulin wrote: On 17/10/2016 15:10, Chris Wilson wrote: When handling execbuf relocations, we play a delicate dance with pagefault. We first try to access the user pages underneath our struct_mutex.

Re: [Intel-gfx] [PATCH] drm/i915: Restrict pagefault disabling to just around copy_from_user()

2016-10-18 Thread Chris Wilson
On Tue, Oct 18, 2016 at 09:01:30AM +0100, Tvrtko Ursulin wrote: > > On 17/10/2016 15:10, Chris Wilson wrote: > >When handling execbuf relocations, we play a delicate dance with > >pagefault. We first try to access the user pages underneath our > >struct_mutex. However, if those pages were inside

Re: [Intel-gfx] [PATCH] drm/i915: Restrict pagefault disabling to just around copy_from_user()

2016-10-18 Thread Tvrtko Ursulin
On 17/10/2016 15:10, Chris Wilson wrote: When handling execbuf relocations, we play a delicate dance with pagefault. We first try to access the user pages underneath our struct_mutex. However, if those pages were inside a GEM object, we may trigger a pagefault and deadlock as i915_gem_fault()

[Intel-gfx] [PATCH] drm/i915: Restrict pagefault disabling to just around copy_from_user()

2016-10-17 Thread Chris Wilson
When handling execbuf relocations, we play a delicate dance with pagefault. We first try to access the user pages underneath our struct_mutex. However, if those pages were inside a GEM object, we may trigger a pagefault and deadlock as i915_gem_fault() tries to recursively acquire struct_mutex.