Commit Graph

879 Commits

Author SHA1 Message Date
Seth Jennings
8efd704b51 Merge pull request #446 from flaming-toast/issue430
Fix #430 by copying original modules to TEMPDIR
2014-10-06 11:31:55 -05:00
Jessica Yu
09c39932b1 kpatch-gcc: for module patches, copy module to temp dir
For patches involving modules, copy the original module(s) to
TEMPDIR so that create-diff-object can create the correct lookup
tables
2014-10-06 01:05:36 -07:00
Seth Jennings
6175658196 Merge pull request #441 from jpoimboe/module-shadow
allow shadow functions to be called from modules
2014-10-02 23:22:26 -05:00
Seth Jennings
c6506ec549 Merge pull request #436 from jpoimboe/descriptor
make "descriptor" a special static local variable
2014-10-02 23:11:00 -05:00
Josh Poimboeuf
ea445c0333 allow shadow functions to be called from modules
Fixes an issue where attempting to call the shadow functions from a
module results in modpost failures:

    ERROR: "kpatch_shadow_get" [net/mac80211/mac80211.ko] undefined!
    ERROR: "kpatch_shadow_alloc" [net/mac80211/mac80211.ko] undefined!

LDFLAGS_MODULE is apparently not really needed.
2014-10-02 13:31:48 -05:00
Josh Poimboeuf
629b2eaa26 Merge pull request #439 from spartacus06/skip-gcc-check
Allow user to skip gcc version check
2014-10-01 15:46:42 -05:00
Seth Jennings
12e77bab46 fix usage formatting 2014-10-01 15:40:57 -05:00
Seth Jennings
b8c582f2ee Merge pull request #438 from jpoimboe/no-changed-functions
remove "no changed functions" messages
2014-10-01 14:27:04 -05:00
Seth Jennings
d3abeb667a Allow user to skip gcc version check
Right now, unless the entire gcc version string, including build date
and package version, matches the distro kernel exactly, kpatch-build
won't proceed.

For some distros, it is very difficult to rollback to a previous
version of gcc and keep that version pinned on the system so that the
package manager doesn't update it.

For these user, add a --skip-gcc-check flag to kpatch-build to allow the
version check to be skipped.  If the user does this, it is assumed they
know what they are doing.  This flag is documented as "not recommended".

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-10-01 14:25:02 -05:00
Josh Poimboeuf
51799dff2c remove "no changed functions" messages
When patching a shared header file, don't spam the user with hundreds of
lines of "no changed functions" messages.  We expect the user to be
proactive with verifying that the right functions are being patched
anyway, so this message isn't strictly necessary.
2014-10-01 14:12:25 -05:00
Josh Poimboeuf
ab1b487d90 Merge pull request #437 from spartacus06/cleanup
check that logfile exists before printing message
2014-10-01 14:05:28 -05:00
Seth Jennings
ac452ef175 check that logfile exists before printing message
Don't tell the user to check a log file that doesn't exist

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-10-01 13:29:20 -05:00
Josh Poimboeuf
e27ffadce1 make "descriptor" a special static local variable
The "descriptor" static local variables and their containing __verbose
section are used for dynamic debug printks.  They should be considered
as special static local variable symbols because they have the same
requirements: they should never be correlated and they should only be
included if referenced by an included function.
2014-10-01 11:11:54 -05:00
Josh Poimboeuf
b295c8686e test: improve macro-hooks patch
Restore aio_max_nr to its original value when unloading.

Also move the location of the patch hunk to be not at the end of the
file.  Otherwise we hit a weird combinediff bug which results in the
diff's context being removed.
2014-10-01 11:11:54 -05:00
Seth Jennings
e5dd825f15 Merge pull request #435 from jpoimboe/rhel7-optional-repo
readme: enable RHEL 7 optional repo
2014-09-30 14:15:04 -05:00
Josh Poimboeuf
bd2b499509 readme: get ccache from EPEL for RHEL 7 2014-09-29 21:32:27 -05:00
Josh Poimboeuf
2203cf5b7d readme: enable RHEL 7 optional repo
needed for pesign, newt-devel, pciutils-devel, asciidoc
2014-09-29 21:21:43 -05:00
Josh Poimboeuf
cca211067c Merge pull request #434 from useidel/master
added missing options -v, -t and -d
2014-09-26 23:43:15 -05:00
Udo Seidel
6c73bc3652 added missing options -v, -t and -d 2014-09-26 19:12:45 +02:00
Josh Poimboeuf
f69d258c0b Merge pull request #433 from spartacus06/fixup-makefile
improve kpatch-build Makefile
2014-09-24 22:04:48 -05:00
Seth Jennings
8b1ae48d7c improve kpatch-build Makefile
Right now, the makefile has one target, create-diff-object, which
contains all the source/headers as one long list and all the source
files compiled in one command to make create-diff-object.

