linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols
@ 2013-03-07 10:44 oskar.andero
  2013-03-08  4:23 ` Masami Hiramatsu
  0 siblings, 1 reply; 6+ messages in thread
From: oskar.andero @ 2013-03-07 10:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: masami.hiramatsu.pt, davem, anil.s.keshavamurthy, ananth,
	radovan.lekanovic, Bj�rn Davidsson, Oskar Andero

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 1016 bytes --]

From: Björn Davidsson <bjorn.davidsson@sonymobile.com>

The kprobes blacklist contains x86-specific symbols.
Looking for these in kallsyms takes unnecessary time
during startup on non-X86 platform.
Added #ifdef CONFIG_X86 around them.

Reviewed-by: Radovan Lekanovic <radovan.lekanovic@sonymobile.com>
Signed-off-by: Björn Davidsson <bjorn.davidsson@sonymobile.com>
Signed-off-by: Oskar Andero <oskar.andero@sonymobile.com>
---
 kernel/kprobes.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index e35be53..8c3796f 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -95,9 +95,11 @@ static raw_spinlock_t *kretprobe_table_lock_ptr(unsigned long hash)
  */
 static struct kprobe_blackpoint kprobe_blacklist[] = {
 	{"preempt_schedule",},
+#ifdef CONFIG_X86
 	{"native_get_debugreg",},
 	{"irq_entries_start",},
 	{"common_interrupt",},
+#endif
 	{"mcount",},	/* mcount can be called from everywhere */
 	{NULL}    /* Terminator */
 };
-- 
1.7.8.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols
  2013-03-07 10:44 [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols oskar.andero
@ 2013-03-08  4:23 ` Masami Hiramatsu
  2013-03-08  6:03   ` Ananth N Mavinakayanahalli
  2013-03-08 13:15   ` oskar.andero
  0 siblings, 2 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2013-03-08  4:23 UTC (permalink / raw)
  To: oskar.andero
  Cc: linux-kernel, davem, anil.s.keshavamurthy, ananth,
	radovan.lekanovic, �

(2013/03/07 19:44), oskar.andero@sonymobile.com wrote:
> From: Bjorn Davidsson <bjorn.davidsson@sonymobile.com>
> 
> The kprobes blacklist contains x86-specific symbols.
> Looking for these in kallsyms takes unnecessary time
> during startup on non-X86 platform.
> Added #ifdef CONFIG_X86 around them.

Right. however, it might be better break that into
common and arch-specific lists, because there may be
other arch-specific non-probe-able functions on each
architecture...

Would you know some other black points on your platform?

Thank you,

> 
> Reviewed-by: Radovan Lekanovic <radovan.lekanovic@sonymobile.com>
> Signed-off-by: Björn Davidsson <bjorn.davidsson@sonymobile.com>
> Signed-off-by: Oskar Andero <oskar.andero@sonymobile.com>
> ---
>  kernel/kprobes.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index e35be53..8c3796f 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -95,9 +95,11 @@ static raw_spinlock_t *kretprobe_table_lock_ptr(unsigned long hash)
>   */
>  static struct kprobe_blackpoint kprobe_blacklist[] = {
>  	{"preempt_schedule",},
> +#ifdef CONFIG_X86
>  	{"native_get_debugreg",},
>  	{"irq_entries_start",},
>  	{"common_interrupt",},
> +#endif
>  	{"mcount",},	/* mcount can be called from everywhere */
>  	{NULL}    /* Terminator */
>  };
> 


-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols
  2013-03-08  4:23 ` Masami Hiramatsu
@ 2013-03-08  6:03   ` Ananth N Mavinakayanahalli
  2013-03-08 13:17     ` oskar.andero
  2013-03-08 13:15   ` oskar.andero
  1 sibling, 1 reply; 6+ messages in thread
From: Ananth N Mavinakayanahalli @ 2013-03-08  6:03 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: oskar.andero, linux-kernel, davem, anil.s.keshavamurthy,
	radovan.lekanovic,
	=?utf-8?B?77+9IDxiam9ybi5kYXZpZHNzb25Ac29ueW1vYmlsZS5jb20+?=

On Fri, Mar 08, 2013 at 01:23:25PM +0900, Masami Hiramatsu wrote:
> (2013/03/07 19:44), oskar.andero@sonymobile.com wrote:
> > From: Bjorn Davidsson <bjorn.davidsson@sonymobile.com>
> > 
> > The kprobes blacklist contains x86-specific symbols.
> > Looking for these in kallsyms takes unnecessary time
> > during startup on non-X86 platform.
> > Added #ifdef CONFIG_X86 around them.
> 
> Right. however, it might be better break that into
> common and arch-specific lists, because there may be
> other arch-specific non-probe-able functions on each
> architecture...

