Merge pull request #60 from jpoimboe/fix-bash-x

kpatch-build: fix SCRIPTDIR for bash -x
Merge pull request #61 from jpoimboe/patch-compile-fail-log

kpatch-build: add patch compile failure output to log
kmod/core: remove assembler code

Long ago, the kpatch_trampoline required being written in assembler, but
that's no longer needed now that it integrates nicely with ftrace.

Move it to a C function and rename it kpatch_ftrace_handler.
kmod/core: update module comments
kmod/core: remove ftrace hacks

These hacks were from a previous implementation and are no longer
needed.
kmod/core: remove comments about preemption

Preemption shouldn't cause a problem with determining activeness safety.
Even if a thread is preempted, it'll be on the backtrace.

We may need to disable preemption when reading the kpatch_funcs array,
but I'm removing that comment for now because the kpatch_funcs array
will soon be replaced by a much better data structure, and we'll deal
with proper synchronization then.
kmod/core: remove sync_core comment

No need to call sync_core() since we aren't directly modifying any code.
kmod/core: handle kmalloc errors and fix leak
kmod/core: remove unused old_func_name field

Not needed, we can always add it again later if needed (for sanity
checks, maybe)
kmod/core: print module load/unload messages

Print the loading/unloading messages after they have successfully
completed.  Using the KERN_NOTICE log level which corresponds to a
"normal but significant condition."
kmod/core: remove obsolete kpatch_rela struct
kmod/core: move kpatch_remove_patch

Just move kpatch_remove_patch to a more logical location next to
kpatch_apply_patch.  No functional changes.
kmod/core: rename some variables

For the sake of consistency and readability, rename some variables.
Also change func->old_addr_end to func->old_size.
kmod/core: update API and use hash table

My apologies for the size of this commit.  I combined these two features
(updating API and using a hash table) into a single commit because their
implementations are tightly coupled and I didn't want to have to add
support for the old kpatch_funcs array with the new API just for the
sake of splitting up the commit :-)

- Update the core module API to get a more clear separation between core
  module and patch module.  This is cleaner and will help our case for
  getting the core module merged upstream into the kernel.
- Convert the old kpatch_funcs array into a hash table.  This is so much
  nicer performance-wise and everything-else-wise than that ugly old
  array.
- Do the incremental patching in stop machine.  This ensures that the
  funcs hash is up to date and we don't miss anything.
- Disable preemption in the ftrace handler when accessing the func hash.
  That way we don't get conflicts with the stop_machine handler updating
  the hash.