lkml.org 
[lkml]   [2014]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 0/2] kpatch: dynamic kernel patching
On Thu, May 01, 2014 at 01:45:33PM -0700, Andi Kleen wrote:
> Josh Poimboeuf <jpoimboe@redhat.com> writes:
> >
> > kpatch checks the backtraces of all tasks in stop_machine() to ensure
> > that no instances of the old function are running when the new function
> > is applied.
>
> How does that work for tail calls?
>
> call foo
> foo:
> ...
> jmp bar
>
> bar:
> ... code executing ...
>
> When you backtrace you will see foo, but you are running in bar.

> Note that tail calls can be indirect, so they cannot be resolved
> statically.
>
> CONFIG_DEBUG_INFO usually disables tail calls, but not supporting
> it would seem like a large limitation, as the cost can be high.
>
> It wouldn't surprise me if there are some similar special cases that
> can even happen with them disabled.
>
> In theory you could read LBRs, but even that may miss some extreme
> cases.

When bar returns, would it skip foo and go straight back to foo's
caller? If so, then it should be safe to patch foo after it jumps to
bar.

--
Josh


\
 
 \ /
  Last update: 2014-05-01 23:21    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog