Alternative option for solving Fedora i686 vs geode problems

Paul Fox pgf at laptop.org
Mon Jun 7 22:07:07 EDT 2010


john wrote:
 > 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.

there's a wonderful irony in that, given all of the performance
issues our laptops face, our big worry this week is the cost
of doing nothing at all.  :-)

i agree with john -- we should definitely try the kernel emulation,
and try and gather some statistics on how often it fires, or other
easy metric.  i'll bet the cost is low.

paul

 > 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
 > 
 > 
 > 
 > 
 > _______________________________________________
 > Devel mailing list
 > Devel at lists.laptop.org
 > http://lists.laptop.org/listinfo/devel

=---------------------
 paul fox, pgf at laptop.org



More information about the Devel mailing list