All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip 0/4] kprobes updates
@ 2010-02-02 21:48 Masami Hiramatsu
  2010-02-02 21:49 ` [PATCH -tip 1/4] [RESEND] kprobes: Disable booster when CONFIG_PREEMPT=y Masami Hiramatsu
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2010-02-02 21:48 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: Steven Rostedt, PrzemysławPawełczyk,
	Frederic Weisbecker, Ananth N Mavinakayanahalli, Jim Keniston,
	Mathieu Desnoyers, Jason Baron, systemtap, DLE

Hi,

Here are patches for updating kprobes. Actually, the first patch is
same as that previously I sent to LKML. 2nd-4th patches introduces text
reserve functions for avoiding conflictions between alternatives/
ftrace and kprobes. Since alternatives and ftrace can modify fixed
small pieces of kernel text, I think those should come before kprobes.

Thank you,

---

Masami Hiramatsu (4):
      ftrace: Remove record freezing
      kprobes: Check probe address is reserved
      ftrace/alternatives: Introducing *_text_reserved functions
      [RESEND] kprobes: Disable booster when CONFIG_PREEMPT=y


 arch/ia64/kernel/kprobes.c         |    2 +
 arch/x86/include/asm/alternative.h |    5 +++
 arch/x86/kernel/alternative.c      |   16 +++++++++++
 arch/x86/kernel/kprobes.c          |    5 +++
 include/linux/ftrace.h             |    7 ++++-
 kernel/kprobes.c                   |   33 +++-------------------
 kernel/trace/ftrace.c              |   54 ++++++++++--------------------------
 7 files changed, 52 insertions(+), 70 deletions(-)

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America), Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com

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

* [PATCH -tip 1/4] [RESEND] kprobes: Disable booster when CONFIG_PREEMPT=y
  2010-02-02 21:48 [PATCH -tip 0/4] kprobes updates Masami Hiramatsu
@ 2010-02-02 21:49 ` Masami Hiramatsu
  2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
  2010-02-02 21:49 ` [PATCH -tip 2/4] ftrace/alternatives: Introducing *_text_reserved functions Masami Hiramatsu
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Masami Hiramatsu @ 2010-02-02 21:49 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Ananth N Mavinakayanahalli,
	Frederic Weisbecker, Ingo Molnar, Jim Keniston,
	Mathieu Desnoyers, Steven Rostedt

Disable kprobe booster when CONFIG_PREEMPT=y at this time, because
it can't ensure that all kernel threads preempted on kprobe's boosted
slot run out from the slot even using freeze_processes().

The booster on preemptive kernel will be resumed if synchronize_tasks()
or something like that is introduced.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jim Keniston <jkenisto@us.ibm.com>
CC: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
---

 arch/ia64/kernel/kprobes.c |    2 +-
 arch/x86/kernel/kprobes.c  |    2 +-
 kernel/kprobes.c           |   29 ++---------------------------
 3 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 9adac44..7026b29 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -870,7 +870,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
 		return 1;
 
 ss_probe:
-#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
+#if !defined(CONFIG_PREEMPT)
 	if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) {
 		/* Boost up -- we can execute copied instructions directly */
 		ia64_psr(regs)->ri = p->ainsn.slot;
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 5b8c750..9453815 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -429,7 +429,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
 static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
 				       struct kprobe_ctlblk *kcb)
 {
-#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
+#if !defined(CONFIG_PREEMPT)
 	if (p->ainsn.boostable == 1 && !p->post_handler) {
 		/* Boost up -- we can execute copied instructions directly */
 		reset_current_kprobe();
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index b7df302..9907a03 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -124,30 +124,6 @@ static LIST_HEAD(kprobe_insn_pages);
 static int kprobe_garbage_slots;
 static int collect_garbage_slots(void);
 
-static int __kprobes check_safety(void)
-{
-	int ret = 0;
-#if defined(CONFIG_PREEMPT) && defined(CONFIG_FREEZER)
-	ret = freeze_processes();
-	if (ret == 0) {
-		struct task_struct *p, *q;
-		do_each_thread(p, q) {
-			if (p != current && p->state == TASK_RUNNING &&
-			    p->pid != 0) {
-				printk("Check failed: %s is running\n",p->comm);
-				ret = -1;
-				goto loop_end;
-			}
-		} while_each_thread(p, q);
-	}
-loop_end:
-	thaw_processes();
-#else
-	synchronize_sched();
-#endif
-	return ret;
-}
-
 /**
  * __get_insn_slot() - Find a slot on an executable page for an instruction.
  * We allocate an executable page if there's no room on existing ones.
@@ -235,9 +211,8 @@ static int __kprobes collect_garbage_slots(void)
 {
 	struct kprobe_insn_page *kip, *next;
 
-	/* Ensure no-one is preepmted on the garbages */
-	if (check_safety())
-		return -EAGAIN;
+	/* Ensure no-one is interrupted on the garbages */
+	synchronize_sched();
 
 	list_for_each_entry_safe(kip, next, &kprobe_insn_pages, list) {
 		int i;


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* [PATCH -tip 2/4] ftrace/alternatives: Introducing *_text_reserved functions
  2010-02-02 21:48 [PATCH -tip 0/4] kprobes updates Masami Hiramatsu
  2010-02-02 21:49 ` [PATCH -tip 1/4] [RESEND] kprobes: Disable booster when CONFIG_PREEMPT=y Masami Hiramatsu
