Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1575995 > unrolled thread

[PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

Started by"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
First post2017-02-07 21:00 +0100
Last post2017-02-13 09:40 +0100
Articles 7 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-02-07 21:00 +0100
    [PATCH 3/3] powerpc: kprobes: remove kprobe_exceptions_notify() "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-02-07 21:00 +0100
    [PATCH 2/3] arm: kprobes: remove kprobe_exceptions_notify "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-02-07 21:00 +0100
    Re: [PATCH 1/3] kprobes: introduce weak variant of  kprobe_exceptions_notify Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-08 03:00 +0100
    Re: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify Michael Ellerman <mpe@ellerman.id.au> - 2017-02-10 04:50 +0100
      Re: [PATCH 1/3] kprobes: introduce weak variant of  kprobe_exceptions_notify Ingo Molnar <mingo@kernel.org> - 2017-02-10 09:00 +0100
      Re: [PATCH 1/3] kprobes: introduce weak variant of  kprobe_exceptions_notify "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-02-13 09:40 +0100

#1575995 — [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-02-07 21:00 +0100
Subject[PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify
Message-ID<t8k5H-78e-1@gated-at.bofh.it>
kprobe_exceptions_notify() is not used on some of the architectures such
as arm[64] and powerpc anymore. Introduce a weak variant for such
architectures.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 kernel/kprobes.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 43460104f119..60a702a05684 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1705,6 +1705,12 @@ void unregister_kprobes(struct kprobe **kps, int num)
 }
 EXPORT_SYMBOL_GPL(unregister_kprobes);
 
+int __weak __kprobes kprobe_exceptions_notify(struct notifier_block *self,
+					      unsigned long val, void *data)
+{
+	return NOTIFY_DONE;
+}
+
 static struct notifier_block kprobe_exceptions_nb = {
 	.notifier_call = kprobe_exceptions_notify,
 	.priority = 0x7fffffff /* we need to be notified first */
-- 
2.11.0

[toc] | [next] | [standalone]


#1575997 — [PATCH 3/3] powerpc: kprobes: remove kprobe_exceptions_notify()

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-02-07 21:00 +0100
Subject[PATCH 3/3] powerpc: kprobes: remove kprobe_exceptions_notify()
Message-ID<t8k5I-78e-13@gated-at.bofh.it>
In reply to#1575995
... as the weak variant will do.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 arch/powerpc/kernel/kprobes.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index 45e4f82b230d..fce05a38851c 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -475,15 +475,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
 	return 0;
 }
 
-/*
- * Wrapper routine to for handling exceptions.
- */
-int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
-				       unsigned long val, void *data)
-{
-	return NOTIFY_DONE;
-}
-
 unsigned long arch_deref_entry_point(void *entry)
 {
 	return ppc_global_function_entry(entry);
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1576001 — [PATCH 2/3] arm: kprobes: remove kprobe_exceptions_notify

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-02-07 21:00 +0100
Subject[PATCH 2/3] arm: kprobes: remove kprobe_exceptions_notify
Message-ID<t8k5J-78e-33@gated-at.bofh.it>
In reply to#1575995
... as the weak variant will do.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 arch/arm/probes/kprobes/core.c     | 10 ----------
 arch/arm64/kernel/probes/kprobes.c |  6 ------
 2 files changed, 16 deletions(-)

diff --git a/arch/arm/probes/kprobes/core.c b/arch/arm/probes/kprobes/core.c
index a4ec240ee7ba..f89db1e278cf 100644
--- a/arch/arm/probes/kprobes/core.c
+++ b/arch/arm/probes/kprobes/core.c
@@ -391,16 +391,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr)
 	return 0;
 }
 
-int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
-				       unsigned long val, void *data)
-{
-	/*
-	 * notify_die() is currently never called on ARM,
-	 * so this callback is currently empty.
-	 */
-	return NOTIFY_DONE;
-}
-
 /*
  * When a retprobed function returns, trampoline_handler() is called,
  * calling the kretprobe's handler. We construct a struct pt_regs to
diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
index f0593c92279b..769becae3e90 100644
--- a/arch/arm64/kernel/probes/kprobes.c
+++ b/arch/arm64/kernel/probes/kprobes.c
@@ -371,12 +371,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr)
 	return 0;
 }
 
-int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
-				       unsigned long val, void *data)
-{
-	return NOTIFY_DONE;
-}
-
 static void __kprobes kprobe_handler(struct pt_regs *regs)
 {
 	struct kprobe *p, *cur_kprobe;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1576221 — Re: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2017-02-08 03:00 +0100
SubjectRe: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify
Message-ID<t8pI5-2cw-5@gated-at.bofh.it>
In reply to#1575995
On Wed,  8 Feb 2017 01:24:14 +0530
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:

> kprobe_exceptions_notify() is not used on some of the architectures such
> as arm[64] and powerpc anymore. Introduce a weak variant for such
> architectures.
> 

Good catch!

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

for all patches in this series.

Thank you!

> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
>  kernel/kprobes.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 43460104f119..60a702a05684 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -1705,6 +1705,12 @@ void unregister_kprobes(struct kprobe **kps, int num)
>  }
>  EXPORT_SYMBOL_GPL(unregister_kprobes);
>  
> +int __weak __kprobes kprobe_exceptions_notify(struct notifier_block *self,
> +					      unsigned long val, void *data)
> +{
> +	return NOTIFY_DONE;
> +}
> +
>  static struct notifier_block kprobe_exceptions_nb = {
>  	.notifier_call = kprobe_exceptions_notify,
>  	.priority = 0x7fffffff /* we need to be notified first */
> -- 
> 2.11.0
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1578164

FromMichael Ellerman <mpe@ellerman.id.au>
Date2017-02-10 04:50 +0100
Message-ID<t9anE-6yu-9@gated-at.bofh.it>
In reply to#1575995
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:

> kprobe_exceptions_notify() is not used on some of the architectures such
> as arm[64] and powerpc anymore. Introduce a weak variant for such
> architectures.

I'll merge patch 1 & 3 via the powerpc tree for v4.11.

You can then send patch 2 to the arm guys after -rc1, or for 4.12.

cheers

[toc] | [prev] | [next] | [standalone]


#1578244 — Re: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

FromIngo Molnar <mingo@kernel.org>
Date2017-02-10 09:00 +0100
SubjectRe: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify
Message-ID<t9ehA-xE-17@gated-at.bofh.it>
In reply to#1578164
* Michael Ellerman <mpe@ellerman.id.au> wrote:

> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
> 
> > kprobe_exceptions_notify() is not used on some of the architectures such
> > as arm[64] and powerpc anymore. Introduce a weak variant for such
> > architectures.
> 
> I'll merge patch 1 & 3 via the powerpc tree for v4.11.

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

[toc] | [prev] | [next] | [standalone]


#1579524 — Re: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-02-13 09:40 +0100
SubjectRe: [PATCH 1/3] kprobes: introduce weak variant of kprobe_exceptions_notify
Message-ID<takkW-1fk-11@gated-at.bofh.it>
In reply to#1578164
On 2017/02/10 02:41PM, Michael Ellerman wrote:
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> writes:
> 
> > kprobe_exceptions_notify() is not used on some of the architectures such
> > as arm[64] and powerpc anymore. Introduce a weak variant for such
> > architectures.
> 
> I'll merge patch 1 & 3 via the powerpc tree for v4.11.
> 
> You can then send patch 2 to the arm guys after -rc1, or for 4.12.

Sure, thanks!

- Naveen

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web