Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1723382

Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks

From Josh Poimboeuf <jpoimboe@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks
Date 2017-08-30 16:30 +0200
Message-ID <ukcad-ZN-5@gated-at.bofh.it> (permalink)
References (1 earlier) <uisj8-80n-19@gated-at.bofh.it> <ujQW5-4ru-13@gated-at.bofh.it> <ujUn1-6IJ-57@gated-at.bofh.it> <ujUQ2-6TY-13@gated-at.bofh.it> <ukbeb-oA-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/3] livepatch callbacks Joe Lawrence <joe.lawrence@redhat.com> - 2017-08-25 21:20 +0200
  [PATCH v4 2/3] livepatch: move transition "complete" notice into klp_complete_transition() Joe Lawrence <joe.lawrence@redhat.com> - 2017-08-25 21:20 +0200
    Re: [PATCH v4 2/3] livepatch: move transition "complete" notice into  klp_complete_transition() Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-29 18:00 +0200
  [PATCH v4 3/3] livepatch: add transition notices Joe Lawrence <joe.lawrence@redhat.com> - 2017-08-25 21:20 +0200
    Re: [PATCH v4 3/3] livepatch: add transition notices Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-29 18:00 +0200
  Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-29 17:50 +0200
    Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks Joe Lawrence <joe.lawrence@redhat.com> - 2017-08-29 21:30 +0200
      Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-29 22:00 +0200
        Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks Joe Lawrence <joe.lawrence@redhat.com> - 2017-08-30 15:30 +0200
          Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-30 16:30 +0200
  Re: [PATCH v4 1/3] livepatch: add (un)patch callbacks Josh Poimboeuf <jpoimboe@redhat.com> - 2017-08-30 16:50 +0200

csiph-web