@ 2010-02-02 21:49 ` Masami Hiramatsu
  2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
  2010-02-02 21:49 ` [PATCH -tip 3/4] kprobes: Check probe address is reserved Masami Hiramatsu
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Masami Hiramatsu @ 2010-02-02 21:49 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Ingo Molnar, Steven Rostedt,
	PrzemysławPawełczyk, Frederic Weisbecker,
	Ananth N Mavinakayanahalli, Jim Keniston, Mathieu Desnoyers,
	Jason Baron

Introducing *_text_reserved functions for checking the text address range
is partially reserved or not. This patch provides checking routines for
x86 smp alternatives and dynamic ftrace. Since both functions modify fixed
pieces of kernel text, they should reserve and protect those from other
dynamic text modifier, like kprobes.

This will also be extended when introducing other subsystems which
modify fixed pieces of kernel text. Dynamic text modifiers should
avoid those.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
CC: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Jason Baron <jbaron@redhat.com>
---

 arch/x86/include/asm/alternative.h |    5 +++++
 arch/x86/kernel/alternative.c      |   16 ++++++++++++++++
 include/linux/ftrace.h             |    6 ++++++
 kernel/trace/ftrace.c              |   15 +++++++++++++++
 4 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index 3b5b828..f1e253c 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -65,12 +65,17 @@ extern void alternatives_smp_module_add(struct module *mod, char *name,
 					void *text, void *text_end);
 extern void alternatives_smp_module_del(struct module *mod);
 extern void alternatives_smp_switch(int smp);
+extern int alternatives_text_reserved(void *start, void *end);
 #else
 static inline void alternatives_smp_module_add(struct module *mod, char *name,
 					       void *locks, void *locks_end,
 					       void *text, void *text_end) {}
 static inline void alternatives_smp_module_del(struct module *mod) {}
 static inline void alternatives_smp_switch(int smp) {}
+static inline int alternatives_text_reserved(void *start, void *end)
+{
+	return 0;
+}
 #endif	/* CONFIG_SMP */
 
 /* alternative assembly primitive: */
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 2589ea4..3832fdc 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -392,6 +392,22 @@ void alternatives_smp_switch(int smp)
 	mutex_unlock(&smp_alt);
 }
 
+/* Return 1 if the address range is reserved for smp-alternatives */
+int alternatives_text_reserved(void *start, void *end)
+{
+	struct smp_alt_module *mod;
+	u8 **ptr;
+
+	list_for_each_entry(mod, &smp_alt_modules, next) {
+		if (mod->text > end || mod->text_end < start)
+			continue;
+		for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
+			if (start <= *ptr && end >= *ptr)
+				return 1;
+	}
+
+	return 0;
+}
 #endif
 
 #ifdef CONFIG_PARAVIRT
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 0b4f97d..9d127ef 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -134,6 +134,8 @@ extern void
 unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
 extern void unregister_ftrace_function_probe_all(char *glob);
 
+extern int ftrace_text_reserved(void *start, void *end);
+
 enum {
 	FTRACE_FL_FREE		= (1 << 0),
 	FTRACE_FL_FAILED	= (1 << 1),
@@ -250,6 +252,10 @@ static inline int unregister_ftrace_command(char *cmd_name)
 {
 	return -EINVAL;
 }
+static inline int ftrace_text_reserved(void *start, void *end)
+{
+	return 0;
+}
 #endif /* CONFIG_DYNAMIC_FTRACE */
 
 /* totally disable ftrace - can not re-enable after this */
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1e6640f..3d90661 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1025,6 +1025,21 @@ static void ftrace_bug(int failed, unsigned long ip)
 }
 
 
