drm/i915: Disable pagefaults along execbuffer relocation fast path
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 14 Mar 2011 15:11:24 +0000 (15:11 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Mar 2011 18:36:30 +0000 (11:36 -0700)
commitd449b2a924941d023fb9dc1ad397c5b4b740aba4
treef06208e76373adb54764383a00b864ad38a16d3d
parentde3da06e17ed82edfefef6cca8116548828f45b4
drm/i915: Disable pagefaults along execbuffer relocation fast path

commit d4aeee776017b6da6dcd12f453cd82a3c951a0dc upstream.

Along the fast path for relocation handling, we attempt to copy directly
from the user data structures whilst holding our mutex. This causes
lockdep to warn about circular lock dependencies if we need to pagefault
the user pages. [Since when handling a page fault on a mmapped bo, we
need to acquire the struct mutex whilst already holding the mm
semaphore, it is then verboten to acquire the mm semaphore when already
holding the struct mutex. The likelihood of the user passing in the
relocations contained in a GTT mmaped bo is low, but conceivable for
extreme pathology.] In order to force the mm to return EFAULT rather
than handle the pagefault, we therefore need to disable pagefaults
across the relocation fast path.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/i915/i915_gem_execbuffer.c