All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip 1/2] x86/alternatives: Fix build warning
@ 2010-02-05  6:24 Masami Hiramatsu
  2010-02-05  6:24 ` [PATCH -tip 2/2] kprobes: Add mcount in kprobes blacklist Masami Hiramatsu
  2010-02-05  7:12 ` [PATCH -tip 1/2] x86/alternatives: Fix build warning Ingo Molnar
  0 siblings, 2 replies; 8+ messages in thread
From: Masami Hiramatsu @ 2010-02-05  6:24 UTC (permalink / raw)
  To: Ingo Molnar, lkml; +Cc: systemtap, DLE, Masami Hiramatsu

Fixes below warnings.

====
FYI, there's this new build warning on x86 defconfig:

arch/x86/kernel/alternative.c: In function 'alternatives_text_reserved':
arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast

Caused by:

2cfa197: ftrace/alternatives: Introducing *_text_reserved functions
====

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Reported-by: Ingo Molnar <mingo@elte.hu>
---

 arch/x86/kernel/alternative.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 3832fdc..99d9920 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -399,10 +399,10 @@ int alternatives_text_reserved(void *start, void *end)
 	u8 **ptr;
 
 	list_for_each_entry(mod, &smp_alt_modules, next) {
-		if (mod->text > end || mod->text_end < start)
+		if (mod->text > (u8 *)end || mod->text_end < (u8 *)start)
 			continue;
 		for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
-			if (start <= *ptr && end >= *ptr)
+			if ((u8 *)start <= *ptr && (u8 *)end >= *ptr)
 				return 1;
 	}
 


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* [PATCH -tip 2/2] kprobes: Add mcount in kprobes blacklist
  2010-02-05  6:24 [PATCH -tip 1/2] x86/alternatives: Fix build warning Masami Hiramatsu
@ 2010-02-05  6:24 ` Masami Hiramatsu
  2010-02-05  7:48   ` [tip:perf/core] kprobes: Add mcount to the " tip-bot for Masami Hiramatsu
  2010-02-15  5:21   ` [tip:tracing/urgent] " tip-bot for Masami Hiramatsu
  2010-02-05  7:12 ` [PATCH -tip 1/2] x86/alternatives: Fix build warning Ingo Molnar
  1 sibling, 2 replies; 8+ messages in thread
From: Masami Hiramatsu @ 2010-02-05  6:24 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Ananth N Mavinakayanahalli,
	Ingo Molnar

Since mcount function can be called from everywhere,
it should be blacklisted. Moreover, the "mcount" symbol
is a special symbol name. So, it is better to put it in
the generic blacklist.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
---

 kernel/kprobes.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index c3340e8..ccec774 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -94,6 +94,7 @@ static struct kprobe_blackpoint kprobe_blacklist[] = {
 	{"native_get_debugreg",},
 	{"irq_entries_start",},
 	{"common_interrupt",},
+	{"mcount",},	/* mcount can be called from everywhere */
 	{NULL}    /* Terminator */
 };
 


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* Re: [PATCH -tip 1/2] x86/alternatives: Fix build warning
  2010-02-05  6:24 [PATCH -tip 1/2] x86/alternatives: Fix build warning Masami Hiramatsu
  2010-02-05  6:24 ` [PATCH -tip 2/2] kprobes: Add mcount in kprobes blacklist Masami Hiramatsu
@ 2010-02-05  7:12 ` Ingo Molnar
  2010-02-05 16:52   ` Masami Hiramatsu
  2010-02-05 17:16   ` [PATCH -tip v2] " Masami Hiramatsu
  1 sibling, 2 replies; 8+ messages in thread
From: Ingo Molnar @ 2010-02-05  7:12 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: lkml, systemtap, DLE


* Masami Hiramatsu <mhiramat@redhat.com> wrote:

> Fixes below warnings.
> 
> ====
> FYI, there's this new build warning on x86 defconfig:
> 
> arch/x86/kernel/alternative.c: In function 'alternatives_text_reserved':
> arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
> arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
> arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
> arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
> 
> Caused by:
> 
> 2cfa197: ftrace/alternatives: Introducing *_text_reserved functions
> ====
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Reported-by: Ingo Molnar <mingo@elte.hu>
> ---
> 
>  arch/x86/kernel/alternative.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
> index 3832fdc..99d9920 100644
> --- a/arch/x86/kernel/alternative.c
> +++ b/arch/x86/kernel/alternative.c
> @@ -399,10 +399,10 @@ int alternatives_text_reserved(void *start, void *end)
>  	u8 **ptr;
>  
>  	list_for_each_entry(mod, &smp_alt_modules, next) {
> -		if (mod->text > end || mod->text_end < start)
> +		if (mod->text > (u8 *)end || mod->text_end < (u8 *)start)
>  			continue;
>  		for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
> -			if (start <= *ptr && end >= *ptr)
> +			if ((u8 *)start <= *ptr && (u8 *)end >= *ptr)
>  				return 1;
>  	}