+/* Return 1 if the address range is reserved for ftrace */
+int ftrace_text_reserved(void *start, void *end)
+{
+	struct dyn_ftrace *rec;
+	struct ftrace_page *pg;
+
+	do_for_each_ftrace_rec(pg, rec) {
+		if (rec->ip <= (unsigned long)end &&
+		    rec->ip + MCOUNT_INSN_SIZE > (unsigned long)start)
+			return 1;
+	} while_for_each_ftrace_rec();
+	return 0;
+}
+
+
 static int
 __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
 {


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* [PATCH -tip 3/4] kprobes: Check probe address is reserved
  2010-02-02 21:48 [PATCH -tip 0/4] kprobes updates Masami Hiramatsu
  2010-02-02 21:49 ` [PATCH -tip 1/4] [RESEND] kprobes: Disable booster when CONFIG_PREEMPT=y Masami Hiramatsu
  2010-02-02 21:49 ` [PATCH -tip 2/4] ftrace/alternatives: Introducing *_text_reserved functions Masami Hiramatsu
@ 2010-02-02 21:49 ` Masami Hiramatsu
  2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
  2010-02-02 21:49 ` [PATCH -tip 4/4] ftrace: Remove record freezing Masami Hiramatsu
  2010-02-04  9:06 ` [PATCH -tip 0/4] kprobes updates Ingo Molnar
  4 siblings, 1 reply; 12+ messages in thread
From: Masami Hiramatsu @ 2010-02-02 21:49 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Ingo Molnar, Steven Rostedt,
	PrzemysławPawełczyk, Frederic Weisbecker,
	Ananth N Mavinakayanahalli, Jim Keniston, Mathieu Desnoyers,
	Jason Baron

Check whether the address of new probe is already reserved by ftrace
or alternatives (on x86) when registering new probe.
If reserved, it returns an error and not register the probe.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
CC: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Jason Baron <jbaron@redhat.com>
---

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

diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 9453815..5de9f4a 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -337,6 +337,9 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
 
 int __kprobes arch_prepare_kprobe(struct kprobe *p)
 {
+	if (alternatives_text_reserved(p->addr, p->addr))
+		return -EINVAL;
+
 	if (!can_probe((unsigned long)p->addr))
 		return -EILSEQ;
 	/* insn: must be on special executable page on x86. */
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 9907a03..c3340e8 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -44,6 +44,7 @@
 #include <linux/debugfs.h>
 #include <linux/kdebug.h>
 #include <linux/memory.h>
+#include <linux/ftrace.h>
 
 #include <asm-generic/sections.h>
 #include <asm/cacheflush.h>
@@ -703,7 +704,8 @@ int __kprobes register_kprobe(struct kprobe *p)
 
 	preempt_disable();
 	if (!kernel_text_address((unsigned long) p->addr) ||
-	    in_kprobes_functions((unsigned long) p->addr)) {
+	    in_kprobes_functions((unsigned long) p->addr) ||
+	    ftrace_text_reserved(p->addr, p->addr)) {
 		preempt_enable();
 		return -EINVAL;
 	}


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* [PATCH -tip 4/4] ftrace: Remove record freezing
  2010-02-02 21:48 [PATCH -tip 0/4] kprobes updates Masami Hiramatsu
                   ` (2 preceding siblings ...)
  2010-02-02 21:49 ` [PATCH -tip 3/4] kprobes: Check probe address is reserved Masami Hiramatsu
@ 2010-02-02 21:49 ` Masami Hiramatsu
  2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
  2010-02-04 13:49   ` [PATCH -tip 4/4] " Steven Rostedt
  2010-02-04  9:06 ` [PATCH -tip 0/4] kprobes updates Ingo Molnar
  4 siblings, 2 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2010-02-02 21:49 UTC (permalink / raw)
  To: Ingo Molnar, lkml
  Cc: systemtap, DLE, Masami Hiramatsu, Ingo Molnar, Steven Rostedt,
	PrzemysławPawełczyk, Frederic Weisbecker

Remove record freezing. Because kprobes never puts probe on
ftrace's mcount call anymore, it doesn't need ftrace to check
whether kprobes on it.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
---

 include/linux/ftrace.h |    1 -
 kernel/trace/ftrace.c  |   39 ---------------------------------------
 2 files changed, 0 insertions(+), 40 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9d127ef..eb054ae 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -143,7 +143,6 @@ enum {
 	FTRACE_FL_ENABLED	= (1 << 3),
 	FTRACE_FL_NOTRACE	= (1 << 4),
 	FTRACE_FL_CONVERTED	= (1 << 5),
-	FTRACE_FL_FROZEN	= (1 << 6),
 };
 
 struct dyn_ftrace {
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 3d90661..1904797 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -22,7 +22,6 @@
 #include <linux/hardirq.h>
 #include <linux/kthread.h>
 #include <linux/uaccess.h>
-#include <linux/kprobes.h>
 #include <linux/ftrace.h>
 #include <linux/sysctl.h>
 #include <linux/ctype.h>
@@ -898,36 +897,6 @@ static struct dyn_ftrace *ftrace_free_records;
 		}				\
 	}
 
