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 v4 1/3] livepatch: add (un)patch callbacks
Date: Wed, 30 Aug 2017 09:20:25 -0500 [thread overview]
Message-ID: <20170830142025.gjvyo23xt3uzyt7u@treble> (raw)
In-Reply-To: <20170830132716.6tdjkfafpuay36cs@redhat.com>
On Wed, Aug 30, 2017 at 09:27:16AM -0400, Joe Lawrence wrote:
> > So instead of 'obj->pre_patch_callback_done', how about
> > 'obj->callbacks_enabled'?
> >
> > It could be set in the following cases:
> >
> > a) if the object has a pre_patch callback, set obj->callbacks_enabled
> > after the pre_patch callback succeeds;
> >
> > b) else, if the patch does *not* have a pre_patch callback, set
> > obj->callbacks_enabled after klp_patch_object() succeeds.
> >
> > And the variable would need to be cleared after the post_unpatch
> > callback was run.
> >
> > It's a bit complicated, but that seems to be the most logicial behavior
> > as far as I can tell.
> >
> > Thoughts?
>
> What if we flip it around as "callbacks_disabled"? By default, kzalloc
> would init as false. It would only be set to true if the pre-patch
> callback is provided and if it returns failure. Would that reduce the
> number of conditions when we need to set this var?
Yeah, 'callbacks_disabled' sounds better.
> Also, as you noted, I think it would need to reset/cleared after the
> post-patch callback. (For the livepatch-already-loaded cases.)
Since it can only be set when the pre-patch fails, I think it would only
need to be cleared after post-unpatch?
Or another alternative would be to unconditionally clear and/or set it
in klp_pre_patch_callback() so that its previous value doesn't matter.
--
Josh
next prev parent reply other threads:[~2017-08-30 14:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-25 19:09 [PATCH v4 0/3] livepatch callbacks Joe Lawrence
2017-08-25 19:10 ` [PATCH v4 1/3] livepatch: add (un)patch callbacks Joe Lawrence
2017-08-29 15:49 ` Josh Poimboeuf
2017-08-29 19:22 ` Joe Lawrence
2017-08-29 19:59 ` Josh Poimboeuf
2017-08-30 13:27 ` Joe Lawrence
2017-08-30 14:20 ` Josh Poimboeuf [this message]
2017-08-30 14:48 ` Josh Poimboeuf
2017-08-25 19:10 ` [PATCH v4 2/3] livepatch: move transition "complete" notice into klp_complete_transition() Joe Lawrence
2017-08-29 15:53 ` Josh Poimboeuf
2017-08-25 19:10 ` [PATCH v4 3/3] livepatch: add transition notices Joe Lawrence
2017-08-29 15:55 ` Josh Poimboeuf
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=20170830142025.gjvyo23xt3uzyt7u@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®