Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-02-01 Thread Josh Poimboeuf
On Mon, Feb 01, 2016 at 01:27:57PM +0100, Jiri Kosina wrote: > On Fri, 29 Jan 2016, Josh Poimboeuf wrote: > > > Right, as you say it's basically a nop 99.99% of the time. But we still > > need to do the "are any patches loaded" check, so we still need the call > > into a livepatch function to d

Re: livepatch: Implement separate coming and going module notifiers

2016-02-01 Thread Josh Poimboeuf
On Fri, Jan 29, 2016 at 05:58:29PM -0500, Jessica Yu wrote: > +++ Josh Poimboeuf [29/01/16 13:42 -0600]: > >On Fri, Jan 29, 2016 at 08:25:15PM +0100, Miroslav Benes wrote: > >>On Fri, 29 Jan 2016, Josh Poimboeuf wrote: > >> > >>> On Fri, Jan 29, 2016 at 12:40:14PM -0500, Steven Rostedt wrote: > >>>

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-02-01 Thread Jiri Kosina
On Fri, 29 Jan 2016, Josh Poimboeuf wrote: > Right, as you say it's basically a nop 99.99% of the time. But we still > need to do the "are any patches loaded" check, so we still need the call > into a livepatch function to do that. We might create a static key for that (some might call it ove

