mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Song Liu <song@kernel.org>
Cc: live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
	 jikos@kernel.org, mbenes@suse.cz, pmladek@suse.com,
	joe.lawrence@redhat.com,  shuah@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 02/11] klp-build: Add --patch-only option
Date: Mon, 26 Oct 2026 19:22:25 -0700	[thread overview]
Message-ID: <auAGCNUz9BChLpaX@jpoimboe> (raw)
In-Reply-To: <20261017002441.716615-3-song@kernel.org>

On Fri, Oct 16, 2026 at 05:24:32PM -0700, Song Liu wrote:
> klp-build fixes the input patches before building the patched kernel:
> it combines them into a single patch against the original source and
> adds #line directives, so that unchanged functions further down a
> patched file keep their __LINE__ values.  This only happens after the
> original kernel has been built, so seeing the result, or testing this
> step, takes a full kernel build and --keep-tmp.

Not sure how this last sentence is relevant, either way klp-build will
run to completion (or failure)?

Also the above feels like a strawman, I think the real justification for
this is the selftests?

> +++ b/scripts/livepatch/klp-build
> @@ -19,7 +19,7 @@ set -o nounset
>  # This helps keep execution in pipes so pipefail+ERR trap can catch errors.
>  shopt -s lastpipe
>  
> -unset DEBUG_CLONE DIFF_CHECKSUM SKIP_CLEANUP VERBOSE XTRACE
> +unset DEBUG_CLONE DIFF_CHECKSUM PATCH_ONLY SKIP_CLEANUP VERBOSE XTRACE
>  
>  REPLACE=1
>  SHORT_CIRCUIT=0
> @@ -137,6 +137,7 @@ Options:
>  
>  Advanced Options:
>     -d, --debug			Show symbol/reloc cloning decisions
> +       --patch-only		Print the fixed patch(es) and exit without building

This is basically bolting a test hook onto klp-build.

What if we move the patch validating/fixing into a self-contained
klp-prepare-patch script?  There might be a small amount of duplication
for some of the patch handling but that would hopefully be minimal.

Then the selftests can run it directly and klp-build doesn't need the
new option and the PATCH_ONLY special casing.

-- 
Josh

  reply	other threads:[~2026-10-27  2:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17  0:24 [PATCH 00/11] klp-build: Fix dependent patches, add selftests Song Liu
2026-10-17  0:24 ` [PATCH 01/11] klp-build: Fix dependent patches in a series Song Liu
2026-10-27  1:43   ` Josh Poimboeuf
2026-10-28 21:43     ` Song Liu
2026-10-17  0:24 ` [PATCH 02/11] klp-build: Add --patch-only option Song Liu
2026-10-27  2:22   ` Josh Poimboeuf [this message]
2026-10-17  0:24 ` [PATCH 03/11] selftests/livepatch: Add tests for klp-build's patch handling Song Liu
2026-10-17  0:24 ` [PATCH 04/11] selftests/livepatch: Test klp-build with dependent patches Song Liu
2026-10-17  0:24 ` [PATCH 05/11] selftests/livepatch: Test klp-build with patches to different functions Song Liu
2026-10-17  0:24 ` [PATCH 06/11] selftests/livepatch: Test klp-build with patches which cancel out Song Liu
2026-10-17  0:24 ` [PATCH 07/11] selftests/livepatch: Test klp-build with created and deleted files Song Liu
2026-10-17  0:24 ` [PATCH 08/11] selftests/livepatch: Test where klp-build adds #line directives Song Liu
2026-10-17  0:24 ` [PATCH 09/11] selftests/livepatch: Test klp-build's rejection of unsupported files Song Liu
2026-10-17  0:24 ` [PATCH 10/11] selftests/livepatch: Test klp-build with patches which don't apply Song Liu
2026-10-17  0:24 ` [PATCH 11/11] selftests/livepatch: Test klp-build with patches which need offset or fuzz 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=auAGCNUz9BChLpaX@jpoimboe \
    --to=jpoimboe@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    --cc=shuah@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®