On Wed, Sep 17, 2025 at 09:03:08AM -0700, Josh Poimboeuf wrote:
> Changes since v3
> (https://lore.kernel.org/cover.1750980516.git.jpoim...@kernel.org):
>
> - Get rid of the SHF_MERGE+SHF_WRITE toolchain shenanigans in favor of
> simple .discard.annotate_data annotations
&g
For consistency with the other function templates, change
_subtree_search_*() to use the user-supplied ITSTATIC rather than the
hard-coded 'static'.
Signed-off-by: Josh Poimboeuf
---
v4.1: Fixed a couple more INTERVAL_TREE_DEFINE usages.
drivers/infiniband/hw/usnic/usnic_uiom_inter
code have correct cfi/sframe metadata?
In order for it to be "reliable", we need to know the unwind reached the
end of the stack (e.g., the task pt_regs frame, from entry-from-user).
--
Josh
__pa_symbol() generates a relocation which refers to a physical address.
Convert it to back its virtual form before calculating the addend.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/arch/x86/decode.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tools
diff code.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 111 +++-
tools/objtool/include/objtool/elf.h | 11 ++-
2 files changed, 69 insertions(+), 53 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index c35726a47c07c
The prefix symbol creation code currently ignores all errors, presumably
because some functions don't have the leading NOPs.
Shuffle the code around a bit, improve the error handling and document
why some errors are ignored.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/ch
In preparation for the objtool klp diff subcommand, add a command-line
option to generate a unique checksum for each function. This will
enable detection of functions which have changed between two versions of
an object file.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/Makefile
Add interface to enable the creation of a new ELF file.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/builtin-check.c | 2 +-
tools/objtool/elf.c | 144 +++-
tools/objtool/include/objtool/elf.h | 5 +-
3 files changed, 147 insertions(+), 4
Add a --debug option which gets passed to "objtool klp diff" to enable
debug output related to cloning decisions.
Signed-off-by: Josh Poimboeuf
---
scripts/livepatch/klp-build | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/scripts/livepatch/k
livepatch module (aka work around linker wreckage)
using 'objtool klp post-link'.
Signed-off-by: Josh Poimboeuf
---
scripts/Makefile.lib | 1 +
scripts/livepatch/fix-patch-lines | 2 +-
scripts/livepatch/klp-build | 743 ++
tool
Add a module initialization stub which can be linked with binary diff
objects to produce a livepatch module.
Signed-off-by: Josh Poimboeuf
---
scripts/livepatch/init.c | 108 +++
1 file changed, 108 insertions(+)
create mode 100644 scripts/livepatch/init.c
In preparation for introducing klp-build, add a new CONFIG_KLP_BUILD
option. The initial version will only be supported on x86-64.
Signed-off-by: Josh Poimboeuf
---
arch/x86/Kconfig | 1 +
kernel/livepatch/Kconfig | 12
2 files changed, 13 insertions(+)
diff --git a/arch
In preparation for using the objtool annotation macros in higher-level
objtool.h macros like UNWIND_HINT, move them to their own file.
Signed-off-by: Josh Poimboeuf
---
include/linux/annotate.h | 109 +++
include/linux/objtool.h | 90
inker-compliant intermediate binary which encodes
the relevant KLP section/reloc/symbol metadata.
After module linking, the .ko then needs to be converted to an actual
livepatch module. Introduce a new klp post-link subcommand to do so.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/
Add a --debug option to klp diff which prints cloning decisions and an
indented dependency tree for all cloned symbols and relocations. This
helps visualize which symbols and relocations were included and why.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/include/objtool/warn.h | 21
ted as a reference to the next symbol, or vice
versa.
A potential future alternative to '-ffunction-sections -fdata-sections'
would be to introduce a toolchain option that forces symbol-based
(non-section) relocations.
Signed-off-by: Josh Poimboeuf
---
MAINTAINERS
tting inline asm in a dummy function in order
to pass the 'func' pointer to the asm.
Signed-off-by: Josh Poimboeuf
---
include/linux/objtool.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index 4fea6a042b28f..b18ab
Add some helper macros which can be used by livepatch source .patch
files to register callbacks, convert static calls to regular calls where
needed, and patch syscalls.
Signed-off-by: Josh Poimboeuf
---
include/linux/livepatch_helpers.h | 77 +++
1 file changed, 77
the first
differing instruction.
This can be useful for quickly determining where and why a function
changed.
Signed-off-by: Josh Poimboeuf
---
scripts/livepatch/klp-build | 82 +++--
1 file changed, 78 insertions(+), 4 deletions(-)
diff --git a/scripts/livepatch/k
In preparation for the objtool klp diff subcommand, add an
ANNOTATE_DATA_SPECIAL macro which annotates special section entries so
that objtool can determine their size and location and extract them
when needed.
Signed-off-by: Josh Poimboeuf
---
include/linux/annotate.h| 49
... for reading annotation types.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/arch/loongarch/orc.c | 1 -
tools/objtool/arch/powerpc/decode.c| 1 -
tools/objtool/arch/x86/decode.c| 1 -
tools/objtool/arch/x86/orc.c | 1 -
tools/objtool/check.c
h can trigger a confusing "unexpected end of section"
warning which blames .altinstr_replacement rather than the offending
fallthrough function.
Fix that by not caching the section. There's no point in doing that
anyway.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 5 +---
: Josh Poimboeuf
---
MAINTAINERS | 1 +
scripts/livepatch/fix-patch-lines | 79 +++
2 files changed, 80 insertions(+)
create mode 100755 scripts/livepatch/fix-patch-lines
diff --git a/MAINTAINERS b/MAINTAINERS
index 605390cdfb75e..485042b545b3e
n sync going forward.
Signed-off-by: Josh Poimboeuf
---
tools/include/linux/interval_tree_generic.h | 8 ++--
tools/objtool/sync-check.sh | 1 +
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/tools/include/linux/interval_tree_generic.h
b/tools/include/linux/int
to the IBT function pointer section whitelist.
- Prevent KLP symbols from getting incorrectly classified as cold
subfunctions.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 52 ++---
tools/objtool/elf.c | 5 ++-
tools/objto
for IBT and LTO. Eventually the per-translation-unit mode will be
phased out.
Signed-off-by: Josh Poimboeuf
---
scripts/Makefile.lib| 2 +-
scripts/link-vmlinux.sh | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index
Add a --debug-checksum= option to the check subcommand to print
the calculated checksum of each instruction in the given functions.
This is useful for determining where two versions of a function begin to
diverge.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/builtin-check.c| 6
!sym->sec isn't actually a thing: even STT_UNDEF and other special
symbol types belong to NULL section 0.
Simplify the initialization of 'shndx' accordingly.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
In preparation for the objtool klp diff subcommand, refactor
elf_add_string() by adding a new elf_add_data() helper which allows the
adding of arbitrary data to a section.
Make both interfaces global so they can be used by the upcoming klp diff
code.
Signed-off-by: Josh Poimboeuf
---
tools
-by: Josh Poimboeuf
---
tools/objtool/elf.c | 118
tools/objtool/include/objtool/elf.h | 7 +-
tools/objtool/orc_gen.c | 6 +-
3 files changed, 77 insertions(+), 54 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index
In preparation for the objtool klp diff subcommand, add annotations for
special section entries. This will enable objtool to determine the size
and location of the entries and to extract them when needed.
Signed-off-by: Josh Poimboeuf
---
arch/x86/include/asm/alternative.h | 4
arch/x86
When a to-be-created section already exists, there's no point in
emptying the various lists if their respective sections already exist.
In fact it's better to leave them intact as they might get used later.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 4
1 file
tool's other
options.
Signed-off-by: Josh Poimboeuf
---
scripts/Makefile.lib | 2 +-
scripts/Makefile.vmlinux_o| 2 +-
tools/objtool/builtin-check.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index b955602661240..1
Simplify the relocation offset calculation in unwind_read_hints(),
similar to other conversions which have already been done.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 9 +
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool
In preparation for the objtool klp diff subcommand, introduce a flag to
identify __pfx_*() and __cfi_*() functions in advance so they don't need
to be manually identified every time a check is needed.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 5 +
tools/ob
.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 170 +---
tools/objtool/include/objtool/elf.h | 9 ++
2 files changed, 165 insertions(+), 14 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 117a1b5915a14..8d01fc3b4f679 100644
The add_jump_destinations() logic is a bit weird and convoluted after
being incrementally tweaked over the years. Refactor it to hopefully be
more logical and straightforward.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 222 +---
tools
Bring the cmdline check_options[] array back into vertical alignment for
better readability.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/builtin-check.c | 54 +--
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/tools/objtool/builtin-check.c b
The .parainstructions section no longer exists since the following
commit:
60bc276b129e ("x86/paravirt: Switch mixed paravirt/alternative calls to
alternatives").
Remove the reference to it.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 1 -
1 file changed, 1 deletio
ng back the old --backup option, but with the new behavior: only on
warnings/errors, and print the args to make it easier to recreate.
Suggested-by: Peter Zijlstra
Signed-off-by: Josh Poimboeuf
---
tools/objtool/builtin-check.c | 25 +++--
tools/objtool/check.c
Use 'const char *' where applicable.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/arch/loongarch/decode.c | 2 +-
tools/objtool/arch/powerpc/decode.c | 2 +-
tools/objtool/arch/x86/decode.c | 2 +-
tools/objtool/elf.c | 6 +++---
tools/objtool/include/objt
uding .cold functions) so the
ordering of the discovery doesn't matter.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 84 ++-
tools/objtool/include/objtool/check.h | 3 +-
2 files changed, 45 insertions(+), 42 deletions(-)
diff --git a/too
Add some helper macros to improve readability.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/arch/x86/special.c| 2 +-
tools/objtool/check.c | 58 -
tools/objtool/elf.c | 20 -
tools/objtool/include/objtool/elf.h | 66
'struct objtool_file' is specific to the check code and doesn't belong
in the elf code which is supposed to be objtool_file-agnostic. Convert
the elf iterator macros to use 'struct elf' instead.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/c
Introduce a flag to identify .cold subfunctions so they can be detected
easier and faster.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 14 ++
tools/objtool/elf.c | 19 ++-
tools/objtool/include/objtool/elf.h | 1 +
3 files
e new warnings happy.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/Makefile | 15 ++-
tools/objtool/check.c | 4 ++--
tools/objtool/elf.c| 2 +-
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 8c20361d
Add a sanity check to make sure none of the relocations for the
.discard.annotate_insn section have gone missing.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index bea9b124dcf48
Properly check and propagate the return value of elf_truncate_section()
to avoid silent failures.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index b009d9feed760
al errors which lead to an immediate
exit().
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 10 +++---
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 1c1bb2cb960da..b009d9feed760 100644
--- a/tools/objtool/elf.c
+++ b
On x86, arch_dest_reloc_offset() hardcodes the addend adjustment to
four, but the actual adjustment depends on the relocation type. Fix
that.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/arch/loongarch/decode.c | 4 ++--
tools/objtool/arch/powerpc/decode.c | 4 ++--
tools/objtool/arch
Zero-length symbols get inserted in the wrong spot. Fix that.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index a8a78b55d3ece..c024937eb12a2 100644
--- a/tools/objtool/elf.c
t;objtool: Don't add empty symbols to the rbtree")
is no longer needed.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 10 ++
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 19e249f4783cf..a8a78b55d3ece 10
zero for a given section.
Fixes a bunch of (-ffunction-sections) warnings like:
vmlinux.o: warning: objtool: .text.__x64_sys_io_setup+0x10: unreachable
instruction
Fixes: 4adb23686795 ("objtool: Ignore extra-symbol code")
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 8 +
Up to a certain point in objtool's execution, all errors are fatal and
return -1. When propagating such errors, just return -1 directly
instead of trying to propagate the original return code. This helps
make the code more compact and the behavior more explicit.
Signed-off-by: Josh Poim
In the rare case of overlapping symbols, find_symbol_containing() just
returns the first one it finds. Make it slightly less arbitrary by
returning the smallest symbol with size > 0.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 25 -
1 file changed,
reworking the functionality and moving
int3_selftest_ip() to a separate asm function. While at it, improve the
naming.
Signed-off-by: Josh Poimboeuf
---
arch/x86/kernel/alternative.c | 51 +++
1 file changed, 28 insertions(+), 23 deletions(-)
diff --git a/arch/x86
For consistency with the other function templates, change
_subtree_search_*() to use the user-supplied ITSTATIC rather than the
hard-coded 'static'.
Signed-off-by: Josh Poimboeuf
---
include/linux/interval_tree.h | 4
include/linux/interval_tree_generic.h
amada
Signed-off-by: Josh Poimboeuf
---
scripts/mod/modpost.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5ca7c268294eb..c2b2c8fa6d258 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -606,6 +606,11 @@ stati
ne ELF note per line" limitation.
Signed-off-by: Josh Poimboeuf
---
include/linux/elfnote.h | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index 69b136e4dd2b6..bb3dcded055fc 100644
--- a/include/linux/elfnote.h
he name comes before the unique
part. That will enable objtool to properly correlate symbols across
builds.
Cc: Masahiro Yamada
Signed-off-by: Josh Poimboeuf
---
include/linux/init.h | 3 ++-
scripts/Makefile.lib | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/li
.
Signed-off-by: Josh Poimboeuf
---
include/linux/compiler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index db5796b8b0a71..9bc690be60675 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -287,7
In preparation for the objtool klp diff subcommand, add an underscore
between the name and the counter. This will make it possible for
objtool to distinguish between the non-unique and unique parts of the
symbol name so it can properly correlate the symbols.
Signed-off-by: Josh Poimboeuf
asily Gorbik
Cc: Alexander Gordeev
Acked-by: Heiko Carstens
Signed-off-by: Josh Poimboeuf
---
arch/s390/include/asm/nospec-insn.h | 2 +-
arch/s390/kernel/vmlinux.lds.S | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/s390/include/asm/nospec-insn.h
b/arch/s390/includ
asily Gorbik
Cc: Alexander Gordeev
Signed-off-by: Josh Poimboeuf
---
include/asm-generic/vmlinux.lds.h | 40 ++-
scripts/module.lds.S | 12 --
2 files changed, 17 insertions(+), 35 deletions(-)
diff --git a/include/asm-generic/vmlinux.lds.h
b/in
Add the section number and reloc index to relocation error messages to
help find the faulty relocation.
Signed-off-by: Josh Poimboeuf
---
arch/x86/kernel/module.c | 15 +--
kernel/livepatch/core.c | 4 ++--
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/arch/x86
Since commit 877b145f0f47 ("x86/kprobes: Move trampoline code into
RODATA"), the optprobe template code is no longer analyzed by objtool so
it doesn't need to be ignored.
Signed-off-by: Josh Poimboeuf
---
arch/x86/kernel/kprobes/opt.c | 4
1 file changed, 4 deletions(-)
di
ng.
These patches can also be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/jpoimboe/linux.git klp-build-v3
Please test!
[1] https://github.com/dynup/kpatch
Josh Poimboeuf (63):
s390/vmlinux.lds.S: Prevent thunk functions from getting placed with
normal text
vmlinux.lds: U
On Mon, Jun 30, 2025 at 09:31:44AM +0200, Peter Zijlstra wrote:
> On Fri, Jun 27, 2025 at 10:34:15AM -0700, Josh Poimboeuf wrote:
> > On Fri, Jun 27, 2025 at 12:53:28PM +0200, Peter Zijlstra wrote:
> > > On Thu, Jun 26, 2025 at 04:55:29PM -0700, Josh Poimboeuf wrote:
> > &g
On Mon, Jun 30, 2025 at 09:29:38AM +0200, Peter Zijlstra wrote:
> On Fri, Jun 27, 2025 at 09:36:08AM -0700, Josh Poimboeuf wrote:
> > On Fri, Jun 27, 2025 at 12:29:30PM +0200, Peter Zijlstra wrote:
> > > Naming seems inconsistent, there are:
> > >
> > > sym_h
On Fri, Jun 27, 2025 at 12:53:28PM +0200, Peter Zijlstra wrote:
> On Thu, Jun 26, 2025 at 04:55:29PM -0700, Josh Poimboeuf wrote:
> > An upcoming patch will add the SHF_MERGE flag to x86 __jump_table and
> > __bug_table so their entry sizes can be defined in inline asm.
> >
(LRU_GEN_WIDTH, 0);
> > DEFINE(__LRU_REFS_WIDTH, 0);
> > +#endif
> > +#if defined(CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE) &&
> > defined(CONFIG_JUMP_LABEL)
>
> How is HAVE_ARCH_JUMP_LABEL_RELATIVE relevant here?
#ifdef CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE
struct jump_entry {
s32 code;
s32 target;
long key; // key may be far away from the core kernel under KASLR
};
--
Josh
lso, since we only ever set sym->prefix when is_func_sym(), this helper
> could avoid checking that again.
Indeed...
--
Josh
se adjectives can be
read as noun adjuncts, e.g. "chicken soup", where a noun functions as an
adjective.
If we changed those to:
"is ?"
or
"is a ?"
then it doesn't always read correctly:
is_sym_file(): "is symbol a file?"
is_sec_string(): "is section a string?"
--
Josh
On Fri, Jun 27, 2025 at 11:13:10AM +0200, Peter Zijlstra wrote:
> On Thu, Jun 26, 2025 at 04:55:04PM -0700, Josh Poimboeuf wrote:
> > find_symbol_hole_containing() fails to find a symbol hole (aka stripped
> > weak symbol) if its section has no symbols before the hole. This breaks
Add a --debug option which gets passed to "objtool klp diff" to enable
debug output related to cloning decisions.
Signed-off-by: Josh Poimboeuf
---
scripts/livepatch/klp-build | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/scripts/livepatch/k
the first
differing instruction.
This can be useful for quickly determining where and why a function
changed.
Signed-off-by: Josh Poimboeuf
---
scripts/livepatch/klp-build | 82 +++--
1 file changed, 78 insertions(+), 4 deletions(-)
diff --git a/scripts/livepatch/k
: Josh Poimboeuf
---
MAINTAINERS | 1 +
scripts/livepatch/fix-patch-lines | 79 +++
2 files changed, 80 insertions(+)
create mode 100755 scripts/livepatch/fix-patch-lines
diff --git a/MAINTAINERS b/MAINTAINERS
index 0298d9570ca8..dd622368d74b
Add some helper macros which can be used by livepatch source .patch
files to register callbacks, convert static calls to regular calls where
needed, and patch syscalls.
Signed-off-by: Josh Poimboeuf
---
include/linux/livepatch_helpers.h | 79 +++
1 file changed, 79
Add a module initialization stub which can be linked with binary diff
objects to produce a livepatch module.
Signed-off-by: Josh Poimboeuf
---
scripts/livepatch/init.c | 108 +++
1 file changed, 108 insertions(+)
create mode 100644 scripts/livepatch/init.c
for IBT and LTO. Eventually the per-translation-unit mode will be
phased out.
Signed-off-by: Josh Poimboeuf
---
scripts/Makefile.lib| 2 +-
scripts/link-vmlinux.sh | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index
livepatch module (aka work around linker wreckage)
using 'objtool klp post-link'.
Signed-off-by: Josh Poimboeuf
---
scripts/livepatch/fix-patch-lines | 2 +-
scripts/livepatch/klp-build | 747 ++
tools/objtool/klp-diff.c | 6 +-
In preparation for introducing klp-build, add a new CONFIG_KLP_BUILD
option. The initial version will only be supported on x86-64.
Signed-off-by: Josh Poimboeuf
---
arch/x86/Kconfig | 1 +
kernel/livepatch/Kconfig | 12
2 files changed, 13 insertions(+)
diff --git a/arch
to the IBT function pointer section whitelist.
- Prevent KLP symbols from getting incorrectly classified as cold
subfunctions.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 48 +
tools/objtool/elf.c | 5 ++-
tools/objto
inker-compliant intermediate binary which encodes
the relevant KLP section/reloc/symbol metadata.
After module linking, the .ko then needs to be converted to an actual
livepatch module. Introduce a new klp post-link subcommand to do so.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/
ted as a reference to the next symbol, or vice
versa.
A potential future alternative to '-ffunction-sections -fdata-sections'
would be to introduce a toolchain option that forces symbol-based
(non-section) relocations.
Signed-off-by: Josh Poimboeuf
---
MAINTAINERS
In preparation for adding objtool 'check' support for analyzing
livepatch modules, error out if a duplicate prefix symbol is attempted.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/check.c | 12 +++-
tools/objtool/elf.c | 9 +
too
Add a --debug-checksum= option to the check subcommand to print
the calculated checksum of each instruction in the given functions.
This is useful for determining where two versions of a function begin to
diverge.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/builtin-check.c| 6
Add a --debug option to klp diff which prints cloning decisions and an
indented dependency tree for all cloned symbols and relocations. This
helps visualize which symbols and relocations were included and why.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/include/objtool/warn.h | 21
In preparation for the objtool klp diff subcommand, define the entry
size for the discard.unwind_hints section in its ELF header. This will
allow tooling to extract individual entries.
Signed-off-by: Josh Poimboeuf
---
include/linux/objtool.h | 11 ---
kernel/bounds.c | 4
In preparation for the objtool klp diff subcommand, add a command-line
option to generate a unique checksum for each function. This will
enable detection of functions which have changed between two versions of
an object file.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/Makefile
tting inline asm in a dummy function in order
to pass the 'func' pointer to the asm.
Signed-off-by: Josh Poimboeuf
---
include/linux/objtool.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index c7a3851ae4ae..7d7bb7f1af
In preparation for the objtool klp diff subcommand, define the entry
size for the .static_call_sites section in its ELF header. This will
allow tooling to extract individual entries.
Signed-off-by: Josh Poimboeuf
---
arch/x86/include/asm/static_call.h | 3 ++-
include/linux/static_call.h
In preparation for the objtool klp diff subcommand, define the entry
size for the __bug_table section in its ELF header. This will allow
tooling to extract individual entries.
Signed-off-by: Josh Poimboeuf
---
arch/x86/include/asm/bug.h | 45 --
1 file
In preparation for the objtool klp diff subcommand, define the entry
size for the __ex_table section in its ELF header. This will allow
tooling to extract individual entries.
Signed-off-by: Josh Poimboeuf
---
arch/um/include/asm/Kbuild | 1 -
arch/um/include/shared/common
In preparation for the objtool klp diff subcommand, define the entry
size for the .altinstructions section in its ELF header. This will
allow tooling to extract individual entries.
Signed-off-by: Josh Poimboeuf
---
arch/um/include/shared/common-offsets.h| 2 ++
arch/x86/include/asm
In preparation for the objtool klp diff subcommand, define the entry
size for the __jump_table section in its ELF header. This will allow
tooling to extract individual entries.
Signed-off-by: Josh Poimboeuf
---
arch/x86/include/asm/jump_label.h | 17 +++--
kernel/bounds.c
remain writable. While
SHF_WRITE is ignored by vmlinux, it's still needed for modules.
To work around the linker interference, remove SHF_WRITE during
compilation and restore it after linking the module.
Cc: Masahiro Yamada
Signed-off-by: Josh Poimboeuf
---
arch/Kc
Add interface to enable the creation of a new ELF file.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/builtin-check.c | 2 +-
tools/objtool/elf.c | 144 +++-
tools/objtool/include/objtool/elf.h | 5 +-
3 files changed, 147 insertions(+), 4
.
Signed-off-by: Josh Poimboeuf
---
tools/objtool/elf.c | 151 +---
tools/objtool/include/objtool/elf.h | 9 ++
2 files changed, 145 insertions(+), 15 deletions(-)
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 535bdcf077d0..0e98cf2ab533 100644
In preparation for the objtool klp diff subcommand, refactor
elf_add_string() by adding a new elf_add_data() helper which allows the
adding of arbitrary data to a section.
Make both interfaces public so they can be used by the upcoming klp diff
code.
Signed-off-by: Josh Poimboeuf
---
tools
1 - 100 of 4047 matches
Mail list logo