stack size limit on ppc/ppc64

Segher Boessenkool segher at kernel.crashing.org
Wed Nov 5 23:09:07 EST 2003


Alan Modra wrote:
> But I fail to see how allowing something like the following to
> extend the stack helps meet that aim.
>
>  lis 9,-10
>  stbux 3,1,9
>
> That stbux is just a wild write that also happens to fiddle with r1.
> It's _not_ a valid stack frame allocation, which must store the old
> value of r1, hence must use stwu or stwux (*) on ppc32 and stdu or stdux
> on ppc64.  A byte or half-word write is just too small.

That is if you are assuming one of the current ABIs; there are
other ways to restore the stack pointer, so it's possible to
define an ABI for which this would work just fine (or an
assembler program that doesn't care about ABIs at all, or whatnot).
It's not the kernel's job to enforce an ABI.

Or does the kernel actually *need* stack back-links?


Segher


** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list