[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170720170412.amkpdaqx57jwo2ux@treble>
Date:   Thu, 20 Jul 2017 12:04:12 -0500
From:   Josh Poimboeuf <jpoimboe@...hat.com>
To:     Petr Mladek <pmladek@...e.com>
Cc:     Joe Lawrence <joe.lawrence@...hat.com>,
        live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jessica Yu <jeyu@...nel.org>, Jiri Kosina <jikos@...nel.org>,
        Miroslav Benes <mbenes@...e.cz>,
        Chris J Arges <chris.j.arges@...onical.com>
Subject: Re: [PATCH] livepatch: add (un)patch hooks
On Thu, Jul 20, 2017 at 05:50:04PM +0200, Petr Mladek wrote:
> On Wed 2017-07-19 23:17:23, Josh Poimboeuf wrote:
> >   - patching otherwise unpatchable code (i.e., assembly)
> > 
> >   In many/most cases, it seems like stop_machine() would be very useful
> >   to avoid concurrency issues.
> 
> I am not sure if stop_machine() would help here. It would make sense
> in kPatch where also the ftrace handlers are added during
> stop_machine(). Then it is possible to synchronize both operations
> (hooks, enabling ftrace handlers) and do everything "atomically".
> 
> IMHO, the big advantage of livepatch framework is that stop_machine()
> is not needed. I hope that it will stay this way.
> 
> Also it might need some additional support. You would want to stop
> the machine to make sure that it is safe to do a change. Then
> we might need to check stacks, ...
Don't worry.  I much prefer our current consistency model to kpatch, and
I have no intention of changing it :-)
That said, for the hooks, I still think stop_machine() will be helpful
in some cases where you need to ensure no other code is running.  Like
the stack_segment patch I posted, for example.
Anyway I'm not suggesting we do the stop_machine() in livepatch code
itself.  I'm just hoping it will work from a hook, in case the patch
author needs to do it as a last resort.
-- 
Josh
Powered by blists - more mailing lists