From: Petr Mladek <pmladek@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz,
joe.lawrence@redhat.com, song@kernel.org,
live-patching@vger.kernel.org
Subject: Re: [PATCH v3 6/7] selftests/livepatch: Add test for state ID conflict across replace_sets
Date: Fri, 12 Jun 2026 10:55:53 +0200 [thread overview]
Message-ID: <aivJmcLWkpdWGkzO@pathway.suse.cz> (raw)
In-Reply-To: <20260607131659.29281-7-laoar.shao@gmail.com>
Hi,
I am sorry I am getting busy with some other tasks so I won't review
the new selftests carefully. They might change in v4 anyway.
Just one note, see below.
On Sun 2026-06-07 21:16:58, Yafang Shao wrote:
> Livepatches with different replace_sets must not share the same state
> ID. If a second livepatch attempts to reuse a state ID already
> registered by a livepatch with a different replace_set, the loading
> will fail.
>
> Add a test case to verify this behavior. The test result is as follows:
>
> $ ./test-state.sh
> TEST: system state modification ... ok
> TEST: taking over system state modification ... ok
> TEST: compatible cumulative livepatches ... ok
> TEST: incompatible cumulative livepatches ... ok
> TEST: livepatches state compatibility ... ok <<<< This case
>
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
> .../testing/selftests/livepatch/test-state.sh | 34 ++++
> .../selftests/livepatch/test_modules/Makefile | 1 +
> .../livepatch/test_modules/test_klp_state.c | 2 +-
> .../livepatch/test_modules/test_klp_state2.c | 2 +-
> .../livepatch/test_modules/test_klp_state4.c | 163 ++++++++++++++++++
> 5 files changed, 200 insertions(+), 2 deletions(-)
> create mode 100644 tools/testing/selftests/livepatch/test_modules/test_klp_state4.c
>
> --- /dev/null
> +++ b/tools/testing/selftests/livepatch/test_modules/test_klp_state4.c
> @@ -0,0 +1,163 @@
^^^^^^^^^
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * This test is identical to test_klp_state4.c, except that replace_set is
> + * set to 4 instead of 0.
> + */
This seems to be copy&paste of another test module. I suggest to solve
this by defining a variable in using #include, for example,
look for tools/testing/selftests/livepatch/test_modules/test_klp_speaker2.c
at
https://lore.kernel.org/all/20250115082431.5550-10-pmladek@suse.com/
Best Regards,
Petr
next prev parent reply other threads:[~2026-06-12 8:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-07 13:16 [PATCH v3 0/7] livepatch: Introduce replace set support Yafang Shao
2026-06-07 13:16 ` [PATCH v3 1/7] livepatch: Fix NULL pointer dereference in klp_find_func() Yafang Shao
2026-06-09 13:27 ` Petr Mladek
2026-06-10 3:00 ` Yafang Shao
2026-06-07 13:16 ` [PATCH v3 2/7] livepatch: Move klp_find_func() into core.h Yafang Shao
2026-06-09 15:28 ` Petr Mladek
2026-06-10 3:01 ` Yafang Shao
2026-06-07 13:16 ` [PATCH v3 3/7] livepatch: Support scoped atomic replace using replace_set Yafang Shao
2026-06-07 13:33 ` sashiko-bot
2026-06-07 14:00 ` Yafang Shao
2026-06-09 16:00 ` Petr Mladek
2026-06-10 3:24 ` Yafang Shao
2026-06-10 9:48 ` Petr Mladek
2026-06-11 12:58 ` Petr Mladek
2026-06-10 14:45 ` code review: was: " Petr Mladek
2026-06-11 3:06 ` Yafang Shao
2026-06-07 13:16 ` [PATCH v3 4/7] livepatch: Deprecate stack_order Yafang Shao
2026-06-07 13:31 ` sashiko-bot
2026-06-10 15:11 ` Petr Mladek
2026-06-11 3:21 ` Yafang Shao
2026-06-07 13:16 ` [PATCH v3 5/7] selftests/livepatch: Update tests for replace_set Yafang Shao
2026-06-07 13:29 ` sashiko-bot
2026-06-07 13:16 ` [PATCH v3 6/7] selftests/livepatch: Add test for state ID conflict across replace_sets Yafang Shao
2026-06-12 8:55 ` Petr Mladek [this message]
2026-06-07 13:16 ` [PATCH v3 7/7] 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=aivJmcLWkpdWGkzO@pathway.suse.cz \
--to=pmladek@suse.com \
--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=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