This doesn't scale well and doesn't accurately portray the dependencies
of each object that contribute to the final binary.

This commit renames create-diff-object.c to main.c so that it can be
compiled and linked seperately and cleanly in Make and autogenerates
dependencies for each .o. This should make it easier to add additional
object files, or refactor the very large main.o into seperate object
file, later.
2014-09-23 09:45:04 -05:00
Seth Jennings
88aae05894 Merge pull request #428 from jpoimboe/full-tree-recompile
full tree recompilation support
2014-09-15 21:22:08 -05:00
Josh Poimboeuf
a20940892a code review fixes 2014-09-15 21:11:13 -05:00
Josh Poimboeuf
46ba72b339 Merge pull request #429 from spartacus06/fix-srpm-regression
fix regression in user-specified source RPM
2014-09-15 21:08:51 -05:00
Seth Jennings
85d7b071ba Merge pull request #427 from jpoimboe/replace-unbundled-references
replace all unbundled section references with symbols
2014-09-15 17:02:19 -05:00
Seth Jennings
18d9e4daa9 fix regression in user-specified source RPM
A recent commit 74316588e is unconditionally setting the SRCRPM path
overwriting a user specified path.

Only set SRCRPM if SRCRPM is not already set.

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-09-15 16:58:22 -05:00
Josh Poimboeuf
1ee3ae669f test: add slow test for rebuilding entire tree
Only gets run with the slow integration tests, not "make quick".
2014-09-15 14:54:59 -05:00
Josh Poimboeuf
33cd945b14 new .fixup group size algorithm
The fixup_group_size() function assumes that all .fixup rela groups end
with a jmpq instruction.  That assumption turns out to be false when you
take into account the ____kvm_handle_fault_on_reboot() macro which is
used by kvm.

This is a new, more reliable method.  It turns out that each .fixup
group is referenced by the __ex_table section.  The new algorithm goes
through the __ex_table relas to figure out the size of each .fixup
group.

Also the .fixup section is now processed before __ex_table, because it
needs to access the original __ex_table relas before the unused ones
have been stripped.

Fixes the following error:

  ERROR: vmx.o: fixup_group_size: 1554: can't find jump instruction in .fixup section
2014-09-15 14:54:57 -05:00
Josh Poimboeuf
dbecef6e91 replace all unbundled section references with symbols
Currently we're checking for several special cases when deciding whether
to convert unbundled section references to their corresponding symbol
references.  We do it for all unbundled text sections as well as three
specific data sections.

There's no reason I can think of for why we shouldn't just do it for
_all_ unbundled sections.
2014-09-15 12:01:34 -05:00
Seth Jennings
a042dc1bbc Merge pull request #426 from jpoimboe/rename-objname-var
rename global "objname" variable to "childobj"
2014-09-15 11:48:39 -05:00
Josh Poimboeuf
bfe7fca5bd rename global "objname" variable to "childobj"
There are two distinct usages of "objname" as a variable name:

- the parent object being patched (e.g. vmlinux)
- the child object being analyzed (e.g. meminfo.o)

The name of the global objname variable conflicts with several
functions' usage of a local objname variable, resulting in some error
messages of e.g., "ERROR: vmlinux:" instead of "ERROR: meminfo.o:".

Rename the global objname variable to childobj.
2014-09-15 11:36:02 -05:00
Josh Poimboeuf
ba7c905b3a process special sections after checking for changes
There's no need to process special sections if we're returning due to no
functions changing.

