add user-defined load/unload hook support

This commit enables the ability to create user-defined hooks as part of
the normal code patch that can do preparatory work for the application
of the patch.  This work could include, but is not limited to, changing
data structure semantics.

The user may define a new function as part of the patch and mark it as a
load-time or unload-time hook with the kpatch_load_hook() and
kpatch_unload_hook() macros.  These macros are in an include file that
gets copied into the source tree at include/linux/kpatch-hooks.h at
patch build time. The signature for both hooks is "int kpatch_unload_hook(void)".

For now, the return code is ignored.  The hooks may not fail.  They also
run in stop_machine() context and may not sleep.  These hooks, more or
less, must follow all the rules of interrupt context code.
create-diff-object: create __mcount_loc section

For ftrace to be able to trace a patched function, it requires that the
__mcount_loc section contains a pointer to the function, and that the
first instruction of the function is "callq __fentry__".

Normally that work is done by the recordmcount script, but it ignores
functions that aren't in a few standard sections (.text and a few
others).
kpatch-build: add debian support
kpatch-build: fix SUBLEVEL in the Makefile
kmod/core: ftrace function_graph tracer compatibility

Steven Rostedt recommended to return "regs->ip + MCOUNT_INSN_SIZE",
which is what the function_graph tracer expects.  This fixes
function_graph tracing for a patched function.

This change also means that the function tracer will only show the
patched function once (corresponding to a trace of the original
function) rather than twice.  This is probably more in line with what a
user would expect.
Merge pull request #283 from jpoimboe/mcount

create-diff-object: create __mcount_loc section
fixup review comments

Signed-off-by: Seth Jennings <sjenning@redhat.com>
Merge pull request #278 from spartacus06/user-hook-support-v2

add user-defined load/unload hook support
kpatch-build: merge the ubuntu and debian section
Merge pull request #285 from goldyfruit/master

kpatch-build: add debian support
kpatch-build: gcc version checks

Ensure the version of the locally installed gcc matches the one used to
compile the kernel, and is >= 4.8.

Fixes #246.
Merge pull request #286 from jpoimboe/check-gcc-version

kpatch-build: gcc version checks