Commit Graph

11 Commits

Author SHA1 Message Date
Josh Poimboeuf
add37f3f44 add-patches-section: detect no patched functions 2014-03-19 17:46:53 -05:00
Josh Poimboeuf
bfad3b1880 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.
2014-03-18 13:34:15 -05:00
Seth Jennings
ca55dcc5ad add TODO to de-dup code
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-03-18 11:44:17 -05:00
Seth Jennings
e3d2a68db3 remove obsolete comments
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-03-18 11:44:08 -05:00
Seth Jennings
3ac06ee128 remove dead code
Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-03-18 11:38:55 -05:00
Seth Jennings
75ceca4f33 add file hint to add-patches-section
Currently, add-patches-section just blindly looks in vmlinux
for a function symbol matching the name of the patched function
in the input object file.  However, for local symbols, they may
appear multiple times in the vmlinux symbol table since the symbol
name may be reused locally in different files.

This commit add support for "file hinting".  It tracks what
file the symbol is in and searches for local symbols within
that file in vmlinux first.  If it doesn't find one, it then
searches globally like it always has.

Fixes issue #53

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-03-18 11:38:55 -05:00
Josh Poimboeuf
c164649d4e 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.
2014-03-14 20:23:12 -05:00
Josh Poimboeuf
693426b5ef enable gcc warnings and fix all warnings 2014-03-05 09:46:10 -06:00
Josh Poimboeuf
330a08dd0d add GPLv2 headers to source files 2014-03-04 21:34:19 -06:00
Seth Jennings
084cbeaa80 iterate the iterator
It works better this way.  Trust me.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-02-18 16:17:21 -06:00
Josh Poimboeuf
4f27b9ae31 functional reorganization
Organize the files functionally:
- kmod/core: core kmod source
- kmod/patch: patch kmod source
- kpatch: kpatch script
- kpatch-build: kpatch build script and supporting tools
- contrib: distro-related files
2014-02-13 11:00:06 -06:00