Such casts are a bit ugly and in general type casts are somewhat dangerous.

One possible solution would be to add intermediary local variables 
(text_start/text_end) with u8 * type and assign start/end to them - which can 
be done without a cast.

Thanks,

	Ingo

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

* [tip:perf/core] kprobes: Add mcount to the kprobes blacklist
  2010-02-05  6:24 ` [PATCH -tip 2/2] kprobes: Add mcount in kprobes blacklist Masami Hiramatsu
@ 2010-02-05  7:48   ` tip-bot for Masami Hiramatsu
  2010-02-15  5:21   ` [tip:tracing/urgent] " tip-bot for Masami Hiramatsu
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-02-05  7:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, ananth, dle-develop, rostedt, tglx,
	mhiramat, mingo, systemtap

Commit-ID:  5ecaafdbf44b1ba400b746c60c401d54c7ee0863
Gitweb:     http://git.kernel.org/tip/5ecaafdbf44b1ba400b746c60c401d54c7ee0863
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Fri, 5 Feb 2010 01:24:34 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 5 Feb 2010 08:13:57 +0100

kprobes: Add mcount to the kprobes blacklist

Since mcount function can be called from everywhere,
it should be blacklisted. Moreover, the "mcount" symbol
is a special symbol name. So, it is better to put it in
the generic blacklist.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20100205062433.3745.36726.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/kprobes.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index c3340e8..ccec774 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -94,6 +94,7 @@ static struct kprobe_blackpoint kprobe_blacklist[] = {
 	{"native_get_debugreg",},
 	{"irq_entries_start",},
 	{"common_interrupt",},
+	{"mcount",},	/* mcount can be called from everywhere */
 	{NULL}    /* Terminator */
 };
 

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

* Re: [PATCH -tip 1/2] x86/alternatives: Fix build warning
  2010-02-05  7:12 ` [PATCH -tip 1/2] x86/alternatives: Fix build warning Ingo Molnar
@ 2010-02-05 16:52   ` Masami Hiramatsu
  2010-02-05 17:16   ` [PATCH -tip v2] " Masami Hiramatsu
  1 sibling, 0 replies; 8+ messages in thread
From: Masami Hiramatsu @ 2010-02-05 16:52 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: lkml, systemtap, DLE

Ingo Molnar wrote:
> 
> * Masami Hiramatsu <mhiramat@redhat.com> wrote:
> 
>> Fixes below warnings.
>>
>> ====
>> FYI, there's this new build warning on x86 defconfig:
>>
>> arch/x86/kernel/alternative.c: In function 'alternatives_text_reserved':
>> arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
>> arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
>> arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
>> arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
>>
>> Caused by:
>>
>> 2cfa197: ftrace/alternatives: Introducing *_text_reserved functions
>> ====
>>
>> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
>> Reported-by: Ingo Molnar <mingo@elte.hu>
>> ---
>>
>>  arch/x86/kernel/alternative.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
>> index 3832fdc..99d9920 100644
>> --- a/arch/x86/kernel/alternative.c
>> +++ b/arch/x86/kernel/alternative.c
>> @@ -399,10 +399,10 @@ int alternatives_text_reserved(void *start, void *end)
>>  	u8 **ptr;
>>  
>>  	list_for_each_entry(mod, &smp_alt_modules, next) {
>> -		if (mod->text > end || mod->text_end < start)
>> +		if (mod->text > (u8 *)end || mod->text_end < (u8 *)start)
>>  			continue;
>>  		for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
>> -			if (start <= *ptr && end >= *ptr)
>> +			if ((u8 *)start <= *ptr && (u8 *)end >= *ptr)
>>  				return 1;
>>  	}
> 
> Such casts are a bit ugly and in general type casts are somewhat dangerous.

I doubt this type casting is dangerous..., but yeah, it's ugly :-)

> One possible solution would be to add intermediary local variables 
> (text_start/text_end) with u8 * type and assign start/end to them - which can 
> be done without a cast.

Sure, I'll update it.

Thank you,


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com


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

* [PATCH -tip v2] x86/alternatives: Fix build warning
  2010-02-05  7:12 ` [PATCH -tip 1/2] x86/alternatives: Fix build warning Ingo Molnar
  2010-02-05 16:52   ` Masami Hiramatsu
@ 2010-02-05 17:16   ` Masami Hiramatsu
  2010-02-07 19:42     ` [tip:perf/core] " tip-bot for Masami Hiramatsu
  1 sibling, 1 reply; 8+ messages in thread
From: Masami Hiramatsu @ 2010-02-05 17:16 UTC (permalink / raw)
  To: Ingo Molnar, lkml; +Cc: systemtap, DLE, Masami Hiramatsu

Fixes below warnings.

====
FYI, there's this new build warning on x86 defconfig:

arch/x86/kernel/alternative.c: In function 'alternatives_text_reserved':
arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast

Caused by:

2cfa197: ftrace/alternatives: Introducing *_text_reserved functions
====

