Skip to content

arch/x86: kprobes: Remove MODULES dependency

Jarkko Sakkinen linux-arch linux-mm lkml 6 versions – Applied

Status from this message: The following commit has been merged into the perf/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest posting 2/26 patches 38 repliesApplied
  2. v5 posting 1/23 of 6 patches 0 repliesSuperseded
  3. v47 patches 9 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches13 repliesSuperseded
v23 patches23 repliesSuperseded
v13 patches13 repliesSuperseded

v4 from the cover letter

* Squash lock_modules() patches into one.
* Remove fallback versions of text_alloc() and text_free(). Instead, use ARCH_HAS_TEXT_ALLOC at site when required.
* Use lockdep_assert_irqs_enabled() in text_free() instead of WARN_ON(in_interrupt()).

Patches in v5 posting 2/2 Applied

#Subject and filesSizeRepliesApplied
1/6kprobes: Remove dependency to the module_mutexinclude/linux/module.h kernel/kprobes.c kernel/trace/trace_kprobe.c+22 -411 replies
2/6vmalloc: Add text_alloc() and text_free()include/linux/vmalloc.h+17 -02 replies
3/6arch/x86: Implement text_alloc() and text_free()arch/x86/Kconfig arch/x86/kernel/Makefile arch/x86/kernel/text_alloc.c+45 -02 replies
4/6arch/x86: kprobes: Use text_alloc() and text_free()arch/x86/kernel/kprobes/core.c+2 -20 replies
5/6kprobes: Use text_alloc() and text_free()kernel/kprobes.c+9 -021 replies
6/6kprobes: Remove CONFIG_MODULES dependencyarch/Kconfig include/linux/module.h kernel/kprobes.c +1 more+52 -280 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/6] arch/x86: kprobes: Remove MODULES dependency

Remove MODULES dependency by migrating from module_alloc() to the new text_alloc() API. Essentially these changes provide preliminaries for allowing to compile a static kernel with a proper tracing support.

The same API can be used later on in other sites that allocate space for trampolines, and trivially scaled to other arch's. An arch can inform with CONFIG_ARCH_HAS_TEXT_ALLOC that it's providing implementation for text_alloc().

Cc Andi Kleen <[email protected]>
Cc Masami Hiramatsu <[email protected]>
Cc Peter Zijlstra <[email protected]>

v4:
* Squash lock_modules() patches into one.
* Remove fallback versions of text_alloc() and text_free(). Instead, use ARCH_HAS_TEXT_ALLOC at site when required.
* Use lockdep_assert_irqs_enabled() in text_free() instead of WARN_ON(in_interrupt()).

v3:
* Make text_alloc() API disjoint.
* Remove all the possible extra clutter not absolutely required and split into more logical pieces.

Jarkko Sakkinen (6):
kprobes: Remove dependency to the module_mutex
vmalloc: Add text_alloc() and text_free() arch/x86: Implement text_alloc() and text_free() arch/x86: kprobes: Use text_alloc() and text_free()
kprobes: Use text_alloc() and text_free()
kprobes: Remove CONFIG_MODULES dependency

 arch/Kconfig                   |  2 +-
 arch/x86/Kconfig               |  3 ++
 arch/x86/kernel/Makefile       |  1 +
 arch/x86/kernel/kprobes/core.c |  4 +--
 arch/x86/kernel/text_alloc.c   | 41 +++++++++++++++++++++++
 include/linux/module.h         | 32 ++++++++++++++----
 include/linux/vmalloc.h        | 17 ++++++++++
 kernel/kprobes.c               | 61 +++++++++++++++++++++++-----------
 kernel/trace/trace_kprobe.c    | 20 ++++++++---
 9 files changed, 147 insertions(+), 34 deletions(-)
 create mode 100644 arch/x86/kernel/text_alloc.c
Signature · 1 line
2.25.1