Commit Graph

1578 Commits

Author SHA1 Message Date
Josh Poimboeuf
72103a178c create-diff-object: add __FUNCTION__ variables to the special static list
As discovered in #918, the `__FUNCTION__` static local variable is
similar to the `__func__` variable, in that it refers to the current
function name.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2018-10-17 21:08:30 -05:00
Joe Lawrence
7305d6c29a
Merge pull request #913 from joe-lawrence/v0.6.2
Patch release v0.6.2
2018-10-02 10:35:15 -04:00
Joe Lawrence
4208171719 Patch release v0.6.2
Create a minor release that includes fixes for:

- ppc64le: relax .text section addralign value check
- gcc8: unit-tests
- gcc8: support parent/child symbol relations
- gcc8: handle functions changing subsection
- gcc8: consider ".text.hot" sections bundleable
- kpatch-build: bugfix for less aggressive clean build-cache
- ubuntu: remove "-signed" substring from the kernel source package name
- ubuntu: explicitly note elfutils dependency
- upstream 4.18: unit-tests
- upstream 4.18: KCFLAGS -mcount-record support support
- RHEL-8: don't care who provides yumdownloader
- RHEL-8: account for quirky SRPM / release name conventions

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2018-10-02 09:51:13 -04:00
Joe Lawrence
b2f5bc577c
Merge pull request #909 from sm00th/symtab_read-fixes
Symtab read fixes
2018-09-21 10:09:25 -04:00
Joe Lawrence
ded02df5a1
Merge pull request #901 from sm00th/tint
Integration test improvements
2018-09-21 10:08:24 -04:00
Artem Savkov
f5679c9780 symtab_read: support entries with blank names
symtab_read() would previously skip entries with blank names resulting
in some of important entries being skipped. For instance vmlinux file
has an STT_FILE entry at the end with a blank name that contains global
offset table. Because it was skipped all of the global entries from this
table were considered a part of previous processed file resulting in
create-diff-object failing in find_local_syms().

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-09-20 16:06:29 +02:00
Joe Lawrence
d95be2f168
Merge pull request #905 from sm00th/unitupd
Unit test submodule update
2018-09-13 17:17:29 -04:00
Artem Savkov
f7cfe25e8a symtab_read(): fix SECTION detection in symtab_read
symtab_read has been checking a wrong field for "SECTION". Switch the
field from "bind" to "type".

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-09-12 16:31:58 +02:00
Artem Savkov
b746182847 Unit test submodule update
Bump unit-test-objs submodule head pointer to include latest test:

f82c458 x86_64: added a test for a function that uses _THIS_IP_
4a097d9 ppc64le: Test const var requiring .data.rel relocation

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-09-12 09:50:29 +02:00
Joe Lawrence
f3ff4043fc
Merge pull request #904 from euspectre/special-vars-ppc-typo
kpatch-build: ppc64le - fix a typo in find_special_section_data_ppc64le
2018-09-11 11:21:13 -04:00
Evgenii Shatokhin
0215587ad1 kpatch-build: ppc64le - fix a typo in find_special_section_data_ppc64le
Nothing critical, but find_special_section_data_ppc64le() could run
longer than needed: the exit condition was not met after all the values
had been found.

Fixes: 77f8fd09 "kpatch-build: ppc64le - Add special section support"
Signed-off-by: Evgenii Shatokhin <eshatokhin@virtuozzo.com>
2018-09-11 13:21:14 +03:00
Artem Savkov
5371d9f972 kpatch-test: remove -SLOW special cases
Treat -SLOW patches the same way as normal ones, i.e. include them
during "quick" testing. Keeping "-SLOW" suffix in patch names to as a
way to distinguish them manually.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-09-10 10:01:16 +02:00
Artem Savkov
80f78c78bb test/integration: skip -SLOW load tests in combined run
We are not including -SLOW patches into combined module, so there is no
reason to expect their -LOADED tests to succeed with combined module.
Skip them in run_combined_test().

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-08-23 09:23:50 +02:00
Artem Savkov
1a91e256ff test/integration: run -FAIL tests when invoked with --quick
Include -FAIL tests as well as combined in 'quick' target.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-08-23 09:23:30 +02:00
Artem Savkov
6cbf55d77b test/integration: include build log on failures
If a patch build fails copy the build log to <prefix>.log file.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-08-23 09:23:03 +02:00
Joe Lawrence
3a45a6ebb3
Merge pull request #900 from kamalesh-babulal/data_rel
create-diff-object.c: Extend is_bundleable()
2018-08-07 09:28:48 -04:00
Joe Lawrence
542ae14676
Merge pull request #898 from joe-lawrence/kpatch-build-rhel8
kpatch-build: update for RHEL / CentOS 8
2018-08-07 09:24:51 -04:00
Kamalesh Babulal
5b690b28bf create-diff-object.c: Extend is_bundleable()
GCC puts the constant variable requiring relocation into .data.rel. or
.data.rel.ro depending upon the bind type of the symbol. Extend
is_bundledable() to check these .data sections too.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2018-08-06 14:09:43 +05:30
Joe Lawrence
bc268c60e1 kpatch-build: update for RHEL / CentOS 8
- Future releases of RHEL / CentOS will provide the yumdownloader
  program with the 'dnf-utils' package (not 'yum-utils').  Instead of
  looking to see that the package is installed, just look for the
  program itself.