Also this means we don't have to deal with extra-special usage of the
.fixup section (here's looking at you arch/x86/lib/copy_user_64.S -- we
can't patch functions in .S files anyway).
2014-09-15 11:17:37 -05:00
Josh Poimboeuf
218011b268 kpatch-build: allow two parents unless the object changes
With some obscure drivers, the same object file can be linked into
multiple parent objects.  Only call this out as an error if the object
has changed, otherwise it doesn't matter.

Fixes the following issue:

    ERROR: two parent matches for drivers/media/radio/si470x/radio-si470x-common.o.
2014-09-15 11:17:37 -05:00
Josh Poimboeuf
f5dbd7816e kpatch-gcc: skip vdso files
vdso files aren't kpatch-compatible, and give errors like the following:

    ERROR: invalid ancestor arch/x86/vdso/vdso32-sysenter.so.dbg for arch/x86/vdso/vdso32/sysenter.o
2014-09-15 11:17:37 -05:00
Josh Poimboeuf
8c2792af6c kpatch-build: deep find performance improvement
If we have to do a deep find (e.g. search the entire tree) to find a
parent object, first try searching in the last successful deep find
directory.  This is a performance improvement in the case of a full tree
rebuild, because deep finds are very expensive, and it's not uncommon
for there to be multiple objects in a directory being linked into an
object in another directory.
2014-09-15 11:17:37 -05:00
Josh Poimboeuf
a851517165 kpatch-build: add more ancestors for vmlinux
There are a few more valid ancestors for vmlinux other than built-in.o.
This fixes errors similar to the following:

    ERROR: invalid ancestor arch/x86/lib/lib.a for arch/x86/lib/usercopy_64.o
2014-09-15 11:17:37 -05:00
Josh Poimboeuf
5cce81f49b kpatch-gcc: properly quote arguments
Fixes an error when the following is an argument to gcc:

'-DIPATH_IDSTR="QLogic' kernel.org 'driver"'

gcc: error: kernel.org: No such file or directory
gcc: error: driver": No such file or directory
2014-09-15 11:17:37 -05:00
Seth Jennings
43ca05e5b1 Merge pull request #425 from jpoimboe/fedora-src-rpm-koji-2
kpatch-build: download fedora src rpms from koji
2014-09-15 11:15:46 -05:00
Josh Poimboeuf
d254d3d0f2 fix review comments
Use the wget -P option.
2014-09-15 11:12:11 -05:00
Josh Poimboeuf
74316588e8 kpatch-build: download fedora src rpms from koji
yumdownloader is problematic because it doesn't allow you to download
anything but the latest released kernel.  It can also be slow at times.
Instead, for Fedora, download the RPMs from koji.
2014-09-15 11:12:11 -05:00
Josh Poimboeuf
6176353f8d kpatch-build: add KVER and KREL variables
Add KVER and KREL variables, and use them where appropriate.  Also
remove the setting of ARCHVERSION in the '-s' case, since it's not
actually used anywhere in that case.
2014-09-15 11:11:25 -05:00
Seth Jennings
29551bd9b5 Merge pull request #424 from jpoimboe/readme-openssl
readme: add openssl to F20 dependencies
2014-09-15 10:56:23 -05:00
Josh Poimboeuf
3b8361333a readme: add openssl to F20 dependencies 2014-09-15 10:47:43 -05:00
Seth Jennings
89edbb2e41 Merge pull request #420 from jpoimboe/special-sections-later
process special sections after inclusion logic
2014-09-12 21:52:29 -05:00
Josh Poimboeuf
d41365fc0e process special sections after inclusion logic
The special sections should be processed after all the other inclusion
logic has run, so that should_keep_rela_group() can work properly.
Otherwise it might remove a needed rela group from a special section.
2014-09-12 14:03:10 -05:00
Josh Poimboeuf
fc3a63bb25 Merge pull request #419 from jpoimboe/fix-integration-tests
fix test conflict
2014-09-12 13:13:34 -05:00
Josh Poimboeuf
dacdfcfd22 fix test conflict
I accidentally added two tests which both create a non-static
kpatch_foo() function, which breaks the combined integration test kernel
build.
2014-09-12 13:12:36 -05:00
Josh Poimboeuf
114b21c7e5 Merge pull request #417 from spartacus06/fix-376
check ARCHVERSION for hyphen before creating localversion
2014-09-11 15:53:43 -05:00
Seth Jennings
fef7a6ede5 check ARCHVERSION for hyphen before creating localversion
If hyphen doesn't exist in uname -r (ARCHVERSION), then it is probably a
non-distro kernel and we don't need to create the localversion file.

Fixes #376

Signed-off-by: Seth Jennings <sjenning@redhat.com>
2014-09-11 15:38:05 -05:00
Seth Jennings
93398c21ca Merge pull request #412 from jpoimboe/key-warned
support for__key and __warned special static local vars
2014-09-11 14:24:49 -05:00