-#ifdef CONFIG_KPROBES
-
-static int frozen_record_count;
-
-static inline void freeze_record(struct dyn_ftrace *rec)
-{
-	if (!(rec->flags & FTRACE_FL_FROZEN)) {
-		rec->flags |= FTRACE_FL_FROZEN;
-		frozen_record_count++;
-	}
-}
-
-static inline void unfreeze_record(struct dyn_ftrace *rec)
-{
-	if (rec->flags & FTRACE_FL_FROZEN) {
-		rec->flags &= ~FTRACE_FL_FROZEN;
-		frozen_record_count--;
-	}
-}
-
-static inline int record_frozen(struct dyn_ftrace *rec)
-{
-	return rec->flags & FTRACE_FL_FROZEN;
-}
-#else
-# define freeze_record(rec)			({ 0; })
-# define unfreeze_record(rec)			({ 0; })
-# define record_frozen(rec)			({ 0; })
-#endif /* CONFIG_KPROBES */
-
 static void ftrace_free_rec(struct dyn_ftrace *rec)
 {
 	rec->freelist = ftrace_free_records;
@@ -1091,14 +1060,6 @@ static void ftrace_replace_code(int enable)
 		    !(rec->flags & FTRACE_FL_CONVERTED))
 			continue;
 
-		/* ignore updates to this record's mcount site */
-		if (get_kprobe((void *)rec->ip)) {
-			freeze_record(rec);
-			continue;
-		} else {
-			unfreeze_record(rec);
-		}
-
 		failed = __ftrace_replace_code(rec, enable);
 		if (failed) {
 			rec->flags |= FTRACE_FL_FAILED;


-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com

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

* Re: [PATCH -tip 0/4] kprobes updates
  2010-02-02 21:48 [PATCH -tip 0/4] kprobes updates Masami Hiramatsu
                   ` (3 preceding siblings ...)
  2010-02-02 21:49 ` [PATCH -tip 4/4] ftrace: Remove record freezing Masami Hiramatsu
@ 2010-02-04  9:06 ` Ingo Molnar
  2010-02-04 20:37   ` Masami Hiramatsu
  4 siblings, 1 reply; 12+ messages in thread
From: Ingo Molnar @ 2010-02-04  9:06 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: lkml, Steven Rostedt, Przemys??awPawe??czyk, Frederic Weisbecker,
	Ananth N Mavinakayanahalli, Jim Keniston, Mathieu Desnoyers,
	Jason Baron, systemtap, DLE


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

	Ingo

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

* [tip:perf/core] kprobes: Disable booster when CONFIG_PREEMPT=y
  2010-02-02 21:49 ` [PATCH -tip 1/4] [RESEND] kprobes: Disable booster when CONFIG_PREEMPT=y Masami Hiramatsu
@ 2010-02-04  9:55   ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-02-04  9:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jkenisto, ananth, dle-develop,
	fweisbec, rostedt, compudj, tglx, mhiramat, mingo, systemtap

Commit-ID:  615d0ebbc782b67296e3226c293f520f93f93515
Gitweb:     http://git.kernel.org/tip/615d0ebbc782b67296e3226c293f520f93f93515
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Tue, 2 Feb 2010 16:49:04 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 4 Feb 2010 09:36:18 +0100

kprobes: Disable booster when CONFIG_PREEMPT=y

Disable kprobe booster when CONFIG_PREEMPT=y at this time,
because it can't ensure that all kernel threads preempted on
kprobe's boosted slot run out from the slot even using
freeze_processes().

The booster on preemptive kernel will be resumed if
synchronize_tasks() or something like that is introduced.

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: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20100202214904.4694.24330.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/ia64/kernel/kprobes.c |    2 +-
 arch/x86/kernel/kprobes.c  |    2 +-
 kernel/kprobes.c           |   29 ++---------------------------
 3 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 9adac44..7026b29 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -870,7 +870,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
 		return 1;
 
 ss_probe:
-#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
+#if !defined(CONFIG_PREEMPT)
 	if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) {
 		/* Boost up -- we can execute copied instructions directly */
 		ia64_psr(regs)->ri = p->ainsn.slot;
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 5b8c750..9453815 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -429,7 +429,7 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
 static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
 				       struct kprobe_ctlblk *kcb)
 {
-#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
+#if !defined(CONFIG_PREEMPT)
 	if (p->ainsn.boostable == 1 && !p->post_handler) {
 		/* Boost up -- we can execute copied instructions directly */
 		reset_current_kprobe();
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index b7df302..9907a03 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -124,30 +124,6 @@ static LIST_HEAD(kprobe_insn_pages);
 static int kprobe_garbage_slots;
 static int collect_garbage_slots(void);
 
-static int __kprobes check_safety(void)
-{
-	int ret = 0;
-#if defined(CONFIG_PREEMPT) && defined(CONFIG_FREEZER)
-	ret = freeze_processes();
-	if (ret == 0) {
-		struct task_struct *p, *q;
-		do_each_thread(p, q) {
-			if (p != current && p->state == TASK_RUNNING &&
-			    p->pid != 0) {
-				printk("Check failed: %s is running\n",p->comm);
-				ret = -1;
-				goto loop_end;
-			}
-		} while_each_thread(p, q);
-	}
-loop_end:
-	thaw_processes();
-#else
-	synchronize_sched();
-#endif
-	return ret;
-}
-
 /**
  * __get_insn_slot() - Find a slot on an executable page for an instruction.
  * We allocate an executable page if there's no room on existing ones.
@@ -235,9 +211,8 @@ static int __kprobes collect_garbage_slots(void)
 {
 	struct kprobe_insn_page *kip, *next;
 
-	/* Ensure no-one is preepmted on the garbages */
-	if (check_safety())
-		return -EAGAIN;
+	/* Ensure no-one is interrupted on the garbages */
+	synchronize_sched();
 
 	list_for_each_entry_safe(kip, next, &kprobe_insn_pages, list) {
 		int i;

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

* [tip:perf/core] ftrace/alternatives: Introducing *_text_reserved functions
  2010-02-02 21:49 ` [PATCH -tip 2/4] ftrace/alternatives: Introducing *_text_reserved functions Masami Hiramatsu
@ 2010-02-04  9:55   ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-02-04  9:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jkenisto, ananth, dle-develop,
	fweisbec, rostedt, compudj, jbaron, tglx, mhiramat, mingo,
	systemtap

Commit-ID:  2cfa19780d61740f65790c5bae363b759d7c96fa
Gitweb:     http://git.kernel.org/tip/2cfa19780d61740f65790c5bae363b759d7c96fa
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Tue, 2 Feb 2010 16:49:11 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 4 Feb 2010 09:36:19 +0100

ftrace/alternatives: Introducing *_text_reserved functions

Introducing *_text_reserved functions for checking the text
address range is partially reserved or not. This patch provides
checking routines for x86 smp alternatives and dynamic ftrace.
Since both functions modify fixed pieces of kernel text, they
should reserve and protect those from other dynamic text
modifier, like kprobes.

This will also be extended when introducing other subsystems
which modify fixed pieces of kernel text. Dynamic text modifiers
should avoid those.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: przemyslaw@pawelczyk.it
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Jason Baron <jbaron@redhat.com>
LKML-Reference: <20100202214911.4694.16587.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/include/asm/alternative.h |    5 +++++
 arch/x86/kernel/alternative.c      |   16 ++++++++++++++++
 include/linux/ftrace.h             |    6 ++++++
 kernel/trace/ftrace.c              |   15 +++++++++++++++
 4 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h
index 69b74a7..ac80b7d 100644
--- a/arch/x86/include/asm/alternative.h
+++ b/arch/x86/include/asm/alternative.h
@@ -65,12 +65,17 @@ extern void alternatives_smp_module_add(struct module *mod, char *name,
 					void *text, void *text_end);
 extern void alternatives_smp_module_del(struct module *mod);
 extern void alternatives_smp_switch(int smp);
+extern int alternatives_text_reserved(void *start, void *end);
 #else
 static inline void alternatives_smp_module_add(struct module *mod, char *name,
 					       void *locks, void *locks_end,
 					       void *text, void *text_end) {}
 static inline void alternatives_smp_module_del(struct module *mod) {}
 static inline void alternatives_smp_switch(int smp) {}
+static inline int alternatives_text_reserved(void *start, void *end)
+{
+	return 0;
+}
 #endif	/* CONFIG_SMP */
 
 /* alternative assembly primitive: */
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index de7353c..3c13284 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -390,6 +390,22 @@ void alternatives_smp_switch(int smp)
 	mutex_unlock(&smp_alt);
 }
 