- RHEL / CentOS 8 kernel release names (as returned by 'uname -r') may
  not match the SRPM buildroot release subdirectory name.  Relax the
  wildcard when moving this directory to $SRCDIR.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2018-07-31 16:26:59 -04:00
Joe Lawrence
8eb1d23713
Merge pull request #897 from sm00th/mrecord-mcount
create-diff-object: -mcount-record support
2018-07-27 09:14:53 -04:00
Artem Savkov
41f025d392 Include mrecord-mcount unit tests
Update objs-repo pointer to include new unit tests.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-26 16:51:28 +02:00
Artem Savkov
19c4b52105 create-diff-object: -mcount-record support
4.18 adds -mcount-record to KBUILD_FLAGS when supported by the compiler.
This results in most of kpatch_create_mcount_sections()'s work being
already done, so we can at least skip the last part of it that updates
the first instruction in patched functions.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-26 16:51:24 +02:00
Joe Lawrence
13d8267a0d
Merge pull request #896 from buytenh/ubuntu-fixes
ubuntu fixes
2018-07-25 13:13:59 -04:00
Lennert Buytenhek
9ce3e3c090 readme: explicitly include elfutils dependency for Ubuntu
Without this, kpatch-build bombs out because it cannot find eu-readelf.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
2018-07-25 14:59:56 +03:00
Lennert Buytenhek
932e0377bd kpatch-build: Ubuntu signed/unsigned kernel image package fix
In Ubuntu 18.04 LTS (but not in 16.04 LTS), the "linux" source package
no longer builds the "linux-image-*" binary kernel image packages
directly, but instead, it produces the "linux-image-unsigned-*" binary
packages, and the "linux-signed" source package then produces the
(signed) "linux-image-*" binary packages from the unsigned binaries.

This means that querying the target kernel's linux-image-* package for
its source package will yield a source package that is just a wrapper,
and does not actually contain the kernel source code.

Deal with this by removing the "-signed" substring from the kernel
source package name if it is present.  This makes kpatch-build work
on Ubuntu 18.04.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
2018-07-25 14:59:56 +03:00
Joe Lawrence
b974770197
Merge pull request #881 from sm00th/gcc8-opts
gcc8 fixes
2018-07-18 08:56:54 -04:00
Joe Lawrence
08cc21025a
Merge pull request #894 from jpoimboe/fix-clean-cache
kpatch-build: fix clean_cache
2018-07-18 08:54:35 -04:00
Josh Poimboeuf
0655ca50b8 kpatch-build: fix clean_cache
Commit d86c1113cc ("kpatch-build: less aggressive clean_cache()")
broke clean_cache().  Instead of expanding the wildcard, it tries to
delete a file named '*'.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2018-07-17 15:43:43 -05:00
Artem Savkov
7cb5baccde Include gcc8 unit-tests
Update submodule pointer to include new gcc8 unit tests.

This update also includes unit-test for https://github.com/dynup/kpatch/pull/892

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-13 09:39:26 +02:00
Artem Savkov
61839832ed create-diff-object: propagate ignore.functions to children
Add child symbols to .kpatch.ignore.functions in case their parents are
added to the list.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-13 09:39:26 +02:00
Artem Savkov
2ac1387701 create-diff-object: add .text.hot to the list of bundleable functions
According to gcc8's man pages gcc can put functions into .text.unlikely
or .text.hot subfunctions during optimization. Add ".text.hot" to the
list of bundleable functions in is_bundleable().

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-13 09:39:26 +02:00
Artem Savkov
35cc6ff016 create-diff-object: allow changing subsections
gcc8 can place functions to .text.unlikely and .text.hot subsections
during optimizations. Allow symbols to change subsections instead of
failing.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-13 09:39:21 +02:00
Artem Savkov
246c6e2ae7 create-diff-object: propagate child symbol changes
Propagate child symbol changes to it's parent.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-13 09:38:15 +02:00
Joe Lawrence
cd352cf8a8
Merge pull request #892 from kamalesh-babulal/addr_align
create-diff-object: Relax sh_addralign check for .text sections
2018-07-11 14:31:47 -04:00
Artem Savkov
73a278c2b6 create-diff-object: child symbol skips
Skip profiling calls checks for child symbols and don't include them in
output or .kpatch.funcs.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-11 09:57:54 +02:00
Artem Savkov
bd2589530c create-diff-object: add symbol relations
Add a function that would detect parent/child symbol relations. So far
it only supports .cold.* symbols as children.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-07-11 09:57:31 +02:00
Kamalesh Babulal
09fdb0772d create-diff-object: Relax sh_addralign check for .text sections
.text section addralign value might change between original and
patched .o files, for a loop() such as:

for (i = 0; i < sections_per_block; i++) {
	remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
	base += MIN_MEMORY_BLOCK_SIZE;
}

On ppc64le, which translate to:

  f0:   78 1b 7b 7c     mr      r27,r3
  f4:   6c 00 9d 40     ble     cr7,160 <pseries_remove_memblock+0x158>
  f8:   ff ff 9c 3b     addi    r28,r28,-1
  fc:   38 00 a1 fb     std     r29,56(r1)
 100:   00 01 bf 3f     addis   r29,r31,256
 104:   08 c2 9c 7b     rldic   r28,r28,24,8
 108:   14 ea 9c 7f     add     r28,r28,r29
 10c:   14 00 00 48     b       120 <pseries_remove_memblock+0x118>
 110:   00 00 00 60     nop
 114:   00 00 00 60     nop
 118:   00 00 00 60     nop
 11c:   00 00 00 60     nop
 120:   78 fb e4 7f     mr      r4,r31

.LVL174:
        rldic 28,28,24,8         #, tmp198, tmp196,
        add 28,28,29     # _45, tmp198, base
        .p2align 5,,31

Patch removing such loop, changes the section alignment boundary. Given
that alignment changes to .text section are not fatal, relax the check
for text sections.

Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2018-07-04 08:41:00 +05:30
Joe Lawrence
2f3db2abe9
Merge pull request #890 from kamalesh-babulal/readme
readme: Update gcc-plugin-devel dependency
2018-06-28 11:15:03 -04:00
Kamalesh Babulal
acf33455a3 readme: Update gcc-plugin-devel dependency
Update gcc-plugin-devel package dependency for livepatch
modules on ppc64le.

Fixes #888.

Suggested-by: Joe Lawrence <jdl1291@gmail.com>
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
2018-06-22 10:07:32 +05:30
Joe Lawrence
7f550f01bd
Merge pull request #858 from joe-lawrence/release-v0.6.1
Patch release v0.6.1
2018-06-21 11:02:17 -04:00
Joe Lawrence
57def40805 Patch release v0.6.1
Create a minor release that includes fixes for:

* increase the transition timeout, helpful for large CPU count systems
* ppc64le WARN macro detection
* .parainstructions-related panic fix
* many, many unit/integration test cleanups and improvements
* properly align .parainstructions sections in patch module
* remove 'immediate' flag support from RHEL-7.6 onward
* initial GCC 8 support bugfixes
* support for RHEL kernel-alt release
* misc kpatch-build fixes and optimizations

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2018-06-20 16:15:09 -04:00
Joe Lawrence
2639b8441a
Merge pull request #889 from joe-lawrence/kpatch-build-misc2
Kpatch build misc fixes, round 2
2018-06-20 14:44:00 -04:00
Joe Lawrence
4d1ee7f80a kpatch-build: fix RHEL-ALT kernel version detection
kpatch-build detects RHEL-ALT kernel support by looking for a ".el7a."
substring in the kernel release string.  Look for that substring in the
unchanged $ARCHVERSION instead of $KVER, which may not have the
trailing '.' character that our regex expects.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2018-06-20 10:37:05 -04:00
Joe Lawrence
bc28b576ed kpatch-build: drop architecture spec from source rpm request
Source RPMs don't have an architecture associated with them, so to avoid
confusion, drop that part of the kernel release string when calling
yumdownloader.

Fixes #887.

Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
2018-06-20 10:15:49 -04:00
Joe Lawrence
7dc6e5f215
Merge pull request #886 from sm00th/safe_cleancache
kpatch-build: less aggressive clean_cache()
2018-06-19 09:30:07 -04:00
Joe Lawrence
d3ed66a103
Merge pull request #885 from rudis/shellcheck
kpatch-build: fix shellcheck warnings
2018-06-19 09:29:47 -04:00
Joe Lawrence
d0ced9760d
Merge pull request #884 from rudis/master
create-diff-object: prevent "'toc_data1' may be used uninitialized" warning
2018-06-19 09:29:24 -04:00
Joe Lawrence
123e7d5603
Merge pull request #883 from sm00th/awkfix
kpatch-build: fix find_special_section_data with blank AWK_OPTIONS
2018-06-19 09:29:02 -04:00
Joe Lawrence
89257f937e
Merge pull request #882 from joe-lawrence/kpatch-build-misc
kpatch-build misc fixups
2018-06-19 09:28:20 -04:00
Artem Savkov
d86c1113cc kpatch-build: less aggressive clean_cache()
Some of the provisioned machines I sometimes use don't have enough
diskspace for a full kpatch-patch build in home partition. I usually
solve this by symlinking .kpatch(and .ccache) dirs to a different
partition, however this only works with -s option because of
clean_cache().

clean_cache() currently removes .kpatch directory completely, recreating
it from scratch, change it to only remove the contents of the directory
instead.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-06-18 18:15:05 +02:00