xserver: Branch 'master' - 5 commits

Adam Jackson ajax at kemper.freedesktop.org
Wed Dec 13 16:14:36 UTC 2017


 hw/kdrive/src/kdrive.c                              |   14 -------
 hw/xfree86/common/xf86.h                            |    4 --
 hw/xfree86/common/xf86Events.c                      |   38 --------------------
 hw/xfree86/common/xf86Globals.c                     |    1 
 hw/xfree86/common/xf86Helper.c                      |    6 ---
 hw/xfree86/common/xf86Init.c                        |   17 +-------
 hw/xfree86/common/xf86Priv.h                        |    2 -
 hw/xfree86/common/xf86Privstr.h                     |    1 
 hw/xfree86/doc/ddxDesign.xml                        |   10 -----
 hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c |   13 ------
 os/osinit.c                                         |    6 ++-
 11 files changed, 8 insertions(+), 104 deletions(-)

New commits:
commit bed28300999a07514d741abe5c748adf234e18a6
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 20 15:43:07 2017 -0500

    kdrive: remove KdSignalWrapper etc.
    
    This no longer does anything useful.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 82dcf4ae7..6dbb90856 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -86,8 +86,6 @@ const char *kdGlobalXkbLayout = NULL;
 const char *kdGlobalXkbVariant = NULL;
 const char *kdGlobalXkbOptions = NULL;
 
