Alternative option for solving Fedora i686 vs geode problems

John Gilmore gnu at toad.com
Mon Jun 7 20:49:38 EDT 2010


I looked at the kernel patch for emulating the missing instruction
(long NOP).  It looks like it works, and only needs minor patching-up
for security enforcement.  The big argument on the Linux kernel list
was about not having a little kludge like this, which is likely to
grow to emulate many other things and become unmaintainable; some
people would rather use the whole virtual-CPU emulation mechanism for
this, which is much more heavyweight, but also a lot easier to test
and validate.

If having to maintain a 20- or 50-line kernel patch is the price of
being able to move forward onto using unmodified modern Fedora release
repositories, I'd say the choice for OLPC is very clear - do it.

The change that introduced the use of this instruction was in the
binutils (assembler) rather than in gcc.  I believe it is used when a
.align directive is given in an executable segment.  When optimizing,
GCC has been aligning some loops on cache line boundaries for some
time (by inserting nop padding BEFORE the loop), but previously, the
assembler was filling with various N-byte NOPs that would work on any
x86.  It has been improved to pick faster ones on modern hardware.
The relevant code is in gas/config/tc-i386.c, function
i386_align_code().  I haven't pinned down the actual code change that
bit us, and perhaps it's just the change in -march and/or -mtune
options used by Fedora when calling gcc.  Gas is careful to only use
NOPs that are compatible with the specified instruction set, if one is
specified -- but Fedora is specifying the wrong one for our purposes.

	John







More information about the Devel mailing list