* [PATCH 0/2] objtool: xxhash dependency improvements @ 2025-11-12 23:32 Josh Poimboeuf 2025-11-12 23:32 ` [PATCH 1/2] objtool: Set minimum xxhash version to 0.8 Josh Poimboeuf 2025-11-12 23:32 ` [PATCH 2/2] objtool/klp: Only enable --checksum when needed Josh Poimboeuf 0 siblings, 2 replies; 7+ messages in thread From: Josh Poimboeuf @ 2025-11-12 23:32 UTC (permalink / raw) To: x86; +Cc: linux-kernel, Peter Zijlstra, Michael Kelley, live-patching Set the minimum xxhash version to 0.8, and soften the xxhash dependency a bit so that it's only needed when running klp-build rather than doing a normal kernel build. For tip/objtool/core. Josh Poimboeuf (2): objtool: Set minimum xxhash version to 0.8 objtool/klp: Only enable --checksum when needed arch/x86/boot/startup/Makefile | 2 +- scripts/Makefile.lib | 1 - scripts/livepatch/klp-build | 4 ++++ tools/objtool/Makefile | 2 +- tools/objtool/builtin-check.c | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) -- 2.51.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] objtool: Set minimum xxhash version to 0.8 2025-11-12 23:32 [PATCH 0/2] objtool: xxhash dependency improvements Josh Poimboeuf @ 2025-11-12 23:32 ` Josh Poimboeuf 2025-11-13 2:25 ` Michael Kelley 2025-11-18 9:14 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf 2025-11-12 23:32 ` [PATCH 2/2] objtool/klp: Only enable --checksum when needed Josh Poimboeuf 1 sibling, 2 replies; 7+ messages in thread From: Josh Poimboeuf @ 2025-11-12 23:32 UTC (permalink / raw) To: x86; +Cc: linux-kernel, Peter Zijlstra, Michael Kelley, live-patching XXH3 is only supported starting with xxhash 0.8. Enforce that. Fixes: 0d83da43b1e1 ("objtool/klp: Add --checksum option to generate per-function checksums") Reported-by: Michael Kelley <mhklinux@outlook.com> Closes: https://lore.kernel.org/SN6PR02MB41579B83CD295C9FEE40EED6D4FCA@SN6PR02MB4157.namprd02.prod.outlook.com Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> --- tools/objtool/Makefile | 2 +- tools/objtool/builtin-check.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 48928c9bebef..021f55b7bd87 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -12,7 +12,7 @@ ifeq ($(SRCARCH),loongarch) endif ifeq ($(ARCH_HAS_KLP),y) - HAVE_XXHASH = $(shell echo "int main() {}" | \ + HAVE_XXHASH = $(shell printf "$(pound)include <xxhash.h>\nXXH3_state_t *state;int main() {}" | \ $(HOSTCC) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n) ifeq ($(HAVE_XXHASH),y) BUILD_KLP := y diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 1e1ea8396eb3..aab7fa9c7e00 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -164,7 +164,7 @@ static bool opts_valid(void) #ifndef BUILD_KLP if (opts.checksum) { - ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev and recompile"); + ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev (version >= 0.8) and recompile"); return false; } #endif -- 2.51.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH 1/2] objtool: Set minimum xxhash version to 0.8 2025-11-12 23:32 ` [PATCH 1/2] objtool: Set minimum xxhash version to 0.8 Josh Poimboeuf @ 2025-11-13 2:25 ` Michael Kelley 2025-11-18 9:14 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf 1 sibling, 0 replies; 7+ messages in thread From: Michael Kelley @ 2025-11-13 2:25 UTC (permalink / raw) To: Josh Poimboeuf, x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra, live-patching@vger.kernel.org From: Josh Poimboeuf <jpoimboe@kernel.org> Sent: Wednesday, November 12, 2025 3:33 PM > > XXH3 is only supported starting with xxhash 0.8. Enforce that. > > Fixes: 0d83da43b1e1 ("objtool/klp: Add --checksum option to generate per-function checksums") > Reported-by: Michael Kelley <mhklinux@outlook.com> > Closes: https://lore.kernel.org/all/SN6PR02MB41579B83CD295C9FEE40EED6D4FCA@SN6PR02MB4157.namprd02.prod.outlook.com > Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> > --- > tools/objtool/Makefile | 2 +- > tools/objtool/builtin-check.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile > index 48928c9bebef..021f55b7bd87 100644 > --- a/tools/objtool/Makefile > +++ b/tools/objtool/Makefile > @@ -12,7 +12,7 @@ ifeq ($(SRCARCH),loongarch) > endif > > ifeq ($(ARCH_HAS_KLP),y) > - HAVE_XXHASH = $(shell echo "int main() {}" | \ > + HAVE_XXHASH = $(shell printf "$(pound)include <xxhash.h>\nXXH3_state_t *state;int main() {}" | \ > $(HOSTCC) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n) > ifeq ($(HAVE_XXHASH),y) > BUILD_KLP := y > diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c > index 1e1ea8396eb3..aab7fa9c7e00 100644 > --- a/tools/objtool/builtin-check.c > +++ b/tools/objtool/builtin-check.c > @@ -164,7 +164,7 @@ static bool opts_valid(void) > > #ifndef BUILD_KLP > if (opts.checksum) { > - ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev and recompile"); > + ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev (version >= 0.8) and recompile"); > return false; > } > #endif > -- > 2.51.1 Reviewed-by: Michael Kelley <mhklinux@outlook.com> Tested-by: Michael Kelley <mhklinux@outlook.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: objtool/core] objtool: Set minimum xxhash version to 0.8 2025-11-12 23:32 ` [PATCH 1/2] objtool: Set minimum xxhash version to 0.8 Josh Poimboeuf 2025-11-13 2:25 ` Michael Kelley @ 2025-11-18 9:14 ` tip-bot2 for Josh Poimboeuf 1 sibling, 0 replies; 7+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-11-18 9:14 UTC (permalink / raw) To: linux-tip-commits Cc: Michael Kelley, Josh Poimboeuf, Peter Zijlstra (Intel), x86, linux-kernel The following commit has been merged into the objtool/core branch of tip: Commit-ID: ee0b48fabadf9b073b24f761ac09da7293eee7b7 Gitweb: https://git.kernel.org/tip/ee0b48fabadf9b073b24f761ac09da7293eee7b7 Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Wed, 12 Nov 2025 15:32:33 -08:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Tue, 18 Nov 2025 09:59:25 +01:00 objtool: Set minimum xxhash version to 0.8 XXH3 is only supported starting with xxhash 0.8. Enforce that. Fixes: 0d83da43b1e1 ("objtool/klp: Add --checksum option to generate per-function checksums") Closes: https://lore.kernel.org/SN6PR02MB41579B83CD295C9FEE40EED6D4FCA@SN6PR02MB4157.namprd02.prod.outlook.com Reported-by: Michael Kelley <mhklinux@outlook.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Tested-by: Michael Kelley <mhklinux@outlook.com> Link: https://patch.msgid.link/7227c94692a3a51840278744c7af31b4797c6b96.1762990139.git.jpoimboe@kernel.org --- tools/objtool/Makefile | 2 +- tools/objtool/builtin-check.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 48928c9..021f55b 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -12,7 +12,7 @@ ifeq ($(SRCARCH),loongarch) endif ifeq ($(ARCH_HAS_KLP),y) - HAVE_XXHASH = $(shell echo "int main() {}" | \ + HAVE_XXHASH = $(shell printf "$(pound)include <xxhash.h>\nXXH3_state_t *state;int main() {}" | \ $(HOSTCC) -xc - -o /dev/null -lxxhash 2> /dev/null && echo y || echo n) ifeq ($(HAVE_XXHASH),y) BUILD_KLP := y diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c index 1e1ea83..aab7fa9 100644 --- a/tools/objtool/builtin-check.c +++ b/tools/objtool/builtin-check.c @@ -164,7 +164,7 @@ static bool opts_valid(void) #ifndef BUILD_KLP if (opts.checksum) { - ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev and recompile"); + ERROR("--checksum not supported; install xxhash-devel/libxxhash-dev (version >= 0.8) and recompile"); return false; } #endif ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] objtool/klp: Only enable --checksum when needed 2025-11-12 23:32 [PATCH 0/2] objtool: xxhash dependency improvements Josh Poimboeuf 2025-11-12 23:32 ` [PATCH 1/2] objtool: Set minimum xxhash version to 0.8 Josh Poimboeuf @ 2025-11-12 23:32 ` Josh Poimboeuf 2025-11-13 2:29 ` Michael Kelley 2025-11-18 9:14 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf 1 sibling, 2 replies; 7+ messages in thread From: Josh Poimboeuf @ 2025-11-12 23:32 UTC (permalink / raw) To: x86; +Cc: linux-kernel, Peter Zijlstra, Michael Kelley, live-patching With CONFIG_KLP_BUILD enabled, checksums are only needed during a klp-build run. There's no need to enable them for normal kernel builds. This also has the benefit of softening the xxhash dependency. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> --- arch/x86/boot/startup/Makefile | 2 +- scripts/Makefile.lib | 1 - scripts/livepatch/klp-build | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/startup/Makefile b/arch/x86/boot/startup/Makefile index e8fdf020b422..5e499cfb29b5 100644 --- a/arch/x86/boot/startup/Makefile +++ b/arch/x86/boot/startup/Makefile @@ -36,7 +36,7 @@ $(patsubst %.o,$(obj)/%.o,$(lib-y)): OBJECT_FILES_NON_STANDARD := y # relocations, even if other objtool actions are being deferred. # $(pi-objs): objtool-enabled = 1 -$(pi-objs): objtool-args = $(if $(delay-objtool),,$(objtool-args-y)) --noabs +$(pi-objs): objtool-args = $(if $(delay-objtool),--dry-run,$(objtool-args-y)) --noabs # # Confine the startup code by prefixing all symbols with __pi_ (for position diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f4b33919ec37..28a1c08e3b22 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -173,7 +173,6 @@ ifdef CONFIG_OBJTOOL objtool := $(objtree)/tools/objtool/objtool -objtool-args-$(CONFIG_KLP_BUILD) += --checksum objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr objtool-args-$(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) += --hacks=skylake diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index 881e052e7fae..882272120c9e 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -489,8 +489,11 @@ clean_kernel() { build_kernel() { local log="$TMP_DIR/build.log" + local objtool_args=() local cmd=() + objtool_args=("--checksum") + cmd=("make") # When a patch to a kernel module references a newly created unexported @@ -513,6 +516,7 @@ build_kernel() { cmd+=("$VERBOSE") cmd+=("-j$JOBS") cmd+=("KCFLAGS=-ffunction-sections -fdata-sections") + cmd+=("OBJTOOL_ARGS=${objtool_args[*]}") cmd+=("vmlinux") cmd+=("modules") -- 2.51.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [PATCH 2/2] objtool/klp: Only enable --checksum when needed 2025-11-12 23:32 ` [PATCH 2/2] objtool/klp: Only enable --checksum when needed Josh Poimboeuf @ 2025-11-13 2:29 ` Michael Kelley 2025-11-18 9:14 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf 1 sibling, 0 replies; 7+ messages in thread From: Michael Kelley @ 2025-11-13 2:29 UTC (permalink / raw) To: Josh Poimboeuf, x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra, live-patching@vger.kernel.org From: Josh Poimboeuf <jpoimboe@kernel.org> Sent: Wednesday, November 12, 2025 3:33 PM > > With CONFIG_KLP_BUILD enabled, checksums are only needed during a > klp-build run. There's no need to enable them for normal kernel builds. > > This also has the benefit of softening the xxhash dependency. > > Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> > --- > arch/x86/boot/startup/Makefile | 2 +- > scripts/Makefile.lib | 1 - > scripts/livepatch/klp-build | 4 ++++ > 3 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/boot/startup/Makefile b/arch/x86/boot/startup/Makefile > index e8fdf020b422..5e499cfb29b5 100644 > --- a/arch/x86/boot/startup/Makefile > +++ b/arch/x86/boot/startup/Makefile > @@ -36,7 +36,7 @@ $(patsubst %.o,$(obj)/%.o,$(lib-y)): > OBJECT_FILES_NON_STANDARD := y > # relocations, even if other objtool actions are being deferred. > # > $(pi-objs): objtool-enabled = 1 > -$(pi-objs): objtool-args = $(if $(delay-objtool),,$(objtool-args-y)) --noabs > +$(pi-objs): objtool-args = $(if $(delay-objtool),--dry-run,$(objtool-args-y)) --noabs > > # > # Confine the startup code by prefixing all symbols with __pi_ (for position > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index f4b33919ec37..28a1c08e3b22 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -173,7 +173,6 @@ ifdef CONFIG_OBJTOOL > > objtool := $(objtree)/tools/objtool/objtool > > -objtool-args-$(CONFIG_KLP_BUILD) += --checksum > objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label > objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr > objtool-args-$(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) += --hacks=skylake > diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build > index 881e052e7fae..882272120c9e 100755 > --- a/scripts/livepatch/klp-build > +++ b/scripts/livepatch/klp-build > @@ -489,8 +489,11 @@ clean_kernel() { > > build_kernel() { > local log="$TMP_DIR/build.log" > + local objtool_args=() > local cmd=() > > + objtool_args=("--checksum") > + > cmd=("make") > > # When a patch to a kernel module references a newly created unexported > @@ -513,6 +516,7 @@ build_kernel() { > cmd+=("$VERBOSE") > cmd+=("-j$JOBS") > cmd+=("KCFLAGS=-ffunction-sections -fdata-sections") > + cmd+=("OBJTOOL_ARGS=${objtool_args[*]}") > cmd+=("vmlinux") > cmd+=("modules") > > -- > 2.51.1 Did a normal linux-next kernel build on an Ubuntu 20.04 system, which by default does not have xxhash installed. Previous error about needing to install libxxhash-dev is no longer generated. Have not tested a klp-build. Tested-by: Michael Kelley <mhklinux@outlook.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [tip: objtool/core] objtool/klp: Only enable --checksum when needed 2025-11-12 23:32 ` [PATCH 2/2] objtool/klp: Only enable --checksum when needed Josh Poimboeuf 2025-11-13 2:29 ` Michael Kelley @ 2025-11-18 9:14 ` tip-bot2 for Josh Poimboeuf 1 sibling, 0 replies; 7+ messages in thread From: tip-bot2 for Josh Poimboeuf @ 2025-11-18 9:14 UTC (permalink / raw) To: linux-tip-commits Cc: Josh Poimboeuf, Peter Zijlstra (Intel), Michael Kelley, x86, linux-kernel The following commit has been merged into the objtool/core branch of tip: Commit-ID: 2092007aa32f8dd968c38751bd1b7cac9b1f738d Gitweb: https://git.kernel.org/tip/2092007aa32f8dd968c38751bd1b7cac9b1f738d Author: Josh Poimboeuf <jpoimboe@kernel.org> AuthorDate: Wed, 12 Nov 2025 15:32:34 -08:00 Committer: Peter Zijlstra <peterz@infradead.org> CommitterDate: Tue, 18 Nov 2025 09:59:26 +01:00 objtool/klp: Only enable --checksum when needed With CONFIG_KLP_BUILD enabled, checksums are only needed during a klp-build run. There's no need to enable them for normal kernel builds. This also has the benefit of softening the xxhash dependency. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Tested-by: Michael Kelley <mhklinux@outlook.com> Link: https://patch.msgid.link/edbb1ca215e4926e02edb493b68b9d6d063e902f.1762990139.git.jpoimboe@kernel.org --- arch/x86/boot/startup/Makefile | 2 +- scripts/Makefile.lib | 1 - scripts/livepatch/klp-build | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/startup/Makefile b/arch/x86/boot/startup/Makefile index e8fdf02..5e499cf 100644 --- a/arch/x86/boot/startup/Makefile +++ b/arch/x86/boot/startup/Makefile @@ -36,7 +36,7 @@ $(patsubst %.o,$(obj)/%.o,$(lib-y)): OBJECT_FILES_NON_STANDARD := y # relocations, even if other objtool actions are being deferred. # $(pi-objs): objtool-enabled = 1 -$(pi-objs): objtool-args = $(if $(delay-objtool),,$(objtool-args-y)) --noabs +$(pi-objs): objtool-args = $(if $(delay-objtool),--dry-run,$(objtool-args-y)) --noabs # # Confine the startup code by prefixing all symbols with __pi_ (for position diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f4b3391..28a1c08 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -173,7 +173,6 @@ ifdef CONFIG_OBJTOOL objtool := $(objtree)/tools/objtool/objtool -objtool-args-$(CONFIG_KLP_BUILD) += --checksum objtool-args-$(CONFIG_HAVE_JUMP_LABEL_HACK) += --hacks=jump_label objtool-args-$(CONFIG_HAVE_NOINSTR_HACK) += --hacks=noinstr objtool-args-$(CONFIG_MITIGATION_CALL_DEPTH_TRACKING) += --hacks=skylake diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build index 881e052..8822721 100755 --- a/scripts/livepatch/klp-build +++ b/scripts/livepatch/klp-build @@ -489,8 +489,11 @@ clean_kernel() { build_kernel() { local log="$TMP_DIR/build.log" + local objtool_args=() local cmd=() + objtool_args=("--checksum") + cmd=("make") # When a patch to a kernel module references a newly created unexported @@ -513,6 +516,7 @@ build_kernel() { cmd+=("$VERBOSE") cmd+=("-j$JOBS") cmd+=("KCFLAGS=-ffunction-sections -fdata-sections") + cmd+=("OBJTOOL_ARGS=${objtool_args[*]}") cmd+=("vmlinux") cmd+=("modules") ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-11-18 9:14 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-11-12 23:32 [PATCH 0/2] objtool: xxhash dependency improvements Josh Poimboeuf 2025-11-12 23:32 ` [PATCH 1/2] objtool: Set minimum xxhash version to 0.8 Josh Poimboeuf 2025-11-13 2:25 ` Michael Kelley 2025-11-18 9:14 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf 2025-11-12 23:32 ` [PATCH 2/2] objtool/klp: Only enable --checksum when needed Josh Poimboeuf 2025-11-13 2:29 ` Michael Kelley 2025-11-18 9:14 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.