-static Bool kdCaughtSignal = FALSE;
-
 void
 KdDisableScreen(ScreenPtr pScreen)
 {
@@ -168,9 +166,6 @@ void
 AbortDDX(enum ExitCode error)
 {
     KdDisableScreens();
-
-    if (kdCaughtSignal)
-        OsAbort();
 }
 
 void
@@ -937,13 +932,6 @@ KdAddScreen(ScreenInfo * pScreenInfo,
     AddScreen(KdScreenInit, argc, argv);
 }
 
-static int
-KdSignalWrapper(int signum)
-{
-    kdCaughtSignal = TRUE;
-    return 1;                   /* use generic OS layer cleanup & abort */
-}
-
 void
 KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
 {
@@ -985,8 +973,6 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
         for (screen = card->screenList; screen; screen = screen->next)
             KdAddScreen(pScreenInfo, screen, argc, argv);
 
-    OsRegisterSigWrapper(KdSignalWrapper);
-
 #if defined(CONFIG_UDEV) || defined(CONFIG_HAL)
     if (SeatId) /* Enable input hot-plugging */
         config_pre_init();
commit 4353d83f60766824a65f183716616eee8e17bb24
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 20 15:43:06 2017 -0500

    xfree86: remove xf86CaughtSignal etc.
    
    This no longer does anything useful.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 43b693143..1c2546894 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -296,8 +296,6 @@ xf86ServerIsResetting(void);
 extern _X_EXPORT Bool
 xf86ServerIsOnlyDetecting(void);
 extern _X_EXPORT Bool
-xf86CaughtSignal(void);
-extern _X_EXPORT Bool
 xf86GetVidModeAllowNonLocal(void);
 extern _X_EXPORT Bool
 xf86GetVidModeEnabled(void);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index a27c7ff1b..8a800bd8f 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -268,17 +268,6 @@ xf86RemoveEnabledDevice(InputInfoPtr pInfo)
 }
 
 /*
- * xf86SigWrapper --
- *    Catch unexpected signals and exit or continue cleanly.
- */
-int
-xf86SigWrapper(int signo)
-{
-    xf86Info.caughtSignal = TRUE;
-    return 1;                   /* abort */
-}
-
-/*
  * xf86PrintBacktrace --
  *    Print a stack backtrace for debugging purposes.
  */
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index ddf7a8696..85efe3fc1 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -107,7 +107,6 @@ xf86InfoRec xf86Info = {
     .dontZap = FALSE,
     .dontZoom = FALSE,
     .notrapSignals = FALSE,
-    .caughtSignal = FALSE,
     .currentScreen = NULL,
 #ifdef CSRG_BASED
     .consType = -1,
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 447ed3f8f..393a7aa88 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1429,12 +1429,6 @@ xf86ServerIsOnlyDetecting(void)
 }
 
 Bool
-xf86CaughtSignal(void)
-{
-    return xf86Info.caughtSignal;
-}
-
-Bool
 xf86GetVidModeAllowNonLocal(void)
 {
     return xf86Info.vidModeAllowNonLocal;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 994b63b43..57b38d07e 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -298,16 +298,9 @@ xf86PrivsElevated(void)
 }
 
 static void
-InstallSignalHandlers(void)
+TrapSignals(void)
 {
-    /*
-     * Install signal handler for unexpected signals
-     */
-    xf86Info.caughtSignal = FALSE;
-    if (!xf86Info.notrapSignals) {
-        OsRegisterSigWrapper(xf86SigWrapper);
-    }
-    else {
+    if (xf86Info.notrapSignals) {
         OsSignal(SIGSEGV, SIG_DFL);
         OsSignal(SIGABRT, SIG_DFL);
         OsSignal(SIGILL, SIG_DFL);
@@ -423,7 +416,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
             }
         }
 
-        InstallSignalHandlers();
+        TrapSignals();
 
         /* Initialise the loader */
         LoaderInit();
@@ -960,10 +953,6 @@ ddxGiveUp(enum ExitCode error)
     dbus_core_fini();
 
     xf86CloseLog(error);
-
-    /* If an unexpected signal was caught, dump a core for debugging */
-    if (xf86Info.caughtSignal)
-        OsAbort();
 }
 
 /*
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 22bf5ff24..4fe2b5f33 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -135,8 +135,6 @@ DoShowOptions(void)
 
 extern _X_EXPORT void
 xf86Wakeup(void *blockData, int err);
-extern _X_HIDDEN int
-xf86SigWrapper(int signo);
 extern _X_EXPORT void
 xf86HandlePMEvents(int fd, void *data);
 extern _X_EXPORT int (*xf86PMGetEventFromOs) (int fd, pmEvent * events,
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index e4b479f4f..c5048a399 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -64,7 +64,6 @@ typedef struct {
     Bool dontZap;
     Bool dontZoom;
     Bool notrapSignals;         /* don't exit cleanly - die at fault */
-    Bool caughtSignal;
 
     /* graphics part */
     ScreenPtr currentScreen;
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 757985026..13994f7a9 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -2053,16 +2053,6 @@ functions is as follows:
 
 	</para></blockquote>
 
-      <blockquote><para>
-	  <programlisting>
-    Bool xf86CaughtSignal();
-	  </programlisting>
-	  <blockquote><para>
-      Returns <constant>TRUE</constant> if the server has caught a signal,
-      and <constant>FALSE</constant> otherwise.
-	    </para></blockquote>
-
-	</para></blockquote>
     </sect2>
 
     <sect2>
commit 9c72887939f319e185d2726d9d9a4191b9d12efd
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 20 15:43:05 2017 -0500

    os: Make OsSignalHandler ask for core dumps for signo != SIGQUIT
    
    SIGQUIT is a normal termination request, but any other signal we handle
    here wants a core. This has the effect of making FatalError's call to
    AbortServer trigger the
    
        if (CoreDump)
            OsAbort();
    
    path. This will allow us to remove some DDX code that has the same net
    effect.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>

diff --git a/os/osinit.c b/os/osinit.c
index cd769d181..8575319ff 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -52,6 +52,7 @@ SOFTWARE.
 #include <X11/X.h>
 #include "os.h"
 #include "osdep.h"
+#include "opaque.h"
 #include <X11/Xos.h>
 #include <signal.h>
 #include <errno.h>
@@ -74,8 +75,6 @@ SOFTWARE.
 #define ADMPATH "/usr/adm/X%smsgs"
 #endif
 
-extern char *display;
-
 #ifdef RLIMIT_DATA
 int limitDataSpace = -1;
 #endif
@@ -151,6 +150,9 @@ OsSigHandler(int signo)
     }
 #endif
 
+    if (signo != SIGQUIT)
+        CoreDump = TRUE;
+
     FatalError("Caught signal %d (%s). Server aborting\n",
                signo, strsignal(signo));
 }