Changes in v2:
 - Use local variables to compare, instead of type casts.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Reported-by: Ingo Molnar <mingo@elte.hu>
---

 arch/x86/kernel/alternative.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 3832fdc..e6ea034 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -397,12 +397,14 @@ int alternatives_text_reserved(void *start, void *end)
 {
 	struct smp_alt_module *mod;
 	u8 **ptr;
+	u8 *text_start = start;
+	u8 *text_end = end;
 
 	list_for_each_entry(mod, &smp_alt_modules, next) {
-		if (mod->text > end || mod->text_end < start)
+		if (mod->text > text_end || mod->text_end < text_start)
 			continue;
 		for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
-			if (start <= *ptr && end >= *ptr)
+			if (text_start <= *ptr && text_end >= *ptr)
 				return 1;
 	}
 


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* [tip:perf/core] x86/alternatives: Fix build warning
  2010-02-05 17:16   ` [PATCH -tip v2] " Masami Hiramatsu
@ 2010-02-07 19:42     ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-02-07 19:42 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dle-develop, tglx, mhiramat, mingo, systemtap

Commit-ID:  076dc4a65a6d99a16979e2c7917e669fb8c91ee5
Gitweb:     http://git.kernel.org/tip/076dc4a65a6d99a16979e2c7917e669fb8c91ee5
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Fri, 5 Feb 2010 12:16:47 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 7 Feb 2010 18:08:24 +0100

x86/alternatives: Fix build warning

Fixes these warnings:

 arch/x86/kernel/alternative.c: In function 'alternatives_text_reserved':
 arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
 arch/x86/kernel/alternative.c:402: warning: comparison of distinct pointer types lacks a cast
 arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast
 arch/x86/kernel/alternative.c:405: warning: comparison of distinct pointer types lacks a cast

Caused by:

  2cfa197: ftrace/alternatives: Introducing *_text_reserved functions

Changes in v2:
  - Use local variables to compare, instead of type casts.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
LKML-Reference: <20100205171647.15750.37221.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/alternative.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 3c13284..e63b80e 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -395,12 +395,14 @@ int alternatives_text_reserved(void *start, void *end)
 {
 	struct smp_alt_module *mod;
 	u8 **ptr;
+	u8 *text_start = start;
+	u8 *text_end = end;
 
 	list_for_each_entry(mod, &smp_alt_modules, next) {
-		if (mod->text > end || mod->text_end < start)
+		if (mod->text > text_end || mod->text_end < text_start)
 			continue;
 		for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
-			if (start <= *ptr && end >= *ptr)
+			if (text_start <= *ptr && text_end >= *ptr)
 				return 1;
 	}
 

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

* [tip:tracing/urgent] kprobes: Add mcount to the kprobes blacklist
  2010-02-05  6:24 ` [PATCH -tip 2/2] kprobes: Add mcount in kprobes blacklist Masami Hiramatsu
  2010-02-05  7:48   ` [tip:perf/core] kprobes: Add mcount to the " tip-bot for Masami Hiramatsu
@ 2010-02-15  5:21   ` tip-bot for Masami Hiramatsu
  1 sibling, 0 replies; 8+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-02-15  5:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, ananth, dle-develop, rostedt, tglx,
	mhiramat, mingo, systemtap

Commit-ID:  8b833c506c05c498d4215e2c260be44225daf6de
Gitweb:     http://git.kernel.org/tip/8b833c506c05c498d4215e2c260be44225daf6de
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Fri, 5 Feb 2010 01:24:34 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 15 Feb 2010 05:45:49 +0100

kprobes: Add mcount to the kprobes blacklist

Since mcount function can be called from everywhere,
it should be blacklisted. Moreover, the "mcount" symbol
is a special symbol name. So, it is better to put it in
the generic blacklist.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20100205062433.3745.36726.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/kprobes.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index b7df302..c4b4343 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -93,6 +93,7 @@ static struct kprobe_blackpoint kprobe_blacklist[] = {
 	{"native_get_debugreg",},
 	{"irq_entries_start",},
 	{"common_interrupt",},
+	{"mcount",},	/* mcount can be called from everywhere */
 	{NULL}    /* Terminator */
 };
 

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

end of thread, other threads:[~2010-02-15  5:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-05  6:24 [PATCH -tip 1/2] x86/alternatives: Fix build warning Masami Hiramatsu
2010-02-05  6:24 ` [PATCH -tip 2/2] kprobes: Add mcount in kprobes blacklist Masami Hiramatsu
2010-02-05  7:48   ` [tip:perf/core] kprobes: Add mcount to the " tip-bot for Masami Hiramatsu
2010-02-15  5:21   ` [tip:tracing/urgent] " tip-bot for Masami Hiramatsu
2010-02-05  7:12 ` [PATCH -tip 1/2] x86/alternatives: Fix build warning Ingo Molnar
2010-02-05 16:52   ` Masami Hiramatsu
2010-02-05 17:16   ` [PATCH -tip v2] " Masami Hiramatsu
2010-02-07 19:42     ` [tip:perf/core] " tip-bot for Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.