All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yafang Shao" <laoar.shao@gmail.com>,
	mbenes@suse.cz, jpoimboe@kernel.org, joe.lawrence@redhat.com,
	pmladek@suse.com, song@kernel.org, jikos@kernel.org
Cc: live-patching@vger.kernel.org
Subject: Re: [PATCH v7 for-next 3/8] livepatch: Implement replace set for scoped atomic replace
Date: Tue, 25 Aug 2026 11:59:48 +0000	[thread overview]
Message-ID: <20260825115949.50A6E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260825114641.80452-4-laoar.shao@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Contradiction between documentation/commit message and actual code regarding the 'obsoletes' list.
--

--- Patch [3]: [PATCH v7 for-next 3/8] livepatch: Implement replace set for scoped atomic replace ---
commit 32e1bcc9ed17f1580951816746e0cfa7cadbca0b
Author: Yafang Shao <laoar.shao@gmail.com>

livepatch: Implement replace set for scoped atomic replace

This commit replaces the boolean replace flag with a more flexible model
using provides and obsoletes fields to allow multiple independent livepatch
sets to coexist on the same system.

> The klp-build script is updated with -p/--provides and -r/--obsoletes
> options. The obsoletes list automatically includes the provides id
> and deduplicates entries. Input validation rejects malformed values
> at build time.

[Severity: Medium]
Is this description accurate? The code and inline comments in the build
script and init.c explicitly state that the provides ID is not included in
the obsoletes list, and the kernel instead relies on explicitly checking the
provides ID directly.

> diff --git a/Documentation/livepatch/cumulative-patches.rst b/Documentation/livepatch/cumulative-patches.rst
> index 1931f318976a5..04352ae3f0d06 100644
> --- a/Documentation/livepatch/cumulative-patches.rst
> +++ b/Documentation/livepatch/cumulative-patches.rst

[ ... ]

> +Provides and Obsoletes
> +-----------------------
> +
> +The ``provides`` field in ``struct klp_patch`` is an unsigned integer that
> +identifies the livepatch's replace set. By default, it is 0.
> +
> +The ``obsoletes`` field is an optional array of unsigned integers that
> +specifies additional ``provides`` ids to be replaced when this patch is
> +loaded. By default, it includes the patch's own ``provides`` id, ensuring
> +that a new patch always replaces any existing patch with the same
> +``provides`` id.

[Severity: Medium]
This isn't a code bug, but does this documentation match the implementation?
The text here states that the obsoletes field automatically includes the
patch's own provides id by default. 

> diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
> index b52a8489d9f67..64bf3fce7fbc1 100755
> --- a/scripts/livepatch/klp-build
> +++ b/scripts/livepatch/klp-build

[ ... ]

> @@ -235,6 +254,37 @@ process_args() {
>  		exit 1
>  	fi
>  
> +	# Remove duplicates from obsoletes (if specified)
> +	# Note: provides ID is not added here; the kernel will replace
> +	# livepatch with the same provides ID.

[Severity: Medium]
Here the build script explicitly notes that the provides ID is not added to
the obsoletes list. Could the commit message and the documentation in
cumulative-patches.rst be updated to match this behavior to avoid confusion?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260825114641.80452-1-laoar.shao@gmail.com?part=3

  reply	other threads:[~2026-08-25 11:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 11:46 [PATCH v7 for-next 0/8] livepatch: Introduce replace set support Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 1/8] livepatch: Make klp_find_func() non static Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 2/8] livepatch: Call klp_init_patch_early() earlier Yafang Shao
2026-08-25 12:06   ` sashiko-bot
2026-08-25 12:11     ` Yafang Shao
2026-08-27 23:57   ` Josh Poimboeuf
2026-08-28  2:24     ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 3/8] livepatch: Implement replace set for scoped atomic replace Yafang Shao
2026-08-25 11:59   ` sashiko-bot [this message]
2026-08-25 12:10     ` Yafang Shao
2026-08-28  0:26   ` Josh Poimboeuf
2026-08-28  3:03     ` Yafang Shao
2026-08-28  3:39       ` Josh Poimboeuf
2026-08-28  5:42         ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 4/8] livepatch: Deprecate stack_order Yafang Shao
2026-08-28  0:29   ` Josh Poimboeuf
2026-08-28  3:14     ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 5/8] selftests/livepatch: Adapt atomic replace tests to provides/obsoletes Yafang Shao
2026-08-28  0:31   ` Josh Poimboeuf
2026-08-28  3:56     ` Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 6/8] selftests/livepatch: Add provides/obsoletes test scenarios Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 7/8] selftests/livepatch: Add test for state ID conflict across provides Yafang Shao
2026-08-25 11:46 ` [PATCH v7 for-next 8/8] selftests/livepatch: Add test for function " Yafang Shao

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=20260825115949.50A6E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@kernel.org \
    --cc=laoar.shao@gmail.com \
    --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.