Re: [PATCH] livepatch: add (un)patch hooks

From: Josh Poimboeuf
Date: Thu Jul 20 2017 - 00:30:18 EST


On Wed, Jul 19, 2017 at 11:17:23PM -0500, Josh Poimboeuf wrote:
> This one was interesting:
>
> 6f442be2fb22 ("x86_64, traps: Stop using IST for #SS")
>
> A livepatch patch for it is below. We had something similar for kpatch.
> The below patch is completely untested because we don't have
> kpatch-build tooling support for livepatch hooks yet.
>
> Note that the load hook would need to run *after* the patch has been
> applied and the transition has completed. And also, it would need to
> run inside stop_machine(). I didn't put that in the patch yet. But it
> should at least give you an idea.

Actually the statement that it needs to run after the patch is applied
isn't accurate. It was true with an earlier revision of the patch which
modified the do_stack_segment() function. But this version only adds
code.

--
Josh