[PATCH] s390: kernel stack options.
This adds support for the new compiler options -mkernel-backchain, -mstack-size, -mstack-guard, -mwarn-dynamicstack and -mwarn-framesize. The option -mkernel-backchain enables the use of modified layout for the stack frames of kernel functions. This breaks the ABI, modules compiled with the option won't work on a kernel compiled with the option and vice versa. The positive effect of the option is a drastic reduction of kernel stack use. The trick is that the new frame layout allows to overlap the 96 (31 bit)/160 (64 bit) byte bias areas of the functions on the call chain. This lowers the minimal stack usage of a function from 96 bytes to 16 bytes (31 bit) and 160 bytes to 24 bytes (64 bit). The kernel stack use is decreased to a point where it is possible to use 4K (31 bit) / 8K (64 bit) stacks. The split into process stack and interrupt stack is already in place. The options -mstack-size and -mstack-guard are used to detect kernel stack overflows. The compiler adds code to the prolog of every function that causes an illegal operation if the kernel stack is about to overflow. The options -mwarn-dynamicstack and -mwarn-framesize cause the compiler to emit warnings if a function uses dynamic stack allocation or if the function frame size is bigger then a specified limit. To play safe all the new options are configurable. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment