lkml.org 
[lkml]   [2006]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: i386 ABI and the stack


On Fri, 23 Jun 2006, Albert Cahalan wrote:
>
> Exactly how is an access below %esp a bug if we just added support?

It's always a bug on x86.

Signal handlers will overwrite the stack, so if you use the stack before
decrementing the stack pointer, you're fundamentally screwed.

The "enter" (and "pusha" etc) instructions are special and magical,
because they _will_ decrement the stack pointer atomically if they
succeed.

> It seems that we're throwing away performance if we discourage
> the compiler from taking advantage of this area to optimize
> leaf functions and perhaps improve instruction scheduling.

We always have. It's the x86 ABI.

The x86-64 ABI has a 128-byte(*) zone that is safe from signals etc, so
you can use a small amount of stack below the stackpointer safely. Not so
on x86.

Linus

(*) That "128 byte" is from memory. Maybe it's bigger.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.035 / U:0.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site