summaryrefslogtreecommitdiff
path: root/xserver/hw
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2017-08-07 19:17:57 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2017-08-07 19:17:57 +0000
commit5caa025e6b62d0456faad86c89f239a14d1eaadb (patch)
tree19ad3bb55c619894204fc86ed55441cc12bbd92b /xserver/hw
parent883fa7c767eb2403918e7bd9031079010e4749e4 (diff)
Disable SSE optimizations on i386/amd64 for SlowBcopy.
It is supposed to be slow, and when such instructions are used to copy data from/to mapped video memory, some hypervisors (e.g. KVM, Microsoft Hyper-V) can generate SIGILL or SIGBUS exceptions, causing Xorg to crash. Bug report to OpenBSD by Max Parmer, fix from FreeBSD (Dimitry Andric) via kettenis@ ok kettenis@
Diffstat (limited to 'xserver/hw')
-rw-r--r--xserver/hw/xfree86/os-support/misc/Makefile.am7
-rw-r--r--xserver/hw/xfree86/os-support/misc/Makefile.in3
2 files changed, 8 insertions, 2 deletions
diff --git a/xserver/hw/xfree86/os-support/misc/Makefile.am b/xserver/hw/xfree86/os-support/misc/Makefile.am
index 0265aecd4..98e962f1b 100644
--- a/xserver/hw/xfree86/os-support/misc/Makefile.am
+++ b/xserver/hw/xfree86/os-support/misc/Makefile.am
@@ -7,6 +7,11 @@ libmisc_la_SOURCES = SlowBcopy.c
AM_CPPFLAGS = $(XORG_INCS)
-AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
+if I386_VIDEO
+NOSSE_CFLAGS = -mno-sse
+endif
+
+AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) $(NOSSE_CFLAGS)
+
EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS)
diff --git a/xserver/hw/xfree86/os-support/misc/Makefile.in b/xserver/hw/xfree86/os-support/misc/Makefile.in
index c286ad3d5..05340042d 100644
--- a/xserver/hw/xfree86/os-support/misc/Makefile.in
+++ b/xserver/hw/xfree86/os-support/misc/Makefile.in
@@ -475,7 +475,8 @@ libmisc_la_SOURCES = SlowBcopy.c
#AM_LDFLAGS = -r
AM_CPPFLAGS = $(XORG_INCS)
-AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
+@I386_VIDEO_TRUE@NOSSE_CFLAGS = -mno-sse
+AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) $(NOSSE_CFLAGS)
EXTRA_DIST = $(I386_SRCS) $(PORTIO_SRCS)
all: all-am