Replace module-call-external.patch with a more fleshed-out version which
tests multiple things (including jump tables for newer kernels), and
also includes a runtime test.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Disabling the test case, until we find a workaround for functions
with the static key getting inlined. Read the comments from
@joe-lawrence in #1086 for detailed analysis.
Suggested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Update the rebase_patches hack^H^H^H tool to make it easier to define
environment variables to drive it, rather than sourcing source
/etc/os-release for everything. Fix a bunch of shellcheck warnings
along the way.
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
Fetch pull-request data before resetting to a specified commit. This
will allow us to run integration tests on pull-request using master
repo, without cloning the original.
Signed-off-by: Artem Savkov <asavkov@redhat.com>
The gcc-static-local-var-4.patch and test check that unmodified
functions that contain dynamic debugging printk's aren't incorrectly
included in the resulting livepatch .ko.
Note that on RHEL-7.7 ppc64le, the gcc-static-local-var-4.ko livepatch
module may include klp-relocation references to free_ioctx(), a function
that would match the above criteria. These klp-relocation symbols are
OK as they are only used for referencing said functions, they are not
copies that the check should FAIL on.
Modify gcc-static-local-var-4.test in a few ways:
- Use eu-readelf instead of readelf, which some versions have problems
handling klp-relocations.
- Set pipefail to catch any errors in the symbol table dump (missing
elfutils, etc.)
- Instead of a grep regex, use awk to string compare exact function
and module names. This avoids matching on .klp.sym prefixed
klp-relocation symbols.
Fixes#1069.
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
We recently disabled building kmod by default, make sure fedora-27 (and
others before fc30) integration tests still build that.
Signed-off-by: Artem Savkov <asavkov@redhat.com>
These patches cause the following error on ppc64le on both 7.7 and 7.6:
create-diff-object: ERROR: export.o: kpatch_no_sibling_calls_ppc64le: 3290: Found an unsupported sibling call at e_show()+0x100. Add __attribute__((optimize("-fno-optimize-sibling-calls"))) to e_show() definition.
Adding -fno-optimize-sibling-calls breaks build on x86_64, so limit it
to ppc64le only.
Signed-off-by: Artem Savkov <asavkov@redhat.com>
ccache version in epel updates from time to time so instead of
using a direct link install epel repo and install ccache without
specifying the version.
Suggested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Artem Savkov <asavkov@redhat.com>
The current code to find the twin of a local static variable allows two
variables of the same name to be wrongly matched with the other's twin.
While there isn't a magic formula to avoid this, make stricter
requirements for twining static local from the original object with
a symbol from the patched object. This reduces the risk of erroneous
matches.
Signed-off-by: Julien Thierry <jthierry@redhat.com>
new-function test fails on ppc64le with the following message:
create-diff-object: ERROR: n_tty.o: kpatch_no_sibling_calls_ppc64le: 3445: Found an unsupported sibling call at n_tty_write()+0x20. Add __attribute__((optimize("-fno-optimize-sibling-calls"))) to n_tty_write() definition.
Add the suggested attribute, as was done for rhel-7.[5-7] versions of
the test.
Signed-off-by: Julien Thierry <jthierry@redhat.com>
On ppcle64, test gcc-static-local-var-4 impacts a jump label reference
which is currently unsupported.
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Jump labels are unsupported, so tests modifying functions using them are
expected to fail. So disable them, for now...
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Rebase the integration test cases on top of RHEL 8.0 kernel version
4.18.0-80.el8.
Suggested-by: Joe Lawrence <joe.lawrence@redhat.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
[JT: adapt data-new-LOADED to new meminfo format,
use common template for multiple.test]
Signed-off-by: Julien Thierry <jthierry@redhat.com>
Disabled patches won't trigger a build, but the combined load test
will still attempt to run their associated LOADED.test script. The
combined test will fail due to voluntarily disabled tests.
Do not run tests scripts associated with disabled tests.
Signed-off-by: Julien Thierry <jthierry@redhat.com>
The unload_all() function in kpatch-test script is out dated and
does not unload patches loaded through livepatching.
Luckily, "kpatch unload --all" should support both kpatch unloading
kpatch patches and livepatch patches.
Signed-off-by: Julien Thierry <jthierry@redhat.com>
If an error occurs while loading a module or one of the tests,
multiple.test will exit leaving the working modules loaded. This leaves
the system in an unwanted state and causes the test that previously pass
to fail (succeeding before being loaded for multiple.test's point of
view).
Cleanup the loaded modules before exiting due to errors.
Also take this opportunity to factorize the test for the different
distros.
Signed-off-by: Julien Thierry <jthierry@redhat.com>
The RHEL powerpc kernel is compiled with -O3, which triggers some
"interesting" new optimizations. One of them, which seems to be
relatively common, is the replacing of a function with two separate
"constprop" functions.
Previously we only ever saw a single constprop clone, so we just renamed
the patched version of the function to match the original version. Now
that we can have two such clones, that no longer makes sense.
Instead of renaming functions, just improve the correlation logic such
that they can be correlated despite having slightly different symbol
names. The first clone in the original object is correlated with the
first clone in the patched object; the second clone is correlated with
the second clone; and so on.
This assumes that the order of the symbols and sections doesn't change,
which seems to be a reasonable assumption based on past experience with
the compiler. Otherwise it will just unnecessarily mark the cloned
constprop functions as changed, which is annoying but harmless, and
noticeable by a human anyway.
Fixes#935.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
When these from internal depths of Red Hat upstream paths changed and
now we are one level deeper in directory tree.
The issue probably also exist in rhel8.0 rebase pr #993.
Signed-off-by: Artem Savkov <asavkov@redhat.com>
While static keys (jump labels) are currently broken in livepatch, a
broken dynamic debug static key is harmless since it just disables
dynamically enabled debug printks in the patched code.
Fixes: #1021
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Standard centos7 repos don't contain ccache so we have to install it
from epel just like we do on rhel7.
Signed-off-by: Artem Savkov <asavkov@redhat.com>
Now that sibling calls aren't supported in ppc64le, change the RHEL 7.5
and 7.6 versions of the new-function tests to disable the sibling call
optimization.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Use make's .DELETE_ON_ERROR special target to make sure we don't have
any .OUTPUT.o leftovers for failed tests.
Fixes: #999
Signed-off-by: Artem Savkov <asavkov@redhat.com>
The ppc64le unit tests are failing because the lookup code is getting
confused by the "[<localentry>: 8]" string in the readelf symbol table
output.
Remove the string so the lookup code can parse it correctly.
kpatch-build already uses the same sed, so they should match.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>