Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 fix Xorg coredumps that ...



details:   https://anonhg.NetBSD.org/src/rev/474f59cf220e
branches:  trunk
changeset: 339074:474f59cf220e
user:      chs <chs%NetBSD.org@localhost>
date:      Thu Jun 25 16:01:20 2015 +0000

description:
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.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 713869ca5019 -r 474f59cf220e sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Thu Jun 25 09:53:25 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Thu Jun 25 16:01:20 2015 +0000
@@ -1869,6 +1869,15 @@
        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 */



Home | Main Index | Thread Index | Old Index