Andi Kleen wrote: > On Wed, Sep 14, 2005 at 07:55:53AM -0700, Linus Torvalds wrote: >> >>On Wed, 14 Sep 2005, Daniel Jacobowitz wrote: >> >>>The comment for the relevant bits of the GCC configuration says it won't >>>assume this for x86, but I believe that comment is out of date. I think >>>it'll assume 16-byte alignment on entrance to non-main() functions. >> >>Well, that's kind of the point. We _do_ have the stack aligned on >>entrance, but it looks like gcc wants it _non-aligned_. It seems to want >>it offset by the "return address push" - ie it seems to expect that it was >>aligned before the "call", but entry into the next function will thus >>_never_ be aligned. >> >>So the kernel actually seems to have it _too_ aligned right now. > > > Yes it's wrong. I would recommend to apply Markus' patch for i386 > and x86-64. > > -Andi Here is a somewhat simplified version of my previous patch with updated comments. Attached is also a new small user-space test program which does not depend on any special gcc features and should trigger the problem on all machines. ~Markus P.S. I have not been involved in lkml back since 1999, so I currently don't know whom to bug to get this patch applied, esp. as there seems to be no official i386 maintainer. -- Markus Oberhumer, , http://www.oberhumer.com/