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

Bug#353494: Xserver SIGILL on processors without CPUID



Package: xorg-server
Tags: patch

Hello,

this bug is uncorrelated to Cyrix CPUs. It is caused by an bad
expression in the MMX detection code. Apparently, gas changed the
handling of local labels, so "jnz 1" does not assemble to the same as
"jnz 1f", which it once did, IIRC. The documentation for gas does not
mention local labels without an "f" or "b" suffix. The attached patch
fixes the jump instructions in the inline assembly and thus this bug
(except for the last submitted message). The patch has not yet been
tested on the real hardware (first I have to recompile the xorg-server
package which I might not get around to before christmas), but the
obviously wrong x86 code in gdb's disassembly is gone.

Regards,
  Michael Karcher
--- xorg-server-1.1.1/fb/fbpict.c.orig	2007-12-24 10:37:26.000000000 +0100
+++ xorg-server-1.1.1/fb/fbpict.c	2007-12-24 10:37:50.000000000 +0100
@@ -1378,7 +1378,7 @@
              "pop %%eax\n"
              "mov $0x0, %%edx\n"
              "xor %%ecx, %%eax\n"
-             "jz 1\n"
+             "jz 1f\n"
 
              "mov $0x00000000, %%eax\n"
 	     "push %%ebx\n"
@@ -1422,7 +1422,7 @@
                     "cpuid\n"
                     "xor %%edx, %%edx\n"
                     "cmp $0x1, %%eax\n"
-                    "jge 2\n"
+                    "jge 2f\n"
                     "mov $0x80000001, %%eax\n"
                     "cpuid\n"
                     "2:\n"

Reply to: