public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Lawrence <joe.lawrence@redhat.com>
To: Miroslav Benes <mbenes@suse.cz>
Cc: Pablo Hugen <phugen@redhat.com>,
	live-patching@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, jpoimboe@kernel.org,
	jikos@kernel.org, pmladek@suse.com, shuah@kernel.org
Subject: Re: [PATCH] selftests/livepatch: add test for module function patching
Date: Tue, 24 Mar 2026 10:45:15 -0400	[thread overview]
Message-ID: <acKje1XMQMQQYBIL@redhat.com> (raw)
In-Reply-To: <177436214729.62466.7977538958560300344.b4-review@b4>

On Tue, Mar 24, 2026 at 03:22:27PM +0100, Miroslav Benes wrote:
> On Fri, 20 Mar 2026 17:11:17 -0300, Pablo Hugen <phugen@redhat.com> wrote:
> > Add a target module and livepatch pair that verify module function
> > patching via a proc entry. Two test cases cover both the
> > klp_enable_patch path (target loaded before livepatch) and the
> > klp_module_coming path (livepatch loaded before target).
> 
> We sort of test the same in test-callbacks.sh. Just using different
> means. I think I would not mind having this as well.
> 
> Petr, Joe, what do you think?
> 

I was *just* in the middle of replying to the patch when yours came in,
so I'll just move over here.  I had noticed the same thing re:
test-callbacks.sh despite originally suggested writing this test to
Pablo (and forgot about the callbacks test module).  With that, I agree
that it's a nice basic sanity check that's obvious about what it's
testing.

> >
> >
> > diff --git a/tools/testing/selftests/livepatch/test_modules/test_klp_mod_target.c b/tools/testing/selftests/livepatch/test_modules/test_klp_mod_target.c
> > new file mode 100644
> > index 000000000000..9643984d2402
> > --- /dev/null
> > +++ b/tools/testing/selftests/livepatch/test_modules/test_klp_mod_target.c
> > @@ -0,0 +1,39 @@
> > [ ... skip 11 lines ... ]
> > +
> > +static noinline int test_klp_mod_target_show(struct seq_file *m, void *v)
> > +{
> > +	seq_printf(m, "%s: %s\n", THIS_MODULE->name, "original output");
> > +	return 0;
> > +}
> 
> A nit but is 'noinline' keyword needed here? proc_create_single() below
> takes a function pointer so hopefully test_klp_mod_target_show() stays
> even without it?
> 

No strong preference either way.  I won't fault a livepatch developer
for being paranoid w/respect to the compiler :D

Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
--
Joe


  reply	other threads:[~2026-03-24 14:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 20:11 [PATCH] selftests/livepatch: add test for module function patching Pablo Hugen
2026-03-24 14:22 ` Miroslav Benes
2026-03-24 14:45   ` Joe Lawrence [this message]
2026-03-25  8:45     ` Miroslav Benes
2026-03-26 14:34 ` Petr Mladek
2026-03-26 20:41   ` Joe Lawrence
2026-03-27 10:46     ` Miroslav Benes

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=acKje1XMQMQQYBIL@redhat.com \
    --to=joe.lawrence@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=phugen@redhat.com \
    --cc=pmladek@suse.com \
    --cc=shuah@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