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

On Mon, Nov 24, 2008 at 8:45 PM, Masami Hiramatsu <mhiramat@redhat.com> wrote:
> Nikanth Karthikesan wrote:
>> On Friday 21 November 2008 20:09:52 Masami Hiramatsu wrote:
>>> Hi Nikanth,
>>>
>>> Nikanth Karthikesan wrote:
>>
>>> 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 */
>>> }
>>>
>>>
>>
>> So, am I seeing worries to enable something, which is already possible, but
>> just not documented?
>
> Actually, you can do this with kprobes, but not documented,
> because the regs->ip setup depends on arch. (above code is only for
> x86/x86-64).
>
> I think it's easier to just provide above pre_handler for each arch than
> jprobe-based kreplace approach.
>

I thought jprobes would provide easy access to function parameters.

Thanks
Nikanth


\
 
 \ /
  Last update: 2008-11-26 03:51    [W:0.067 / U:1.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site