From: Catalin Marinas <catalin.marinas@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [for-next][PATCH 12/16] kprobes: Initialize kprobes at postcore_initcall
Date: Wed, 3 Jul 2019 14:50:38 +0100 [thread overview]
Message-ID: <20190703135037.GC48312@arrakis.emea.arm.com> (raw)
In-Reply-To: <20190702165008.GC34718@lakrids.cambridge.arm.com>
On Tue, Jul 02, 2019 at 05:50:09PM +0100, Mark Rutland wrote:
> On Sun, May 26, 2019 at 03:18:40PM -0400, Steven Rostedt wrote:
> > From: Masami Hiramatsu <mhiramat@kernel.org>
> >
> > Initialize kprobes at postcore_initcall level instead of module_init
> > since kprobes is not a module, and it depends on only subsystems
> > initialized in core_initcall.
> > This will allow ftrace kprobe event to add new events when it is
> > initializing because ftrace kprobe event is initialized at
> > later initcall level.
> >
> > Link: http://lkml.kernel.org/r/155851394736.15728.13626739508905120098.stgit@devnote2
> >
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > ---
> > kernel/kprobes.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> > index b1ea30a5540e..54aaaad00a47 100644
> > --- a/kernel/kprobes.c
> > +++ b/kernel/kprobes.c
> > @@ -2289,6 +2289,7 @@ static int __init init_kprobes(void)
> > init_test_probes();
> > return err;
> > }
> > +postcore_initcall(init_kprobes);
>
> As a heads-up, this is causing boot-time failures on arm64.
>
> On arm64 kprobes depends on the BRK handler we register in
> debug_traps_init(), which is an arch_initcall.
>
> As of this change, init_krprobes() calls init_test_probes() before
> that's registered, so we end up hitting a BRK before we can handle it.
Thanks Mark for identifying this.
So we either revert the above commit in -next or queue the one below
together with the rest of the kprobes changes (I can queue it via the
arm64 for-next/core assuming that the above commit id remains stable):
--------------8<------------------------------------
From de4f4d30bab3d77d6643a6fa9ba1deff73dac7f2 Mon Sep 17 00:00:00 2001
From: Catalin Marinas <catalin.marinas@arm.com>
Date: Wed, 3 Jul 2019 14:44:23 +0100
Subject: [PATCH] arm64: Initialise the debug traps earlier
Commit b5f8b32c93b2 ("kprobes: Initialize kprobes at postcore_initcall")
makes init_kprobes() a postcore_initcall while the arm64 handling of the
BRK instruction is initialised at arch_initcall level. Make the arm64
debug_traps_init() a core_initcall.
Fixes: b5f8b32c93b2 ("kprobes: Initialize kprobes at postcore_initcall")
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm64/kernel/debug-monitors.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index f8719bd30850..81770105cd8e 100644
--- a/arch/arm64/kernel/debug-monitors.c
+++ b/arch/arm64/kernel/debug-monitors.c
@@ -382,7 +382,7 @@ static int __init debug_traps_init(void)
TRAP_BRKPT, "ptrace BRK handler");
return 0;
}
-arch_initcall(debug_traps_init);
+core_initcall(debug_traps_init);
/* Re-enable single step for syscall restarting. */
void user_rewind_single_step(struct task_struct *task)
next prev parent reply other threads:[~2019-07-03 13:50 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-26 19:18 [for-next][PATCH 00/16] tracing: Updates for the next merge window Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 01/16] ftrace: Make enable and update parameters bool when applicable Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 02/16] x86/ftrace: Make enable parameter bool where applicable Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 03/16] x86/uaccess: Allow access_ok() in irq context if pagefault_disabled Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 04/16] uaccess: Add non-pagefault user-space read functions Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 05/16] tracing/probe: Add ustring type for user-space string Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 06/16] tracing/probe: Support user-space dereference Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 07/16] selftests/ftrace: Add user-memory access syntax testcase Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 08/16] perf-probe: Add user memory access attribute support Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 09/16] tracing: Use correct function name in trace_filter_add_remove_task() comment Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 10/16] uaccess: Add a prototype of non-static __probe_user_read() Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 11/16] tracing/kprobe: Cast user-space address correctly Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 12/16] kprobes: Initialize kprobes at postcore_initcall Steven Rostedt
2019-07-02 16:50 ` Mark Rutland
2019-07-03 13:50 ` Catalin Marinas [this message]
2019-07-03 14:02 ` Steven Rostedt
2019-07-03 14:08 ` Catalin Marinas
2019-07-03 14:24 ` Steven Rostedt
2019-07-03 14:25 ` Steven Rostedt
2019-07-03 14:37 ` Steven Rostedt
2019-07-09 12:51 ` Masami Hiramatsu
2019-07-09 15:18 ` Steven Rostedt
2019-07-09 15:15 ` Steven Rostedt
2019-07-22 12:42 ` Catalin Marinas
2019-07-22 15:00 ` Steven Rostedt
2019-07-22 16:01 ` Catalin Marinas
2019-07-09 12:30 ` Masami Hiramatsu
2019-07-22 12:34 ` Catalin Marinas
2019-05-26 19:18 ` [for-next][PATCH 13/16] tracing/kprobe: Add kprobe_event= boot parameter Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 14/16] tracing: Make a separate config for trace event self tests Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 15/16] tracing/kprobe: Do not run kprobe boot tests if kprobe_event is on cmdline Steven Rostedt
2019-05-26 19:18 ` [for-next][PATCH 16/16] ftrace: Enable trampoline when rec count returns back to one Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190703135037.GC48312@arrakis.emea.arm.com \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox