From: Jean-Philippe Brucker <jean-philippe@linaro.org>
To: Will Deacon <will@kernel.org>
Cc: catalin.marinas@arm.com, mhiramat@kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64: kprobes: Use BRK instead of single-step when executing instructions out-of-line
Date: Fri, 30 Oct 2020 17:13:08 +0100 [thread overview]
Message-ID: <20201030161308.GD294997@myrica> (raw)
In-Reply-To: <20201030160623.GA32582@willie-the-truck>
On Fri, Oct 30, 2020 at 04:06:24PM +0000, Will Deacon wrote:
> On Thu, Oct 29, 2020 at 06:34:42PM +0100, Jean-Philippe Brucker wrote:
> > Commit 36dadef23fcc ("kprobes: Init kprobes in early_initcall") enabled
> > using kprobes from early_initcall. Unfortunately at this point the
> > hardware debug infrastructure is not operational. The OS lock may still
> > be locked, and the hardware watchpoints may have unknown values when
> > kprobe enables debug monitors to single-step instructions.
> >
> > Rather than using hardware single-step, append a BRK instruction after
> > the instruction to be executed out-of-line.
> >
> > Fixes: 36dadef23fcc ("kprobes: Init kprobes in early_initcall")
> > Suggested-by: Will Deacon <will@kernel.org>
> > Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
> > ---
> >
> > An alternative to fix [1]. I haven't done uprobes yet since they don't
> > suffer the same problem, but could add it to the bottom of my list.
> > Lightly tested with kprobe smoke test and the BPF selftests.
> > Interestingly on Seattle when running the "overhead" BPF selftest, that
> > triggers a kprobe a bunch of times, I see a 20-30% improvement with this
> > patch. I'm guessing it's the cost of touching the debug sysregs?
> >
> > [1] https://lore.kernel.org/linux-arm-kernel/20201026172907.1468294-1-jean-philippe@linaro.org/
> > ---
> > arch/arm64/include/asm/brk-imm.h | 2 +
> > arch/arm64/include/asm/debug-monitors.h | 1 +
> > arch/arm64/include/asm/kprobes.h | 2 +-
> > arch/arm64/kernel/probes/kprobes.c | 56 +++++++++----------------
> > 4 files changed, 24 insertions(+), 37 deletions(-)
>
> Thanks! I'm about to send fixes for -rc2, but I'd like this to get a little
> bit of time in linux-next, so I aim to queue it next week for -rc3. Just
> wanted to make sure you don't think I'm ignored you.
No worries, I'm more confortable having this sit in linux-next
Thanks,
Jean
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-10-30 16:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 17:34 [PATCH] arm64: kprobes: Use BRK instead of single-step when executing instructions out-of-line Jean-Philippe Brucker
2020-10-29 23:34 ` Masami Hiramatsu
2020-10-30 1:13 ` [PATCH] arm64: kprobes: Remove redundant kprobe_step_ctx Masami Hiramatsu
2020-10-30 8:27 ` Jean-Philippe Brucker
2020-10-30 16:06 ` [PATCH] arm64: kprobes: Use BRK instead of single-step when executing instructions out-of-line Will Deacon
2020-10-30 16:13 ` Jean-Philippe Brucker [this message]
2020-11-02 11:41 ` Will Deacon
2020-11-02 13:52 ` Masami Hiramatsu
2020-11-03 9:13 ` Jean-Philippe Brucker
2020-11-03 9:23 ` Will Deacon
2020-11-17 17:28 ` Jean-Philippe Brucker
2020-11-24 2:34 ` Masami Hiramatsu
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=20201030161308.GD294997@myrica \
--to=jean-philippe@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mhiramat@kernel.org \
--cc=will@kernel.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