lkml.org 
[lkml]   [2009]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] ftrace: use module notifier for function tracer
On Tue, 21 Apr 2009, Steven Rostedt wrote:

> > However, Ksplice does its run-pre matching checks outside stop_machine,
>
> Does Ksplice use break points to do the modification?

No, we use jump instructions.

> I'd be interested in knowing how Ksplice protects against the nastiness
> of code executing on one CPU that is being modified by another CPU.

The run-pre matching checks, which verify that the pre-patch code the user
gave Ksplice matches the running kernel, occur before stop_machine with
the module_mutex held. Then, inside stop_machine, we check that no thread
is in the process of executing a to-be-patched function before inserting
the jump instructions. We need the transition from the old code to the
new code to be atomic (i.e. no old code can run after any new code is
run). So, we need to check all the return addresses on each thread's
kernel stack as well as the instruction pointers.

-Tim Abbott


\
 
 \ /
  Last update: 2009-04-21 20:53    [W:0.350 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site