Messages in this thread | | | Date | Sun, 3 Oct 1999 22:12:17 -0500 | From | Linas Vepstas <> | Subject | upwards growing stacks ?? |
| |
Hi,
I've been porting the kernel to the ESA/390 architecture (mainframe) and have had the occasion to rethink the subroutine linkage. In particular, I have some weak reasons to want the stack to grow up, not down. However, the unix tradition & linux in particular usually have the stack grow down. So the questions:
-- is it a bad idea to make the stack grow up? -- has anyone done this before w/ linux? (doesn't seem like it ...)
-- should I do this, or should I stick to the traditional design?
-- I'm making the following mods, will these be sufficient? Are they appropriate? o the expand_stack() inline in include/linux/mm.h assumes the stack grows down, & I will rework it to suit my needs ... o change VM_STACK_FLAGS to grow up as well ... o create a new vma that holds the stack base, out in high-memory, somewhere near TASK_SIZE - current->rlim[RLIMIT_STACK].rlim_cur
Is there anything else I should be concerned with?
--linas
p.s. the upward-growing stack simplifies ever-so-slightly argument passing, and the implementation of alloca. The esa/390 instruction set only supports positive displacements, which is why this is appealing. The only other benefit is that it makes buffer overruns not clobber the stack, and thus provides some stack-smashing safety. Other than security, the other technical reasons for growing up are fairly weak...
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |