linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] kprobes: Remove MODULE dependency
@ 2020-07-14  9:45 Jarkko Sakkinen
  2020-07-14  9:45 ` [PATCH v2 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper Jarkko Sakkinen
  0 siblings, 1 reply; 25+ messages in thread
From: Jarkko Sakkinen @ 2020-07-14  9:45 UTC (permalink / raw)
  To: linux-kernel
  Cc: Catalin Marinas, Song Liu, Paul Mackerras, Zong Li, Paul Burton,
	Aneesh Kumar K.V, Vincent Whitchurch, Benjamin Herrenschmidt,
	Omar Sandoval, Petr Mladek, Brian Gerst, Andy Lutomirski,
	Thomas Gleixner, Iurii Zaikin, Jiri Kosina, Anup Patel,
	Philipp Rudo, Vincent Chen, Torsten Duwe, Masami Hiramatsu,
	Andrew Morton, Mark Rutland, Ingo Molnar, open list:S390,
	Joe Lawrence, Alexandre Ghiti, Helge Deller, John Fastabend,
	Yonghong Song, Borislav Petkov, Andrii Nakryiko, Vasily Gorbik,
	moderated list:ARM PORT, Daniel Axtens, Damien Le Moal,
	Stephen Boyd, Sean Christopherson, Martin KaFai Lau, Kefeng Wang,
	Palmer Dabbelt, Heiko Carstens, Jarkko Sakkinen, Atish Patra,
	Will Deacon, Masahiro Yamada, Nayna Jain, Krzysztof Kozlowski,
	Christian Borntraeger, Sami Tolvanen, Mao Han, Marco Elver,
	Kees Cook, Arnd Bergmann, Steven Rostedt (VMware),
	Babu Moger, Russell King, Ben Dooks, Peter Collingbourne,
	Tiezhu Yang, Thomas Bogendoerfer, open list:PARISC ARCHITECTURE,
	Jessica Yu, open list:BPF JIT for MIPS 32-BIT AND 64-BIT,
	Thiago Jung Bauermann, Peter Zijlstra,
	open list:SPARC + UltraSPARC sparc/sparc64, H. Peter Anvin,
	Amit Daniel Kachhap, open list:LIVE PATCHING,
	open list:RISC-V ARCHITECTURE, Miroslav Benes, Jiri Olsa,
	Ard Biesheuvel, Vincenzo Frascino, Anders Roxell, Sven Schnelle,
	Mike Rapoport, Paul E. McKenney, Frederic Weisbecker,
	Paul Walmsley, KP Singh, Gerald Schaefer, Josh Poimboeuf,
	open list:BPF JIT for MIPS 32-BIT AND 64-BIT, open list:MIPS,
	Sergey Senozhatsky,
	open list:LINUX FOR POWERPC 32-BIT AND 64-BIT

Remove MODULES dependency by creating module subsystem indepdent
text_alloc() and text_memfree() to allocate space for executable code.

Right now one has to compile modules support only to enable kprobes. This
incrases the barrier to use them in test kernels and I'd guess also in some
embedded kernels (the former is my use case).

v2:
* Added the missing cover letter.

Jarkko Sakkinen (3):
  module: Rename module_alloc() to text_alloc() and move to kernel
    proper
  module: Add lock_modules() and unlock_modules()
  kprobes: Flag out CONFIG_MODULES dependent code

 arch/Kconfig                     |  1 -
 arch/arm/kernel/Makefile         |  3 +-
 arch/arm/kernel/module.c         | 21 -------
 arch/arm/kernel/text.c           | 33 +++++++++++
 arch/arm64/kernel/Makefile       |  2 +-
 arch/arm64/kernel/module.c       | 42 --------------
 arch/arm64/kernel/text.c         | 54 ++++++++++++++++++
 arch/mips/kernel/Makefile        |  2 +-
 arch/mips/kernel/module.c        |  9 ---
 arch/mips/kernel/text.c          | 19 +++++++
 arch/mips/net/bpf_jit.c          |  4 +-
 arch/nds32/kernel/Makefile       |  2 +-
 arch/nds32/kernel/module.c       |  7 ---
 arch/nds32/kernel/text.c         | 12 ++++
 arch/nios2/kernel/Makefile       |  1 +
 arch/nios2/kernel/module.c       | 19 -------
 arch/nios2/kernel/text.c         | 34 +++++++++++
 arch/parisc/kernel/Makefile      |  2 +-
 arch/parisc/kernel/module.c      | 11 ----
 arch/parisc/kernel/text.c        | 22 ++++++++
 arch/powerpc/net/bpf_jit_comp.c  |  4 +-
 arch/riscv/kernel/Makefile       |  1 +
 arch/riscv/kernel/module.c       | 12 ----
 arch/riscv/kernel/text.c         | 20 +++++++
 arch/s390/kernel/Makefile        |  2 +-
 arch/s390/kernel/ftrace.c        |  2 +-
 arch/s390/kernel/module.c        | 16 ------
 arch/s390/kernel/text.c          | 23 ++++++++
 arch/sparc/kernel/Makefile       |  1 +
 arch/sparc/kernel/module.c       | 30 ----------
 arch/sparc/kernel/text.c         | 39 +++++++++++++
 arch/sparc/net/bpf_jit_comp_32.c |  6 +-
 arch/unicore32/kernel/Makefile   |  1 +
 arch/unicore32/kernel/module.c   |  7 ---
 arch/unicore32/kernel/text.c     | 18 ++++++
 arch/x86/kernel/Makefile         |  1 +
 arch/x86/kernel/ftrace.c         |  4 +-
 arch/x86/kernel/kprobes/core.c   |  4 +-
 arch/x86/kernel/module.c         | 49 ----------------
 arch/x86/kernel/text.c           | 60 ++++++++++++++++++++
 include/linux/module.h           | 29 +++++++---
 include/linux/moduleloader.h     |  4 +-
 kernel/Makefile                  |  2 +-
 kernel/bpf/core.c                |  4 +-
 kernel/kprobes.c                 | 17 ++++--
 kernel/livepatch/core.c          |  8 +--
 kernel/module.c                  | 97 +++++++++++++-------------------
 kernel/text.c                    | 25 ++++++++
 kernel/trace/trace_kprobe.c      | 20 ++++++-
 49 files changed, 484 insertions(+), 322 deletions(-)
 create mode 100644 arch/arm/kernel/text.c
 create mode 100644 arch/arm64/kernel/text.c
 create mode 100644 arch/mips/kernel/text.c
 create mode 100644 arch/nds32/kernel/text.c
 create mode 100644 arch/nios2/kernel/text.c
 create mode 100644 arch/parisc/kernel/text.c
 create mode 100644 arch/riscv/kernel/text.c
 create mode 100644 arch/s390/kernel/text.c
 create mode 100644 arch/sparc/kernel/text.c
 create mode 100644 arch/unicore32/kernel/text.c
 create mode 100644 arch/x86/kernel/text.c
 create mode 100644 kernel/text.c

-- 
2.25.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2020-09-17 15:23 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14  9:45 [PATCH v2 0/3] kprobes: Remove MODULE dependency Jarkko Sakkinen
2020-07-14  9:45 ` [PATCH v2 1/3] module: Rename module_alloc() to text_alloc() and move to kernel proper Jarkko Sakkinen
2020-07-14  9:50   ` Russell King - ARM Linux admin
2020-07-14 10:28   ` Will Deacon
2020-07-14 11:29     ` Peter Zijlstra
2020-07-14 12:19       ` Ard Biesheuvel
2020-07-14 13:01         ` Peter Zijlstra
2020-07-14 13:33           ` Mark Rutland
2020-07-14 13:47             ` Ard Biesheuvel
2020-07-14 14:03             ` Steven Rostedt
2020-07-15  5:03               ` Masami Hiramatsu
2020-07-14 16:31           ` Jarkko Sakkinen
2020-07-14 16:46             ` Peter Zijlstra
2020-07-15  8:15             ` David Laight
2020-07-14 16:42           ` Russell King - ARM Linux admin
2020-07-14 12:25       ` Jarkko Sakkinen
2020-07-14 13:56   ` Jessica Yu
2020-07-14 15:44     ` Steven Rostedt
2020-07-14 16:37     ` Jarkko Sakkinen
2020-07-16 16:49   ` Christophe Leroy
2020-07-23  1:51     ` Jarkko Sakkinen
2020-07-23 12:42       ` Ard Biesheuvel
2020-07-24  7:36         ` Jarkko Sakkinen
2020-07-24  8:05           ` Jessica Yu
2020-07-24 15:46             ` Jarkko Sakkinen

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).