lkml.org 
[lkml]   [2009]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] ftrace, x86: make kernel text writable only for conversions

On Fri, 20 Feb 2009, Ingo Molnar wrote:

>
> * Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > > > +/* used by ftrace */
> > > > +void set_kernel_text_rw(void)
> > >
> > > i'd leave out the 'used by ftrace' bit - more uses might
> > > arise. How does kprobes get around readonly pages, it uses
> > > these APIs too, right?
> >
> > kprobes uses text_poke. text_poke uses vmap to create its own
> > page table pointers to the text memory, does the modification
> > and then removes the pointers. This is quite heavy weight and
> > since ftrace needs to modify 10s of thousands of areas,
> > converting all of kernel text page tables is much more
> > efficient.
> >
> > Note, if kprobes did change the original page tables, then it
> > too would have hit the split_large_page bug too.
>
> i think the real reason is that kprobes was written before we
> had this more flexible and more usable CPA code.

I'm not saying that was the reason kprobes did it that way. I was just
answering your question about how kprobes does it today ;-)

Perhaps it may be more efficient to convert kprobes to use the
set_memory_rw/ro API now.

-- Steve



\
 
 \ /
  Last update: 2009-02-20 19:03    [W:0.281 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site