+/* Return 1 if the address range is reserved for smp-alternatives */
+int alternatives_text_reserved(void *start, void *end)
+{
+	struct smp_alt_module *mod;
+	u8 **ptr;
+
+	list_for_each_entry(mod, &smp_alt_modules, next) {
+		if (mod->text > end || mod->text_end < start)
+			continue;
+		for (ptr = mod->locks; ptr < mod->locks_end; ptr++)
+			if (start <= *ptr && end >= *ptr)
+				return 1;
+	}
+
+	return 0;
+}
 #endif
 
 #ifdef CONFIG_PARAVIRT
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 0b4f97d..9d127ef 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -134,6 +134,8 @@ extern void
 unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
 extern void unregister_ftrace_function_probe_all(char *glob);
 
+extern int ftrace_text_reserved(void *start, void *end);
+
 enum {
 	FTRACE_FL_FREE		= (1 << 0),
 	FTRACE_FL_FAILED	= (1 << 1),
@@ -250,6 +252,10 @@ static inline int unregister_ftrace_command(char *cmd_name)
 {
 	return -EINVAL;
 }
+static inline int ftrace_text_reserved(void *start, void *end)
+{
+	return 0;
+}
 #endif /* CONFIG_DYNAMIC_FTRACE */
 
 /* totally disable ftrace - can not re-enable after this */
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1e6640f..3d90661 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1025,6 +1025,21 @@ static void ftrace_bug(int failed, unsigned long ip)
 }
 
 
