public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/14] kprobes: Unify kretprobe trampoline handlers
@ 2020-08-26 13:46 Masami Hiramatsu
  2020-08-26 13:46 ` [RFC PATCH 01/14] kprobes: Add generic kretprobe trampoline handler Masami Hiramatsu
                   ` (13 more replies)
  0 siblings, 14 replies; 19+ messages in thread
From: Masami Hiramatsu @ 2020-08-26 13:46 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Eddy Wu, linux-kernel, x86, David S . Miller, Steven Rostedt,
	Ingo Molnar, Naveen N . Rao, Anil S Keshavamurthy, linux-arch

Hi Peter,

Here is the series of patches to unify the kretprobe trampoline handler
implementation across all architectures which are currently kprobes supported.
Also, this finally removes the in_nmi() check from pre_kretprobe_handler()
since we can avoid double-lock deadlock from NMI by kprobe_busy_begin/end().

The unified generic kretprobe trampoline handler is based on x86 code, which
already support frame-pointer checker. I've enabled it on the arm and
arm64 which I can test. For other architecutres, currently the frame-pointer
checker does not work. If someone wants to enable it, please set the correct
frame pointer to ri->fp and pass it to kretprobe_trampoline_handler() as the
3rd parameter, instead of NULL.

Peter's lockless patch is not included yet because there seems more isses
to be solved. It seems that the cleanup_rp_inst() will be the biggest piece
of this pazzle.


Thank you,

---

Masami Hiramatsu (14):
      kprobes: Add generic kretprobe trampoline handler
      x86/kprobes: Use generic kretprobe trampoline handler
      arm: kprobes: Use generic kretprobe trampoline handler
      arm64: kprobes: Use generic kretprobe trampoline handler
      arc: kprobes: Use generic kretprobe trampoline handler
      csky: kprobes: Use generic kretprobe trampoline handler
      ia64: kprobes: Use generic kretprobe trampoline handler
      mips: kprobes: Use generic kretprobe trampoline handler
      parisc: kprobes: Use generic kretprobe trampoline handler
      powerpc: kprobes: Use generic kretprobe trampoline handler
      s390: kprobes: Use generic kretprobe trampoline handler
      sh: kprobes: Use generic kretprobe trampoline handler
      sparc: kprobes: Use generic kretprobe trampoline handler
      kprobes: Remove NMI context check


 arch/arc/kernel/kprobes.c          |   55 +----------------
 arch/arm/probes/kprobes/core.c     |   79 +-----------------------
 arch/arm64/kernel/probes/kprobes.c |   79 +-----------------------
 arch/csky/kernel/probes/kprobes.c  |   78 +-----------------------
 arch/ia64/kernel/kprobes.c         |   79 +-----------------------
 arch/mips/kernel/kprobes.c         |   55 +----------------
 arch/parisc/kernel/kprobes.c       |   78 ++----------------------
 arch/powerpc/kernel/kprobes.c      |   55 ++---------------
 arch/s390/kernel/kprobes.c         |   81 +------------------------
 arch/sh/kernel/kprobes.c           |   59 +-----------------
 arch/sparc/kernel/kprobes.c        |   52 +---------------
 arch/x86/kernel/kprobes/core.c     |  109 +---------------------------------
 include/linux/kprobes.h            |   32 +++++++++-
 kernel/kprobes.c                   |  117 ++++++++++++++++++++++++++++++++----
 14 files changed, 182 insertions(+), 826 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

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

end of thread, other threads:[~2020-08-26 15:26 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-26 13:46 [RFC PATCH 00/14] kprobes: Unify kretprobe trampoline handlers Masami Hiramatsu
2020-08-26 13:46 ` [RFC PATCH 01/14] kprobes: Add generic kretprobe trampoline handler Masami Hiramatsu
2020-08-26 13:46 ` [RFC PATCH 02/14] x86/kprobes: Use " Masami Hiramatsu
2020-08-26 13:46 ` [RFC PATCH 03/14] arm: kprobes: " Masami Hiramatsu
2020-08-26 14:08   ` peterz
2020-08-26 14:10     ` peterz
2020-08-26 15:04       ` Masami Hiramatsu
2020-08-26 15:26         ` peterz
2020-08-26 13:46 ` [RFC PATCH 04/14] arm64: " Masami Hiramatsu
2020-08-26 13:47 ` [RFC PATCH 05/14] arc: " Masami Hiramatsu
2020-08-26 13:47 ` [RFC PATCH 06/14] csky: " Masami Hiramatsu
2020-08-26 13:47 ` [RFC PATCH 07/14] ia64: " Masami Hiramatsu
2020-08-26 13:47 ` [RFC PATCH 08/14] mips: " Masami Hiramatsu
2020-08-26 13:47 ` [RFC PATCH 09/14] parisc: " Masami Hiramatsu
2020-08-26 13:47 ` [RFC PATCH 10/14] powerpc: " Masami Hiramatsu
2020-08-26 13:48 ` [RFC PATCH 11/14] s390: " Masami Hiramatsu
2020-08-26 13:48 ` [RFC PATCH 12/14] sh: " Masami Hiramatsu
2020-08-26 13:48 ` [RFC PATCH 13/14] sparc: " Masami Hiramatsu
2020-08-26 13:48 ` [RFC PATCH 14/14] kprobes: Remove NMI context check Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox