All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: live-patching@vger.kernel.org
Cc: "Song Liu" <song@kernel.org>, "Petr Mladek" <pmladek@suse.com>,
	"Josh Poimboeuf" <jpoimboe@kernel.org>,
	"Miroslav Benes" <mbenes@suse.cz>
Subject: Re: [RFC 3/4] objtool/klp: add --arch option to display target architecture
Date: Thu, 14 May 2026 21:10:42 +0000	[thread overview]
Message-ID: <20260514211042.C96E8C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260512221102.2720763-4-joe.lawrence@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `--arch` option is inaccessible on non-x86 architectures because the `klp` subcommand is conditionally compiled only for x86.
--

commit bd45d7b713ebb8e72f88be16df165f29efd9fc96
Author: Joe Lawrence <joe.lawrence@redhat.com>

objtool/klp: add --arch option to display target architecture

This commit adds an --arch option to the klp diff subcommand to print the
target architecture objtool was compiled for. This allows scripts to verify
compatibility before processing object files.

> diff --git a/tools/objtool/klp-diff.c b/tools/objtool/klp-diff.c
> --- a/tools/objtool/klp-diff.c
> +++ b/tools/objtool/klp-diff.c
[ ... ]
> @@ -44,6 +44,7 @@ static const char * const klp_diff_usage[] = {
>  
>  static const struct option klp_diff_options[] = {
>  	OPT_GROUP("Options:"),
> +	OPT_BOOLEAN('a', "arch", &show_arch, "display target architecture"),
>  	OPT_BOOLEAN('d', "debug", &debug, "enable all debug output"),

Since the klp subcommand is conditionally compiled and only enabled for x86
architectures, will this option be accessible on other architectures?

According to the objtool Makefile, ARCH_HAS_KLP is strictly set to y
only when SRCARCH is x86. For all other architectures, BUILD_KLP is
disabled. This means that on non-x86 architectures, invoking
objtool klp diff --arch will fall back to the weak stub, returning an
"objtool: klp not implemented" error instead of printing the
architecture.

Since the architecture is a global property of the binary, would it make
more sense to expose this via a global flag like objtool --arch instead of
restricting it to the klp subcommand?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260512221102.2720763-1-joe.lawrence@redhat.com?part=3

  reply	other threads:[~2026-05-14 21:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 22:10 [RFC 0/4] klp-build: simple OOT module support Joe Lawrence
2026-05-12 22:10 ` [RFC 1/4] objtool/klp: add --symvers option to klp diff Joe Lawrence
2026-05-14 20:47   ` sashiko-bot
2026-05-12 22:11 ` [RFC 2/4] objtool/klp: allow special section entry size overrides Joe Lawrence
2026-05-14 20:58   ` sashiko-bot
2026-05-12 22:11 ` [RFC 3/4] objtool/klp: add --arch option to display target architecture Joe Lawrence
2026-05-14 21:10   ` sashiko-bot [this message]
2026-05-12 22:11 ` [RFC 4/4] livepatch/klp-build: add basic out-of-tree module patching support Joe Lawrence
2026-05-14 21:20   ` sashiko-bot
2026-05-12 23:30 ` [RFC 0/4] klp-build: simple OOT module support Song Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260514211042.C96E8C2BCB3@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=song@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.