commit 0a255dceb79ee28a88667d5bd23cf989dbf9bed8
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 20 15:43:04 2017 -0500

    xfree86: Remove xf86InterceptSignals
    
    The only consumer of this is the Linux vm86 backend for int10 (which you
    should not use), and there all it serves to do is make signals generated
    by the vm86 task non-fatal. In practice this error appears never to
    happen, and marching ahead with root privileges after arbitrary code has
    raised a signal seems like a poor plan.
    
    Remove the usage in the vm86 code, making this error fatal.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index db6e299b3..43b693143 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -215,7 +215,6 @@ extern _X_EXPORT void xf86DisableGeneralHandler(void *handler);
 extern _X_EXPORT void xf86EnableGeneralHandler(void *handler);
 extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc
                                                         handler, void *data);
-extern _X_EXPORT void xf86InterceptSignals(int *signo);
 extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
 extern _X_EXPORT void xf86PrintBacktrace(void);
 extern _X_EXPORT Bool xf86VTOwner(void);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index e2e6ca769..a27c7ff1b 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -267,15 +267,6 @@ xf86RemoveEnabledDevice(InputInfoPtr pInfo)
     InputThreadUnregisterDev(pInfo->fd);
 }
 
-static int *xf86SignalIntercept = NULL;
-
-void
-xf86InterceptSignals(int *signo)
-{
-    if ((xf86SignalIntercept = signo))
-        *signo = -1;
-}
-
 /*
  * xf86SigWrapper --
  *    Catch unexpected signals and exit or continue cleanly.
@@ -283,11 +274,6 @@ xf86InterceptSignals(int *signo)
 int
 xf86SigWrapper(int signo)
 {
-    if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) {
-        *xf86SignalIntercept = signo;
-        return 0;               /* continue */
-    }
-
     xf86Info.caughtSignal = TRUE;
     return 1;                   /* abort */
 }
diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
index 187698399..134809814 100644
--- a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
+++ b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c
@@ -231,20 +231,9 @@ vm86_GP_fault(xf86Int10InfoPtr pInt)
 static int
 do_vm86(xf86Int10InfoPtr pInt)
 {
-    int retval, signo;
+    int retval;
 
-    xf86InterceptSignals(&signo);
     retval = vm86_rep(VM86S);
-    xf86InterceptSignals(NULL);
-
-    if (signo >= 0) {
-        xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR,
-                   "vm86() syscall generated signal %d.\n", signo);
-        dump_registers(pInt);
-        dump_code(pInt);
-        stack_trace(pInt);
-        return 0;
-    }
 
     switch (VM86_TYPE(retval)) {
     case VM86_UNKNOWN:
commit 722c8035dcf3ae0b18841066fe4ee030277274bc
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 20 15:43:03 2017 -0500

    xfree86: Remove xf86InterceptSigIll
    
    This was added in ~2004 for the sis driver, to detect whether it could
    use SSE for memcpy. Charmingly, the code to check whether that feature
    exists in the server is:
    
        #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(6,8,99,13,0)
        #define SISCHECKOSSSE           /* Automatic check OS for SSE; requires SigIll facility */
        #endif
    
    Which means it has never worked in any modular server release.
    
    A less gross way to do this is to check for SSE support with getauxval()
    or /proc/cpuinfo or similar. Since no driver is using the existing
    intercept mechanism, drop it.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 674e83cb1..db6e299b3 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -216,7 +216,6 @@ extern _X_EXPORT void xf86EnableGeneralHandler(void *handler);
 extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc
                                                         handler, void *data);
 extern _X_EXPORT void xf86InterceptSignals(int *signo);
-extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void));
 extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
 extern _X_EXPORT void xf86PrintBacktrace(void);
 extern _X_EXPORT Bool xf86VTOwner(void);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 53ec74f26..e2e6ca769 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -276,14 +276,6 @@ xf86InterceptSignals(int *signo)
         *signo = -1;
 }
 
-static void (*xf86SigIllHandler) (void) = NULL;
-
-void
-xf86InterceptSigIll(void (*sigillhandler) (void))
-{
-    xf86SigIllHandler = sigillhandler;
-}
-
 /*
  * xf86SigWrapper --
  *    Catch unexpected signals and exit or continue cleanly.
@@ -291,11 +283,6 @@ xf86InterceptSigIll(void (*sigillhandler) (void))
 int
 xf86SigWrapper(int signo)
 {
-    if ((signo == SIGILL) && xf86SigIllHandler) {
-        (*xf86SigIllHandler) ();
-        return 0;               /* continue */
-    }
-
     if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) {
         *xf86SignalIntercept = signo;
         return 0;               /* continue */


More information about the xorg-commit mailing list