public inbox for live-patching@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: live-patching@vger.kernel.org, Jiri Kosina <jikos@kernel.org>,
	Miroslav Benes <mbenes@suse.cz>, Petr Mladek <pmladek@suse.com>
Subject: Re: [PATCH 3/5] objtool/klp: validate patches with git apply --recount
Date: Tue, 3 Feb 2026 11:45:51 -0500	[thread overview]
Message-ID: <604a8b96-47f2-4986-b602-c7bdf3de7cca@redhat.com> (raw)
In-Reply-To: <72pzjkj4vnp2vp4ekbj3wnjr62yuywk67tavzn27zetmkg2tjh@nkpihey5cc3g>

On 1/30/26 6:02 PM, Josh Poimboeuf wrote:
> On Fri, Jan 30, 2026 at 02:59:53PM -0800, Josh Poimboeuf wrote:
>> On Fri, Jan 30, 2026 at 03:38:40PM -0500, Joe Lawrence wrote:
>>> On Fri, Jan 30, 2026 at 12:05:35PM -0800, Josh Poimboeuf wrote:
>>>> Hm, isn't the whole point of --recount that it ignores the line numbers?
>>>> Or does it just ignore the numbers after the commas (the counts)?
>>>>
>>>
>>> I don't know exactly.  As I continue digging into the test that sent me
>>> down this path, I just found that `git apply --recount` doesn't like
>>> some output generated by `combinediff -q --combine` even with NO line
>>> drift... then if I manually added in corresponding diff command lines
>>> (to make it look more like a .patch file generated by `diff -Nu`), ie:
>>>
>>>   diff -Nu src.orig/fs/proc/array.c src/fs/proc/array.c     <---
>>>   --- src.orig/fs/proc/array.c
>>>   +++ src/fs/proc/array.c
>>>
>>> Suddenly `git apply --recount` is happy with the patch.
>>>
>>> So I suspect that I started with git not liking the hunks generated by
>>> combinediff and drove it to the rebase feature, which solves a more
>>> interesting problem, but by side effect smoothed over this format
>>> issue when it recreated the patch with git.
>>>
>>> Anyway, I think this patch still stands on it's own: perform the same
>>> apply/revert check as what would happen in the fixup steps to fail
>>> faster for the user?
>>
>> If we just run fix_patches() at the beginning then can we just get rid
>> of validate_patches() altogether?
> 
> Or at least validate_patches() could be replaced with
> check_unsupported_patches(), as the apply/revert test wouldn't be needed
> since the actual apply/revert would happen immediately after that in
> fix_patches().
> 

Currently fix_patches runs in short-circuit step (2) after building the
original kernel.  But what if the user runs:

 $ klp-build -T 0001.patch
 $ klp-build -S 2 0002.patch

If we move fix_patches() to step (1) to fail fast and eliminate a
redundant apply/revert, aren't we then going to miss it if the user
jumps to step (2)?

Is there a way to check without actually doing it if we're going to
build the original kernel first?

And while we're here, doesn't this mean that we're currently not running
validate_patches() when skipping to step (2)?

-- 
Joe


  reply	other threads:[~2026-02-03 16:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 17:59 [PATCH 0/5] objtool/klp-build: small fixups and enhancements Joe Lawrence
2026-01-30 17:59 ` [PATCH 1/5] objtool/klp: limit parent .git directory search Joe Lawrence
2026-01-30 17:59 ` [PATCH 2/5] objtool/klp: handle patches that add new files Joe Lawrence
2026-01-30 20:02   ` Josh Poimboeuf
2026-01-30 17:59 ` [PATCH 3/5] objtool/klp: validate patches with git apply --recount Joe Lawrence
2026-01-30 20:05   ` Josh Poimboeuf
2026-01-30 20:38     ` Joe Lawrence
2026-01-30 22:59       ` Josh Poimboeuf
2026-01-30 23:02         ` Josh Poimboeuf
2026-02-03 16:45           ` Joe Lawrence [this message]
2026-02-03 17:53             ` Song Liu
2026-02-03 19:47               ` Josh Poimboeuf
2026-01-30 17:59 ` [PATCH 4/5] objtool/klp: add -z/--fuzz patch rebasing option Joe Lawrence
2026-01-30 19:13   ` Song Liu
2026-01-30 19:58   ` Song Liu
2026-01-30 20:13     ` Joe Lawrence
2026-01-30 20:46       ` Song Liu
2026-01-30 22:54         ` Josh Poimboeuf
2026-01-30 23:20           ` Song Liu
2026-01-30 23:36             ` Josh Poimboeuf
2026-01-30 20:09   ` Josh Poimboeuf
2026-01-30 20:41     ` Joe Lawrence
2026-01-30 23:31       ` Josh Poimboeuf
2026-01-30 17:59 ` [PATCH 5/5] objtool/klp: provide friendlier error messages Joe Lawrence
2026-01-31  0:37   ` Josh Poimboeuf
2026-01-30 19:18 ` [PATCH 0/5] objtool/klp-build: small fixups and enhancements 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=604a8b96-47f2-4986-b602-c7bdf3de7cca@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=pmladek@suse.com \
    /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