[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240904075433.GD4723@noisy.programming.kicks-ass.net>
Date: Wed, 4 Sep 2024 09:54:33 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
x86@...nel.org, Miroslav Benes <mbenes@...e.cz>,
Petr Mladek <pmladek@...e.com>,
Joe Lawrence <joe.lawrence@...hat.com>,
Jiri Kosina <jikos@...nel.org>,
Marcos Paulo de Souza <mpdesouza@...e.com>,
Song Liu <song@...nel.org>
Subject: Re: [RFC 29/31] objtool: Calculate function checksums
On Mon, Sep 02, 2024 at 09:00:12PM -0700, Josh Poimboeuf wrote:
> Calculate per-function checksums based on the functions' content and
> relocations. This will enable objtool to do binary diffs.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
> ---
> scripts/Makefile.lib | 1 +
> tools/objtool/Makefile | 7 +-
> tools/objtool/builtin-check.c | 1 +
> tools/objtool/check.c | 137 +++++++++++++++++++++++-
> tools/objtool/elf.c | 31 ++++++
> tools/objtool/include/objtool/builtin.h | 3 +-
> tools/objtool/include/objtool/check.h | 5 +-
> tools/objtool/include/objtool/elf.h | 11 +-
> tools/objtool/include/objtool/objtool.h | 2 +
> 9 files changed, 188 insertions(+), 10 deletions(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 8411e3d53938..9f4708702ef7 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -265,6 +265,7 @@ ifdef CONFIG_OBJTOOL
>
> objtool := $(objtree)/tools/objtool/objtool
>
> +objtool-args-$(CONFIG_LIVEPATCH) += --sym-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/tools/objtool/Makefile b/tools/objtool/Makefile
> index bf7f7f84ac62..6833804ca419 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -21,6 +21,9 @@ OBJTOOL_IN := $(OBJTOOL)-in.o
> LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null)
> LIBELF_LIBS := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf)
>
> +LIBXXHASH_FLAGS := $(shell $(HOSTPKG_CONFIG) libxxhash --cflags 2>/dev/null)
> +LIBXXHASH_LIBS := $(shell $(HOSTPKG_CONFIG) libxxhash --libs 2>/dev/null || echo -lxxhash)
This was not installed on my system and I got a nasty build fail. Should
we make all this depend on CONFIG_LIVEPATCH or force world+dog to
install this as yet another kernel build dependency?
Powered by blists - more mailing lists