mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Joe Lawrence <joe.lawrence@redhat.com>
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jessica Yu <jeyu@kernel.org>, Jiri Kosina <jikos@kernel.org>,
	Miroslav Benes <mbenes@suse.cz>, Petr Mladek <pmladek@suse.com>,
	Chris J Arges <chris.j.arges@canonical.com>
Subject: Re: [PATCH v3] livepatch: add (un)patch callbacks
Date: Wed, 16 Aug 2017 15:29:23 -0500	[thread overview]
Message-ID: <20170816202923.tvtnpf6pr45cberl@treble> (raw)
In-Reply-To: <1502911024-16143-2-git-send-email-joe.lawrence@redhat.com>

On Wed, Aug 16, 2017 at 03:17:04PM -0400, Joe Lawrence wrote:
> Provide livepatch modules a klp_object (un)patching notification
> mechanism.  Pre and post-(un)patch callbacks allow livepatch modules to
> setup or synchronize changes that would be difficult to support in only
> patched-or-unpatched code contexts.
> 
> Callbacks can be registered for target module or vmlinux klp_objects,
> but each implementation is klp_object specific.
> 
>   - Pre-(un)patch callbacks run before any (un)patching action takes
>     place.
> 
>   - Post-(un)patch callbacks run once an object has been (un)patched and
>     the klp_patch fully transitioned to its target state.
> 
> Example use cases include modification of global data and registration
> of newly available services/handlers.
> 
> See Documentation/livepatch/callback.txt for details.
> 
> Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
> ---
>  Documentation/livepatch/callbacks.txt        |  87 ++++++++++++
>  include/linux/livepatch.h                    |  81 ++++++++++++
>  kernel/livepatch/core.c                      |  37 ++++--
>  kernel/livepatch/patch.c                     |   5 +-
>  kernel/livepatch/transition.c                |  21 ++-
>  samples/livepatch/Makefile                   |   2 +
>  samples/livepatch/livepatch-callbacks-demo.c | 190 +++++++++++++++++++++++++++
>  samples/livepatch/livepatch-callbacks-mod.c  |  53 ++++++++
>  8 files changed, 462 insertions(+), 14 deletions(-)
>  create mode 100644 Documentation/livepatch/callbacks.txt
>  create mode 100644 samples/livepatch/livepatch-callbacks-demo.c
>  create mode 100644 samples/livepatch/livepatch-callbacks-mod.c
> 
> diff --git a/Documentation/livepatch/callbacks.txt b/Documentation/livepatch/callbacks.txt
> new file mode 100644
> index 000000000000..e18f2678f3bb
> --- /dev/null
> +++ b/Documentation/livepatch/callbacks.txt
> @@ -0,0 +1,87 @@
> +(Un)patching Callbacks
> +======================
> +
> +Livepatch (un)patch-callbacks provide a mechanism for livepatch modules
> +to execute callback functions when a kernel object is (un)patched.  They
> +can be considered a "power feature" that extends livepatching abilities
> +to include:
> +
> +  - Safe updates to global data
> +
> +  - "Patches" to init and probe functions
> +
> +  - Patching otherwise unpatchable code (i.e. assembly)
> +
> +In most cases, (un)patch hooks will need to be used in conjunction with

s/hooks/callbacks/

(though I wouldn't be opposed to changing them back to "hooks" anyway as
it's one fewer syllable :-) but no strong opinion either way on that)

-- 
Josh

  reply	other threads:[~2017-08-16 20:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-16 19:17 [PATCH v3] " Joe Lawrence
2017-08-16 19:17 ` [PATCH v3] livepatch: " Joe Lawrence
2017-08-16 20:29   ` Josh Poimboeuf [this message]
2017-08-18 13:58   ` Petr Mladek
2017-08-21 21:18     ` Joe Lawrence
2017-08-22  9:17       ` Petr Mladek
2017-08-16 20:20 ` [PATCH v3] " Josh Poimboeuf
2017-08-18 14:09   ` Petr Mladek

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=20170816202923.tvtnpf6pr45cberl@treble \
    --to=jpoimboe@redhat.com \
    --cc=chris.j.arges@canonical.com \
    --cc=jeyu@kernel.org \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=linux-kernel@vger.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

all inboxes | Powered by JetHome®