public inbox for live-patching@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Joe Lawrence <joe.lawrence@redhat.com>
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, mbenes@suse.cz, shuah@kernel.org
Subject: speaker-test-module: Re: [PATCH] selftests/livepatch: add test for module function patching
Date: Mon, 30 Mar 2026 15:48:57 +0200	[thread overview]
Message-ID: <acp_Sa9iyGLdSN04@pathway.suse.cz> (raw)
In-Reply-To: <acWZ3r2CoSDy_NLf@redhat.com>

On Thu 2026-03-26 16:41:02, Joe Lawrence wrote:
> On Thu, Mar 26, 2026 at 03:34:36PM +0100, Petr Mladek wrote:
> > On Fri 2026-03-20 17:11:17, Pablo Hugen wrote:
> > > From: Pablo Alessandro Santos Hugen <phugen@redhat.com>
> > In my RFC, I created a helper module which implemented a person
> > (speaker) which would come on the stage and welcome the audience.
> > I am not sure if it was a good idea. But it became a bit confusing
> > when everything (module name, sysfs interface, function name, message)
> > included the same strings like (livepatch, callback, shadow_var).
> > 
> > Anyway, my tests produced messages like these:
> > 
> > +% cat $SYSFS_MODULE_DIR/$MOD_TARGET/parameters/welcome
> > +$MOD_TARGET: speaker_welcome: Hello, World!
> > 
> > , see https://lore.kernel.org/all/20250115082431.5550-9-pmladek@suse.com/
> > 
> > 
> > There were even tests which blocked the transition. They tested shadow
> > variables which added an applause to the message. They did something like:
> > 
> > <paste>
> > All four callbacks are used as follows:
> > 
> >   + pre_patch() allocates a shadow variable with a string and fills
> > 		it with "[]".
> >   + post_patch() fills the string with "[APPLAUSE]".
> >   + pre_unpatch() reverts the string back to "[]".
> >   + post_unpatch() releases the shadow variable.
> > 
> > The welcome message printed by the livepatched function allows us to
> > distinguish between the transition and the completed transition.
> > Specifically, the speaker's welcome message appears as:
> > 
> >   + Not patched system:		 "Hello, World!"
> >   + Transition (unpatched task): "[] Hello, World!"
> >   + Transition (patched task):	 "[] Ladies and gentlemen, ..."
> >   + Patched system:		 "[APPLAUSE] Ladies and gentlemen, ..."
> > </paste>
> > 
> > , see https://lore.kernel.org/all/20250115082431.5550-11-pmladek@suse.com/
> > 
> > Sigh, I have done many changes in the tests for v1. But they still
> > need some love (and rebasing) for sending.
> > 
> 
> If these can be pulled out independently from the v1 patch, perhaps
> Pablo would want to hack on that in a follow up series?

Unfortunately, the selftest changes can't be pulled out easily.
The new test module and related livepatches are implemented using
the reworked livepatch API. :-/

I hope that I'll find time to work on it rather sooner than later.

Best Regards,
Petr

      parent reply	other threads:[~2026-03-30 13:49 UTC|newest]

Thread overview: 11+ 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
2026-03-25  8:45     ` Miroslav Benes
2026-03-31 20:52       ` Pablo Hugen
2026-03-26 14:34 ` Petr Mladek
2026-03-26 20:41   ` Joe Lawrence
2026-03-27 10:46     ` Miroslav Benes
2026-03-31 21:10       ` Pablo Hugen
2026-03-30 13:43     ` Petr Mladek
2026-03-30 13:48     ` Petr Mladek [this message]

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=acp_Sa9iyGLdSN04@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --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=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