lkml.org 
[lkml]   [2008]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] kreplace: Rebootless kernel updates
Hi Nikanth,

Nikanth Karthikesan wrote:
> This RFC patch adds support for limited form of rebootless kernel patching
> even without building the entire kernel.
>
> When looking for a shortcut to avoid the rebuild/reboot cycle when hacking the
> kernel - the ksplice[1] was posted. This patch extends kprobes to do something
> similar, which would require even lesser time to _experiment_ with the running
> kernel.
>
> This small patch extends jprobes so that the jprobe's handler is executed but
> skips executing the actual function. But this has its own limitations such as
> Cannot access symbols not exported for modules (ofcourse hacks like
> pointers[2] can be used.), problems related to return values[3], etc... This
> is currently a x86_64 only _hack_.

Hmm,
Would you like to replace a function to another function?
If so, AFAIK, you can do that with kprobe and below pre_handler.
(see booster enabled path in setup_singlestep())

pre_handler(...)
{
reset_current_kprobe(); /* this kprobe doesn't need any more */
regs->ip = new_function; /* change IP to new function */
preempt_enable_no_resched(); /* recover preempt count */
return 1; /* No need to setup singlestep */
}

Thank you,


--
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com



\
 
 \ /
  Last update: 2008-11-21 15:45    [W:0.108 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site