mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 00/10] s390: Consistent usage of text_mutex
@ 2026-10-27 14:30 Heiko Carstens
  2026-10-27 14:30 ` [PATCH v2 01/10] s390/jump_label: Serialize text patching with text_mutex Heiko Carstens
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Heiko Carstens @ 2026-10-27 14:30 UTC (permalink / raw)
  To: Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger, Ilya Leoshkevich
  Cc: linux-kernel, linux-s390

v2:
- Use text mutex for all callers of s390_kernel_write(), and add lockdep
  checking. [Based on a review comment from Ilya Leoshkevich, and also
  Sashiko feedback]

- Note: this takes now the mutex also at places where it is technically
  not necessary (e.g. ftrace init nop patching). However this is not much
  of a difference to before, where the spinlock in s390_kernel_write()
  was always taken instead

v1:
Other architectures serialize kernel text patching with text_mutex. s390
does not: __s390_kernel_write() relies on a private spinlock, and callers
partially depend on implicit exclusion (e.g. no kprobe can be set on a
jump label).

Make s390 consistent with other architectures:

- Patches 1-3 add text_mutex to the jump_label, ftrace and bpf text
  patching paths

- Patch 4 removes the redundant spinlock from __s390_kernel_write().
  CPU serialization, previously done implicitly, is now explicit via
  sync_core()

Thanks,
Heiko

Heiko Carstens (10):
  s390/jump_label: Serialize text patching with text_mutex
  s390/ftrace: Serialize text patching with text_mutex
  s390/bpf: Serialize text patching with text_mutex
  s390/runtime-const: Serialize text patching with text_mutex
  s390/module: Serialize text patching with text_mutex
  s390/stackprotector: Serialize text patching with text_mutex
  s390/nospec-branch: Serialize text patching with text_mutex
  s390/alternative: Serialize text patching with text_mutex
  s390/uaccess: Move s390_kernel_write() to asm/text-patching.h
  s390/maccess: Remove spinlock from __s390_kernel_write()

 arch/s390/include/asm/runtime-const.h |  4 +++-
 arch/s390/include/asm/text-patching.h | 14 ++++++++++++++
 arch/s390/include/asm/uaccess.h       |  9 ---------
 arch/s390/kernel/alternative.c        |  6 +++++-
 arch/s390/kernel/ftrace.c             | 11 +++++++++++
 arch/s390/kernel/jump_label.c         |  3 ++-
 arch/s390/kernel/kprobes.c            |  4 +++-
 arch/s390/kernel/module.c             |  2 ++
 arch/s390/kernel/nospec-branch.c      |  4 ++++
 arch/s390/kernel/stackprotector.c     |  6 +++++-
 arch/s390/mm/maccess.c                |  9 ++++-----
 arch/s390/net/bpf_jit_comp.c          | 21 +++++++++++++++++----
 12 files changed, 70 insertions(+), 23 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-10-28 13:44 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 14:30 [PATCH v2 00/10] s390: Consistent usage of text_mutex Heiko Carstens
2026-10-27 14:30 ` [PATCH v2 01/10] s390/jump_label: Serialize text patching with text_mutex Heiko Carstens
2026-10-28 10:50   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 02/10] s390/ftrace: " Heiko Carstens
2026-10-28 10:54   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 03/10] s390/bpf: " Heiko Carstens
2026-10-28 10:56   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 04/10] s390/runtime-const: " Heiko Carstens
2026-10-28 10:58   ` Ilya Leoshkevich
2026-10-28 11:09     ` Heiko Carstens
2026-10-28 12:22       ` Ilya Leoshkevich
2026-10-28 13:43         ` Heiko Carstens
2026-10-27 14:30 ` [PATCH v2 05/10] s390/module: " Heiko Carstens
2026-10-28 10:59   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 06/10] s390/stackprotector: " Heiko Carstens
2026-10-28 12:23   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 07/10] s390/nospec-branch: " Heiko Carstens
2026-10-28 12:24   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 08/10] s390/alternative: " Heiko Carstens
2026-10-28 12:25   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 09/10] s390/uaccess: Move s390_kernel_write() to asm/text-patching.h Heiko Carstens
2026-10-28 12:26   ` Ilya Leoshkevich
2026-10-27 14:30 ` [PATCH v2 10/10] s390/maccess: Remove spinlock from __s390_kernel_write() Heiko Carstens

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

all inboxes | Powered by JetHome®