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>
Add functions to backtrace into a non-text buffer

Separate text translation from capture of the backtrace

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Rename backtrace.c to stack.c and move stack related bits

 ... from util.c to stack.c

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Capture backtraces when measuring stack depth

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Fix backtraces

__builtin_frame_address really wants constants

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Remove useless global include memory.h

It only exposed one function that is local to the hdat stuff

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Add symbolic backtraces and expose skiboot map to Linux

We use a double link technique, doing a first pass with a .o containing
a dummy symbol map, then re-linking with a new .o

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
core/test: Fix timer test case

Commit b54d1a8 broke timer test case.

core/test/run-timer.c: In function ‘main’:
core/test/run-timer.c:52:3: error: too few arguments to function ‘check_timers’
check_timers();
      ^
In file included from core/test/run-timer.c:16:0:
core/test/../timer.c:201:6: note: declared here
void check_timers(bool from_interrupt)
      ^
make: *** [core/test/run-timer] Error 1

This patch fixes above compilation issue.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
opal: Remove machine check interrupt patching in OPAL.

Now that we catch/handle machine check interrupt directly in Linux host
PowerNV kernel, we are not anymore dependent on OPAL firmware to do MCE
handling job for us. The MCE handling code in OPAL has exclusive stack
space (4k size) reserved and remains unused with Linux host not being
dependent on it anymore. Hence, this patch removes the code that allows
machine check interrupt patching in OPAL and reclaims back 4k of stack
space for use of normal stack. For older kernel the patching request
will result into an error.

The subsequent patch will remove the rest of MCE handling code from OPAL.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
opal: Remove MCE handling code.

Removed following:
- Machine check handle and other related routines.
- per-cpu MCE event used to record machine check data
	cpu_thread->mc_event;
- Machine check related definition including mce event structure from
  include/opal.h
- A comment above GET_STACK() #define that warns about runtime modification
  made to GET_STACK macro by MC patching code.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Merge remote-tracking branch 'ltcgit/master'