Messages in this thread | | | Date | Fri, 21 Nov 2008 09:39:52 -0500 | From | Masami Hiramatsu <> | Subject | Re: [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
| |