+/* Return 1 if the address range is reserved for ftrace */
+int ftrace_text_reserved(void *start, void *end)
+{
+	struct dyn_ftrace *rec;
+	struct ftrace_page *pg;
+
+	do_for_each_ftrace_rec(pg, rec) {
+		if (rec->ip <= (unsigned long)end &&
+		    rec->ip + MCOUNT_INSN_SIZE > (unsigned long)start)
+			return 1;
+	} while_for_each_ftrace_rec();
+	return 0;
+}
+
+
 static int
 __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
 {

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

* [tip:perf/core] kprobes: Check probe address is reserved
  2010-02-02 21:49 ` [PATCH -tip 3/4] kprobes: Check probe address is reserved Masami Hiramatsu
@ 2010-02-04  9:55   ` tip-bot for Masami Hiramatsu
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-02-04  9:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, jkenisto, ananth, dle-develop,
	fweisbec, rostedt, compudj, jbaron, tglx, mhiramat, mingo,
	systemtap

Commit-ID:  4554dbcb85a4ed2abaa2b6fa15649b796699ec89
Gitweb:     http://git.kernel.org/tip/4554dbcb85a4ed2abaa2b6fa15649b796699ec89
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Tue, 2 Feb 2010 16:49:18 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 4 Feb 2010 09:36:19 +0100

kprobes: Check probe address is reserved

Check whether the address of new probe is already reserved by
ftrace or alternatives (on x86) when registering new probe.
If reserved, it returns an error and not register the probe.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: przemyslaw@pawelczyk.it
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Mathieu Desnoyers <compudj@krystal.dyndns.org>
Cc: Jason Baron <jbaron@redhat.com>
LKML-Reference: <20100202214918.4694.94179.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/kprobes.c |    3 +++
 kernel/kprobes.c          |    4 +++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 9453815..5de9f4a 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -337,6 +337,9 @@ static void __kprobes arch_copy_kprobe(struct kprobe *p)
 
 int __kprobes arch_prepare_kprobe(struct kprobe *p)
 {
+	if (alternatives_text_reserved(p->addr, p->addr))
+		return -EINVAL;
+
 	if (!can_probe((unsigned long)p->addr))
 		return -EILSEQ;
 	/* insn: must be on special executable page on x86. */
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 9907a03..c3340e8 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -44,6 +44,7 @@
 #include <linux/debugfs.h>
 #include <linux/kdebug.h>
 #include <linux/memory.h>
+#include <linux/ftrace.h>
 
 #include <asm-generic/sections.h>
 #include <asm/cacheflush.h>
@@ -703,7 +704,8 @@ int __kprobes register_kprobe(struct kprobe *p)
 
 	preempt_disable();
 	if (!kernel_text_address((unsigned long) p->addr) ||
-	    in_kprobes_functions((unsigned long) p->addr)) {
+	    in_kprobes_functions((unsigned long) p->addr) ||
+	    ftrace_text_reserved(p->addr, p->addr)) {
 		preempt_enable();
 		return -EINVAL;
 	}

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

* [tip:perf/core] ftrace: Remove record freezing
  2010-02-02 21:49 ` [PATCH -tip 4/4] ftrace: Remove record freezing Masami Hiramatsu
@ 2010-02-04  9:55   ` tip-bot for Masami Hiramatsu
  2010-02-04 13:49   ` [PATCH -tip 4/4] " Steven Rostedt
  1 sibling, 0 replies; 12+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2010-02-04  9:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dle-develop, fweisbec, rostedt, tglx,
	mhiramat, mingo, systemtap

Commit-ID:  f24bb999d2b9f2950e5cac5b69bffedf73c24ea4
Gitweb:     http://git.kernel.org/tip/f24bb999d2b9f2950e5cac5b69bffedf73c24ea4
Author:     Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Tue, 2 Feb 2010 16:49:25 -0500
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 4 Feb 2010 09:36:19 +0100

ftrace: Remove record freezing

Remove record freezing. Because kprobes never puts probe on
ftrace's mcount call anymore, it doesn't need ftrace to check
whether kprobes on it.

Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: przemyslaw@pawelczyk.it
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20100202214925.4694.73469.stgit@dhcp-100-2-132.bos.redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/linux/ftrace.h |    1 -
 kernel/trace/ftrace.c  |   39 ---------------------------------------
 2 files changed, 0 insertions(+), 40 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9d127ef..eb054ae 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -143,7 +143,6 @@ enum {
 	FTRACE_FL_ENABLED	= (1 << 3),
 	FTRACE_FL_NOTRACE	= (1 << 4),
 	FTRACE_FL_CONVERTED	= (1 << 5),
-	FTRACE_FL_FROZEN	= (1 << 6),
 };
 
 struct dyn_ftrace {
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 3d90661..1904797 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -22,7 +22,6 @@
 #include <linux/hardirq.h>
 #include <linux/kthread.h>
 #include <linux/uaccess.h>
-#include <linux/kprobes.h>
 #include <linux/ftrace.h>
 #include <linux/sysctl.h>
 #include <linux/ctype.h>
@@ -898,36 +897,6 @@ static struct dyn_ftrace *ftrace_free_records;
 		}				\
 	}
 
-#ifdef CONFIG_KPROBES
-
-static int frozen_record_count;
-
-static inline void freeze_record(struct dyn_ftrace *rec)
-{
-	if (!(rec->flags & FTRACE_FL_FROZEN)) {
-		rec->flags |= FTRACE_FL_FROZEN;
-		frozen_record_count++;
-	}
-}
-
-static inline void unfreeze_record(struct dyn_ftrace *rec)
-{
-	if (rec->flags & FTRACE_FL_FROZEN) {
-		rec->flags &= ~FTRACE_FL_FROZEN;
-		frozen_record_count--;
-	}
-}
-
-static inline int record_frozen(struct dyn_ftrace *rec)
-{
-	return rec->flags & FTRACE_FL_FROZEN;
-}
-#else
-# define freeze_record(rec)			({ 0; })
-# define unfreeze_record(rec)			({ 0; })
-# define record_frozen(rec)			({ 0; })
-#endif /* CONFIG_KPROBES */
-
 static void ftrace_free_rec(struct dyn_ftrace *rec)
 {
 	rec->freelist = ftrace_free_records;
@@ -1091,14 +1060,6 @@ static void ftrace_replace_code(int enable)
 		    !(rec->flags & FTRACE_FL_CONVERTED))
 			continue;
 
-		/* ignore updates to this record's mcount site */
-		if (get_kprobe((void *)rec->ip)) {
-			freeze_record(rec);
-			continue;
-		} else {
-			unfreeze_record(rec);
-		}
-
 		failed = __ftrace_replace_code(rec, enable);
 		if (failed) {
 			rec->flags |= FTRACE_FL_FAILED;

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

* Re: [PATCH -tip 4/4] ftrace: Remove record freezing
  2010-02-02 21:49 ` [PATCH -tip 4/4] ftrace: Remove record freezing Masami Hiramatsu
  2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
@ 2010-02-04 13:49   ` Steven Rostedt
  1 sibling, 0 replies; 12+ messages in thread
From: Steven Rostedt @ 2010-02-04 13:49 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Ingo Molnar, lkml, systemtap, DLE, PrzemysławPawełczyk,
	Frederic Weisbecker

Sorry for the late reply.


On Tue, 2010-02-02 at 16:49 -0500, Masami Hiramatsu wrote:
> Remove record freezing. Because kprobes never puts probe on
> ftrace's mcount call anymore, it doesn't need ftrace to check
> whether kprobes on it.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
> Cc: Ingo Molnar <mingo@elte.hu>

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

> Cc: Przemysław Pawełczyk <przemyslaw@pawelczyk.it>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> 
>  include/linux/ftrace.h |    1 -
>  kernel/trace/ftrace.c  |   39 ---------------------------------------
>  2 files changed, 0 insertions(+), 40 deletions(-)
> 
> diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
> index 9d127ef..eb054ae 100644
> --- a/include/linux/ftrace.h
> +++ b/include/linux/ftrace.h
> @@ -143,7 +143,6 @@ enum {
>  	FTRACE_FL_ENABLED	= (1 << 3),
>  	FTRACE_FL_NOTRACE	= (1 << 4),
>  	FTRACE_FL_CONVERTED	= (1 << 5),
> -	FTRACE_FL_FROZEN	= (1 << 6),
>  };
>  
>  struct dyn_ftrace {
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 3d90661..1904797 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -22,7 +22,6 @@
>  #include <linux/hardirq.h>
>  #include <linux/kthread.h>
>  #include <linux/uaccess.h>
> -#include <linux/kprobes.h>
>  #include <linux/ftrace.h>
>  #include <linux/sysctl.h>
>  #include <linux/ctype.h>
> @@ -898,36 +897,6 @@ static struct dyn_ftrace *ftrace_free_records;
>  		}				\
>  	}
>  
> -#ifdef CONFIG_KPROBES
> -
> -static int frozen_record_count;
> -
> -static inline void freeze_record(struct dyn_ftrace *rec)
> -{
> -	if (!(rec->flags & FTRACE_FL_FROZEN)) {
> -		rec->flags |= FTRACE_FL_FROZEN;
> -		frozen_record_count++;
> -	}
> -}
> -
> -static inline void unfreeze_record(struct dyn_ftrace *rec)
> -{
> -	if (rec->flags & FTRACE_FL_FROZEN) {
> -		rec->flags &= ~FTRACE_FL_FROZEN;
> -		frozen_record_count--;
> -	}
> -}
> -
> -static inline int record_frozen(struct dyn_ftrace *rec)
> -{
> -	return rec->flags & FTRACE_FL_FROZEN;
> -}
> -#else
> -# define freeze_record(rec)			({ 0; })
> -# define unfreeze_record(rec)			({ 0; })
> -# define record_frozen(rec)			({ 0; })
> -#endif /* CONFIG_KPROBES */
> -
>  static void ftrace_free_rec(struct dyn_ftrace *rec)
>  {
>  	rec->freelist = ftrace_free_records;
> @@ -1091,14 +1060,6 @@ static void ftrace_replace_code(int enable)
>  		    !(rec->flags & FTRACE_FL_CONVERTED))
>  			continue;
>  
> -		/* ignore updates to this record's mcount site */
> -		if (get_kprobe((void *)rec->ip)) {
> -			freeze_record(rec);
> -			continue;
> -		} else {
> -			unfreeze_record(rec);
> -		}
> -
>  		failed = __ftrace_replace_code(rec, enable);
>  		if (failed) {
>  			rec->flags |= FTRACE_FL_FAILED;
> 
> 



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

* Re: [PATCH -tip 0/4] kprobes updates
  2010-02-04  9:06 ` [PATCH -tip 0/4] kprobes updates Ingo Molnar
@ 2010-02-04 20:37   ` Masami Hiramatsu
  0 siblings, 0 replies; 12+ messages in thread
From: Masami Hiramatsu @ 2010-02-04 20:37 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: lkml, Steven Rostedt, Przemys??awPawe??czyk, Frederic Weisbecker,
	Ananth N Mavinakayanahalli, Jim Keniston, Mathieu Desnoyers,
	Jason Baron, systemtap, DLE

Ingo Molnar wrote:
> 
> 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

Oops, thanks. I'll fix it in next patches.

Thank you,

-- 
Masami Hiramatsu

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

e-mail: mhiramat@redhat.com


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

end of thread, other threads:[~2010-02-04 20:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-02 21:48 [PATCH -tip 0/4] kprobes updates Masami Hiramatsu
2010-02-02 21:49 ` [PATCH -tip 1/4] [RESEND] kprobes: Disable booster when CONFIG_PREEMPT=y Masami Hiramatsu
2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-02-02 21:49 ` [PATCH -tip 2/4] ftrace/alternatives: Introducing *_text_reserved functions Masami Hiramatsu
2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-02-02 21:49 ` [PATCH -tip 3/4] kprobes: Check probe address is reserved Masami Hiramatsu
2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-02-02 21:49 ` [PATCH -tip 4/4] ftrace: Remove record freezing Masami Hiramatsu
2010-02-04  9:55   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2010-02-04 13:49   ` [PATCH -tip 4/4] " Steven Rostedt
2010-02-04  9:06 ` [PATCH -tip 0/4] kprobes updates Ingo Molnar
2010-02-04 20:37   ` 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.