diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-11-17 18:22:04 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-11-17 18:22:04 +1100 |
commit | 71664fd8d2d2550a56cc6a9c2b81797bfe90d613 (patch) | |
tree | 6f55e009ff6a8b00f9f1c7a905ad4075225dec93 /include/stack.h | |
parent | 31d20fc02c8ee7c12d84bc28ce732bbc362ce369 (diff) | |
download | skiboot-71664fd8d2d2550a56cc6a9c2b81797bfe90d613.zip skiboot-71664fd8d2d2550a56cc6a9c2b81797bfe90d613.tar.gz skiboot-71664fd8d2d2550a56cc6a9c2b81797bfe90d613.tar.bz2 |
Stack checking extensions
This patch adds:
- Normal builds are done with -fstack-protector (we want to investigate
using -fstack-protector-strong on gcc4.9 but for now we just use that
- Build with STACK_CHECK=1 will use -fstack-protector-all and -pg and
will check the stack in mcount
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include/stack.h')
-rw-r--r-- | include/stack.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/stack.h b/include/stack.h index 6eedc01..57771b4 100644 --- a/include/stack.h +++ b/include/stack.h @@ -17,6 +17,8 @@ #ifndef __STACKFRAME_H #define __STACKFRAME_H +#include <mem-map.h> + #define STACK_ENTRY_OPAL_API 0 /* OPAL call */ #define STACK_ENTRY_MCHECK 0x0200 /* Machine check */ #define STACK_ENTRY_HMI 0x0e60 /* Hypervisor maintainance */ @@ -39,6 +41,16 @@ /* Offset to get to machine check CPU stacks */ #define CPU_MC_STACKS_OFFSET (CPU_STACKS_BASE + STACK_SIZE - STACK_TOP_GAP) +/* Gap below the stack. If our stack checker sees the stack below that + * gap, it will flag a stack overflow + */ +#define STACK_SAFETY_GAP 512 + +/* Warning threshold, if stack goes below that on mcount, print a + * warning + */ +#define STACK_WARNING_GAP 1024 + #ifndef __ASSEMBLY__ #include <stdint.h> |