Agreed. CONFIG_<arch> in kernel/* is not the right thing to do IMO.

You are moving the blacklist initialization to later in the next patch,
so how much overhead will it then be?

Ananth


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols
  2013-03-08  4:23 ` Masami Hiramatsu
  2013-03-08  6:03   ` Ananth N Mavinakayanahalli
@ 2013-03-08 13:15   ` oskar.andero
  2013-03-09  1:23     ` Masami Hiramatsu
  1 sibling, 1 reply; 6+ messages in thread
From: oskar.andero @ 2013-03-08 13:15 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: linux-kernel, davem, anil.s.keshavamurthy, ananth, Lekanovic,
	Radovan, Davidsson, Björn

On 05:23 Fri 08 Mar     , Masami Hiramatsu wrote:
> (2013/03/07 19:44), oskar.andero@sonymobile.com wrote:
> > From: Bjorn Davidsson <bjorn.davidsson@sonymobile.com>
> > 
> > The kprobes blacklist contains x86-specific symbols.
> > Looking for these in kallsyms takes unnecessary time
> > during startup on non-X86 platform.
> > Added #ifdef CONFIG_X86 around them.
> 
> Right. however, it might be better break that into
> common and arch-specific lists, because there may be
> other arch-specific non-probe-able functions on each
> architecture...

Ok. You mean adding, for instance, a kprobe_blacklist_arch[] in arch/x86
somewhere or did you have something else in mind? I guess we preferably want
to get rid of the #ifdef.

> Would you know some other black points on your platform?

Not that we are aware of.

> Thank you,
> 
> > 
> > Reviewed-by: Radovan Lekanovic <radovan.lekanovic@sonymobile.com>
> > Signed-off-by: Björn Davidsson <bjorn.davidsson@sonymobile.com>
> > Signed-off-by: Oskar Andero <oskar.andero@sonymobile.com>
> > ---
> >  kernel/kprobes.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> > index e35be53..8c3796f 100644
> > --- a/kernel/kprobes.c
> > +++ b/kernel/kprobes.c
> > @@ -95,9 +95,11 @@ static raw_spinlock_t *kretprobe_table_lock_ptr(unsigned long hash)
> >   */
> >  static struct kprobe_blackpoint kprobe_blacklist[] = {
> >  	{"preempt_schedule",},
> > +#ifdef CONFIG_X86
> >  	{"native_get_debugreg",},
> >  	{"irq_entries_start",},
> >  	{"common_interrupt",},
> > +#endif
> >  	{"mcount",},	/* mcount can be called from everywhere */
> >  	{NULL}    /* Terminator */
> >  };
> > 
> 
> 
> -- 
> Masami HIRAMATSU
> IT Management Research Dept. Linux Technology Center
> Hitachi, Ltd., Yokohama Research Laboratory
> E-mail: masami.hiramatsu.pt@hitachi.com
> 
> 

-Oskar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols
  2013-03-08  6:03   ` Ananth N Mavinakayanahalli
@ 2013-03-08 13:17     ` oskar.andero
  0 siblings, 0 replies; 6+ messages in thread
From: oskar.andero @ 2013-03-08 13:17 UTC (permalink / raw)
  To: Ananth N Mavinakayanahalli
  Cc: Masami Hiramatsu, linux-kernel, davem, anil.s.keshavamurthy,
	Lekanovic, Radovan,
	??? <bjorn.davidsson@sonymobile.com>@thinktux.in.ibm.com

On 07:03 Fri 08 Mar     , Ananth N Mavinakayanahalli wrote:
> On Fri, Mar 08, 2013 at 01:23:25PM +0900, Masami Hiramatsu wrote:
> > (2013/03/07 19:44), oskar.andero@sonymobile.com wrote:
> > > From: Bjorn Davidsson <bjorn.davidsson@sonymobile.com>
> > > 
> > > The kprobes blacklist contains x86-specific symbols.
> > > Looking for these in kallsyms takes unnecessary time
> > > during startup on non-X86 platform.
> > > Added #ifdef CONFIG_X86 around them.
> > 
> > Right. however, it might be better break that into
> > common and arch-specific lists, because there may be
> > other arch-specific non-probe-able functions on each
> > architecture...
> 
> Agreed. CONFIG_<arch> in kernel/* is not the right thing to do IMO.
> 
> You are moving the blacklist initialization to later in the next patch,
> so how much overhead will it then be?

Well, it's not crucial for the boot time, but it is still a small
optimization.

-Oskar

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols
  2013-03-08 13:15   ` oskar.andero
@ 2013-03-09  1:23     ` Masami Hiramatsu
  0 siblings, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2013-03-09  1:23 UTC (permalink / raw)
  To: oskar.andero
  Cc: linux-kernel, davem, anil.s.keshavamurthy, ananth, Lekanovic,
	Radovan, "Davidsson, Björn"

(2013/03/08 22:15), oskar.andero@sonymobile.com wrote:
> On 05:23 Fri 08 Mar     , Masami Hiramatsu wrote:
>> (2013/03/07 19:44), oskar.andero@sonymobile.com wrote:
>>> From: Bjorn Davidsson <bjorn.davidsson@sonymobile.com>
>>>
>>> The kprobes blacklist contains x86-specific symbols.
>>> Looking for these in kallsyms takes unnecessary time
>>> during startup on non-X86 platform.
>>> Added #ifdef CONFIG_X86 around them.
>>
>> Right. however, it might be better break that into
>> common and arch-specific lists, because there may be
>> other arch-specific non-probe-able functions on each
>> architecture...
> 
> Ok. You mean adding, for instance, a kprobe_blacklist_arch[] in arch/x86
> somewhere or did you have something else in mind? I guess we preferably want
> to get rid of the #ifdef.

Yes, we can have symbol tables (const char *arch_kprobes_blacksyms[],
common_kprobes_blacksyms[]) to list it up, and when initializing
the blacklist table, we can check whether kprobes_blacklist == NULL
and initialize it.

Thank you,

-- 
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-03-09  1:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-07 10:44 [PATCH] Kprobes blacklist: Conditionally add x86-specific symbols oskar.andero
2013-03-08  4:23 ` Masami Hiramatsu
2013-03-08  6:03   ` Ananth N Mavinakayanahalli
2013-03-08 13:17     ` oskar.andero
2013-03-08 13:15   ` oskar.andero
2013-03-09  1:23     ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).