Incorrect detection of MMX support in Intel Family 5 CPU's

Erwin Bronkhorst erwinbronkhorst at
Sun Jan 7 18:13:01 UTC 2018


I am running Debian Jessie on an Intel Galileo Gen 2 board, which is powered
by an Intel Quark CPU. I noticed a SIGILL on this system quite often,
especially when running gcc or wget. Running a debug session with gdb showed
me the following:

    Catchpoint 1 (signal SIGILL), 0xb7d4bc80 in __gmpn_lshift_pentium_mmx ()
from /usr/lib/i386-linux-gnu/

Long story short: on line 263 of fat.c [1], MMX support is enabled for CPU's
with model version 4 or higher. The Intel Quark is Model 9, but does not
support MMX instructions. I fixed the SIGILL problem locally by adding " &&
model != 9" in the if-statement. I'm not sure if all other Family 5 models >
4 support MMX, the documentation about model numbers seems to be scarce. I
found an indication that the Model 7 also does not (always?) support MMX
[2], so the problem might occur on non-Quark systems as well.

I think that at least the Model 9 should be handled differently to fix
issues on Quark systems. A nice improvement would be to retrieve the support
for MMX from the CPUID.

The output of lscpu for the Quark system:

    root at Galileo:~# lscpu
    Architecture:          i586
    CPU op-mode(s):        32-bit
    Byte Order:            Little Endian
    CPU(s):                1
    On-line CPU(s) list:   0
    Thread(s) per core:    1
    Core(s) per socket:    1
    Socket(s):             1
    Vendor ID:             GenuineIntel
    CPU family:            5
    Model:                 9
    Model name:            Quark SoC X1000
    Stepping:              0
    CPU MHz:               399.076
    BogoMIPS:              798.15

Kind regards,
Erwin Bronkhorst


More information about the gmp-bugs mailing list