Module Name:    src
Committed By:   snj
Date:           Sun Jul  5 21:31:48 UTC 2015

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915 [netbsd-7]: i915_gem.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #854):
        sys/external/bsd/drm2/dist/drm/i915/i915_gem.c: revision 1.31
fix Xorg coredumps that have started happening recently.
the problem is that we get a SIGALRM while we're sleeping during a page fault
on a mapping of a GEM object, and since we're sleeping interruptibly,
the GEM operation fails with EINTR.  this error is returned all the way back
through uvm_fault() to the trap handler, which responds to that error
by delivering a SIGSEGV.
fix this by doing like the linux version of the GEM fault handler and converting
EINTR into success, which results in delivering the original signal and
retrying the fault.


To generate a diff of this commit:
cvs rdiff -u -r1.14.2.8 -r1.14.2.9 \
    src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.14.2.8 src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.14.2.9
--- src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c:1.14.2.8	Thu Apr 23 07:31:17 2015
+++ src/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c	Sun Jul  5 21:31:48 2015
@@ -1869,6 +1869,15 @@ out:
 	uvmfault_unlockall(ufi, ufi->entry->aref.ar_amap, uobj);
 	if (ret == -ERESTART)
 		uvm_wait("i915flt");
+
+	/*
+	 * Remap EINTR to success, so that we return to userland.
+	 * On the way out, we'll deliver the signal, and if the signal
+	 * is not fatal then the user code which faulted will most likely
+	 * fault again, and we'll come back here for another try.
+	 */
+	if (ret == -EINTR)
+		ret = 0;
 	/* XXX Deal with GPU hangs here...  */
 	intel_runtime_pm_put(dev_priv);
 	/* XXX errno Linux->NetBSD */

Reply via email to