bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v9 00/13] unwind_user: x86: Deferred unwinding infrastructure
@ 2025-05-13 22:34 Steven Rostedt
  2025-05-13 22:34 ` [PATCH v9 01/13] unwind_user: Add user space unwinding API Steven Rostedt
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Steven Rostedt @ 2025-05-13 22:34 UTC (permalink / raw)
  To: linux-kernel, linux-trace-kernel, bpf, x86
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Josh Poimboeuf,
	Peter Zijlstra, Ingo Molnar, Jiri Olsa, Namhyung Kim,
	Thomas Gleixner, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	Andrii Nakryiko


This series does not make any user space visible changes.
It only adds the necessary infrastructure of the deferred unwinder.

 Based off of tip/master: d60119b82d8871c66563f8657bb3e550a80234de

This has modifications in x86 and I would like it to go through the x86
tree. Preferably it can go into this merge window so we can focus on getting
perf and ftrace to work on top of this.

Perf exposes a lot of the interface to user space as the perf tool needs
to handle the merging of the stacks, I figured it would be better to just
get the kernel side mostly done and then work out the kinks of the code
between user and kernel.

As there is no exposure to user space at this time, if something is found
wrong with it it can be fixed without worrying about breaking API.

I ran all these patches through my tests and they passed
(had to add the fix for the CONFIG_MODULE in tip/master:
 https://lore.kernel.org/all/20250513025839.495755-1-ebiggers@kernel.org/)

Changes since v8: https://lore.kernel.org/all/20250509164524.448387100@goodmis.org/

- The patches posted here have not been updated since v8.

- Removed updates to perf proper

  This is only to create the unwind infrastructure so that perf and
  ftrace can be worked on simultaneously without dependencies for
  each.

- Discussion about using guard for SRCU

   Andrii Nakryiko brought up using guard for SRCU around the
   list iteration, but it was decided that just using the normal
   methods were fine for this use case.


Josh Poimboeuf (9):
      unwind_user: Add user space unwinding API
      unwind_user: Add frame pointer support
      unwind_user/x86: Enable frame pointer unwinding on x86
      perf/x86: Rename and move get_segment_base() and make it global
      unwind_user: Add compat mode frame pointer support
      unwind_user/x86: Enable compat mode frame pointer unwinding on x86
      unwind_user/deferred: Add unwind cache
      unwind_user/deferred: Add deferred unwinding interface
      unwind_user/deferred: Make unwind deferral requests NMI-safe

Steven Rostedt (4):
      unwind_user/deferred: Add unwind_deferred_trace()
      unwind deferred: Use bitmask to determine which callbacks to call
      unwind deferred: Use SRCU unwind_deferred_task_work()
      unwind: Clear unwind_mask on exit back to user space

----
 MAINTAINERS                              |   8 +
 arch/Kconfig                             |  11 +
 arch/x86/Kconfig                         |   2 +
 arch/x86/events/core.c                   |  44 +---
 arch/x86/include/asm/ptrace.h            |   2 +
 arch/x86/include/asm/unwind_user.h       |  61 +++++
 arch/x86/include/asm/unwind_user_types.h |  17 ++
 arch/x86/kernel/ptrace.c                 |  38 ++++
 include/asm-generic/Kbuild               |   2 +
 include/asm-generic/unwind_user.h        |  24 ++
 include/asm-generic/unwind_user_types.h  |   9 +
 include/linux/entry-common.h             |   2 +
 include/linux/sched.h                    |   6 +
 include/linux/unwind_deferred.h          |  72 ++++++
 include/linux/unwind_deferred_types.h    |  17 ++
 include/linux/unwind_user.h              |  15 ++
 include/linux/unwind_user_types.h        |  35 +++
 kernel/Makefile                          |   1 +
 kernel/fork.c                            |   4 +
 kernel/unwind/Makefile                   |   1 +
 kernel/unwind/deferred.c                 | 367 +++++++++++++++++++++++++++++++
 kernel/unwind/user.c                     | 130 +++++++++++
 22 files changed, 829 insertions(+), 39 deletions(-)
 create mode 100644 arch/x86/include/asm/unwind_user.h
 create mode 100644 arch/x86/include/asm/unwind_user_types.h
 create mode 100644 include/asm-generic/unwind_user.h
 create mode 100644 include/asm-generic/unwind_user_types.h
 create mode 100644 include/linux/unwind_deferred.h
 create mode 100644 include/linux/unwind_deferred_types.h
 create mode 100644 include/linux/unwind_user.h
 create mode 100644 include/linux/unwind_user_types.h
 create mode 100644 kernel/unwind/Makefile
 create mode 100644 kernel/unwind/deferred.c
 create mode 100644 kernel/unwind/user.c

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

end of thread, other threads:[~2025-05-21 16:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13 22:34 [PATCH v9 00/13] unwind_user: x86: Deferred unwinding infrastructure Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 01/13] unwind_user: Add user space unwinding API Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 02/13] unwind_user: Add frame pointer support Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 03/13] unwind_user/x86: Enable frame pointer unwinding on x86 Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 04/13] perf/x86: Rename and move get_segment_base() and make it global Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 05/13] unwind_user: Add compat mode frame pointer support Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 06/13] unwind_user/x86: Enable compat mode frame pointer unwinding on x86 Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 07/13] unwind_user/deferred: Add unwind_deferred_trace() Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 08/13] unwind_user/deferred: Add unwind cache Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 09/13] unwind_user/deferred: Add deferred unwinding interface Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 10/13] unwind_user/deferred: Make unwind deferral requests NMI-safe Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 11/13] unwind deferred: Use bitmask to determine which callbacks to call Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 12/13] unwind deferred: Use SRCU unwind_deferred_task_work() Steven Rostedt
2025-05-13 22:34 ` [PATCH v9 13/13] unwind: Clear unwind_mask on exit back to user space Steven Rostedt
2025-05-14 17:27 ` [PATCH v9 00/13] unwind_user: x86: Deferred unwinding infrastructure Steven Rostedt
2025-05-16 23:39   ` Namhyung Kim
2025-05-19 15:33     ` Steven Rostedt
2025-05-20  9:35       ` Ingo Molnar
2025-05-20 15:57         ` Steven Rostedt
2025-05-20 16:29           ` Steven Rostedt
2025-05-20 23:26     ` Masami Hiramatsu
2025-05-20 23:55       ` Steven Rostedt
2025-05-21 16:50         ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).