Re: livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Steven Rostedt
On Fri, 29 Jan 2016 17:58:29 -0500 Jessica Yu wrote: > diff --git a/kernel/module.c b/kernel/module.c > index 8358f46..eccd289 100644 > --- a/kernel/module.c > +++ b/kernel/module.c > @@ -979,8 +979,12 @@ SYSCALL_DEFINE2(delete_module, const char __user *, > name_user, > /* Final destructi

Re: livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Jessica Yu
+++ Josh Poimboeuf [29/01/16 13:42 -0600]: On Fri, Jan 29, 2016 at 08:25:15PM +0100, Miroslav Benes wrote: On Fri, 29 Jan 2016, Josh Poimboeuf wrote: > On Fri, Jan 29, 2016 at 12:40:14PM -0500, Steven Rostedt wrote: > > [ Added Rusty, as he's still maintainer of the module code ] > > > > On Fri

Re: livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Josh Poimboeuf
On Fri, Jan 29, 2016 at 03:04:51PM -0500, Jessica Yu wrote: > +++ Josh Poimboeuf [29/01/16 11:30 -0600]: > >On Fri, Jan 29, 2016 at 05:30:46PM +0100, Miroslav Benes wrote: > >>Otherwise than that it looks good. I agree there are advantages to split > >>the notifiers. For example we can replace the

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Josh Poimboeuf
On Fri, Jan 29, 2016 at 03:08:23PM -0500, Steven Rostedt wrote: > On Fri, 29 Jan 2016 13:47:15 -0600 > Josh Poimboeuf wrote: > > > > > Although, I have to admit, if live kernel patching is configured in, > > > it's not always needed to be called here, does it? With ftrace, the > > > call has to

Re: livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Steven Rostedt
On Fri, 29 Jan 2016 15:09:31 -0500 Steven Rostedt wrote: > On Fri, 29 Jan 2016 15:04:51 -0500 > Jessica Yu wrote: > > > >diff --git a/kernel/module.c b/kernel/module.c > > >index 8358f46..aeabd81 100644 > > >--- a/kernel/module.c > > >+++ b/kernel/module.c > > >@@ -3371,6 +3371,13 @@ static int

Re: livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Steven Rostedt
On Fri, 29 Jan 2016 15:04:51 -0500 Jessica Yu wrote: > >diff --git a/kernel/module.c b/kernel/module.c > >index 8358f46..aeabd81 100644 > >--- a/kernel/module.c > >+++ b/kernel/module.c > >@@ -3371,6 +3371,13 @@ static int complete_formation(struct module *mod, > >struct load_info *info) > >

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Steven Rostedt
On Fri, 29 Jan 2016 13:47:15 -0600 Josh Poimboeuf wrote: > > Although, I have to admit, if live kernel patching is configured in, > > it's not always needed to be called here, does it? With ftrace, the > > call has to be done when ftrace is configured in regardless if tracing > > is used or not.

Re: livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Jessica Yu
+++ Josh Poimboeuf [29/01/16 11:30 -0600]: On Fri, Jan 29, 2016 at 05:30:46PM +0100, Miroslav Benes wrote: Otherwise than that it looks good. I agree there are advantages to split the notifiers. For example we can replace the coming one with the function call somewhere in load_module() to improv

Re: livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Jessica Yu
+++ Steven Rostedt [29/01/16 14:29 -0500]: On Fri, 29 Jan 2016 20:25:15 +0100 (CET) Miroslav Benes wrote: It is possible to achieve the same goal even with the notifiers. They are processed synchronously in complete_formation(). So we can put our klp hook after that, right? Or better, put it t

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Josh Poimboeuf
On Fri, Jan 29, 2016 at 02:29:50PM -0500, Steven Rostedt wrote: > On Fri, 29 Jan 2016 20:25:15 +0100 (CET) > Miroslav Benes wrote: > > > It is possible to achieve the same goal even with the notifiers. They are > > processed synchronously in complete_formation(). So we can put our klp > > hook

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Josh Poimboeuf
On Fri, Jan 29, 2016 at 08:25:15PM +0100, Miroslav Benes wrote: > On Fri, 29 Jan 2016, Josh Poimboeuf wrote: > > > On Fri, Jan 29, 2016 at 12:40:14PM -0500, Steven Rostedt wrote: > > > [ Added Rusty, as he's still maintainer of the module code ] > > > > > > On Fri, 29 Jan 2016 11:30:10 -0600 > >

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Steven Rostedt
On Fri, 29 Jan 2016 20:25:15 +0100 (CET) Miroslav Benes wrote: > It is possible to achieve the same goal even with the notifiers. They are > processed synchronously in complete_formation(). So we can put our klp > hook after that, right? Or better, put it to load_module() after > complete_form

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Miroslav Benes
On Fri, 29 Jan 2016, Josh Poimboeuf wrote: > On Fri, Jan 29, 2016 at 12:40:14PM -0500, Steven Rostedt wrote: > > [ Added Rusty, as he's still maintainer of the module code ] > > > > On Fri, 29 Jan 2016 11:30:10 -0600 > > Josh Poimboeuf wrote: > > > > > On Fri, Jan 29, 2016 at 05:30:46PM +0100,

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Josh Poimboeuf
On Fri, Jan 29, 2016 at 12:40:14PM -0500, Steven Rostedt wrote: > [ Added Rusty, as he's still maintainer of the module code ] > > On Fri, 29 Jan 2016 11:30:10 -0600 > Josh Poimboeuf wrote: > > > On Fri, Jan 29, 2016 at 05:30:46PM +0100, Miroslav Benes wrote: > > > Otherwise than that it looks g

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Steven Rostedt
[ Added Rusty, as he's still maintainer of the module code ] On Fri, 29 Jan 2016 11:30:10 -0600 Josh Poimboeuf wrote: > On Fri, Jan 29, 2016 at 05:30:46PM +0100, Miroslav Benes wrote: > > Otherwise than that it looks good. I agree there are advantages to split > > the notifiers. For example we

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Josh Poimboeuf
On Fri, Jan 29, 2016 at 05:30:46PM +0100, Miroslav Benes wrote: > Otherwise than that it looks good. I agree there are advantages to split > the notifiers. For example we can replace the coming one with the function > call somewhere in load_module() to improve error handling if the patching > fa

Re: [PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-29 Thread Miroslav Benes
On Fri, 29 Jan 2016, Jessica Yu wrote: > Detangle klp_module_notify() into two separate module notifiers > klp_module_notify_{coming,going}() with the appropriate priorities, > so that on module load, the ftrace module notifier will run *before* > the livepatch coming module notifier but *after* t

[PATCH 1/2] livepatch: Implement separate coming and going module notifiers

2016-01-28 Thread Jessica Yu
Detangle klp_module_notify() into two separate module notifiers klp_module_notify_{coming,going}() with the appropriate priorities, so that on module load, the ftrace module notifier will run *before* the livepatch coming module notifier but *after* the livepatch going module modifier. This fixes