mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 00/11] s390: More this_cpu_*() changes
@ 2026-09-21  8:39 Heiko Carstens
  2026-09-21  8:39 ` [PATCH v3 01/11] s390/percpu: Fix comment typo Heiko Carstens
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Heiko Carstens @ 2026-09-21  8:39 UTC (permalink / raw)
  To: Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger, Mete Durlu, Peter Zijlstra, Mark Rutland,
	Juergen Christ, Ilya Leoshkevich
  Cc: linux-kernel, linux-s390

v3:
- Add various sanity checks to enforce correct register usage
  [Mark Rutland]

- Use %N instead of %M operand modifier to access odd register of a
  register pair in inline assemblies. Strictly speaking this is not
  correct, since %N is supposed to be used for DImode operands and %M for
  TImode operands. However both gcc and clang handle them identical, and
  there is an existing user of %N in the kernel since many years.
  Therefore use %N to get rid of the not yet released clang 24
  dependency. [Christian Borntraeger]

- Use la (load address) instruction with base and index register to
  generate a CPUs percpu variable address instead of agkr. la is
  available for all architecture levels. This removes the z196
  dependency as minimum architecture level. [Christian Borntraeger]

- Change coding style at some places, and fix various typos in commit
  messages and comments.

- Fix compile error caused by missing semicolon.

v2:
- Yet another brown paper bug: Re-add CPU migration check to last
  patch. Unconditionally recalculating and updating the percpu variable
  address and percpu offset register can corrupt previous context
  register state in several cases (not only the single case reported by
  Sashiko).

v1:
Most of this is only about cleaning up the percpu code after preemptible
this_cpu_*() operations have been implemented. The first ten patches are
all more or less trivial cleanup patches trying to make the code shorter
and more readable.

The only non-trivial patch is the last one, which converts s390's
this_cpu_*() operations to use a similar scheme like Mark Rutland
provided it for arm64 [1]. This allows to simplify the irq entry and exit
path, however at the cost of slightly worse code for this_cpu_*()
operations.

The simplified irq entry and exit code seems to be worth it. Usable
performance numbers are not available yet, however I don't expect big
difference to before.

[1] https://lore.kernel.org/all/20260904161758.376504-1-mark.rutland@arm.com/

Thanks,
Heiko

Heiko Carstens (11):
  s390/percpu: Fix comment typo
  s390/percpu: Add sanity check to GEN_MVIY macro
  s390/lowcore: Remove _AC() from LOWCORE_ALT_ADDRESS
  s390/percpu: Let MVIY_PERCPU() calculate alternative displacement
  s390/percpu/lowcore: Add and use LC_PERCPU lowcore offset defines
  s390/percpu: Rename inline assembly symbolic names
  s390/percpu: Use __PCPU_BEGIN() and __PCPU_END() for inline assemblies
  s390/percpu: Use percpu code section for this_cpu_cmpxchg128()
  s390/percpu: Use percpu code section for this_cpu_xchg()
  s390/percpu: Use percpu code section for this_cpu_cmpxchg()
  s390/percpu: Rework to simplify percpu_entry() and percpu_exit()

 arch/s390/include/asm/entry-percpu.h |  71 ++----
 arch/s390/include/asm/lowcore.h      |   5 +-
 arch/s390/include/asm/percpu.h       | 354 +++++++++++++++++----------
 arch/s390/kernel/irq.c               |  10 +-
 arch/s390/kernel/nmi.c               |   4 +-
 arch/s390/kernel/traps.c             |   4 +-
 6 files changed, 248 insertions(+), 200 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-09-21 10:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21  8:39 [PATCH v3 00/11] s390: More this_cpu_*() changes Heiko Carstens
2026-09-21  8:39 ` [PATCH v3 01/11] s390/percpu: Fix comment typo Heiko Carstens
2026-09-21  8:39 ` [PATCH v3 02/11] s390/percpu: Add sanity check to GEN_MVIY macro Heiko Carstens
2026-09-21  8:39 ` [PATCH v3 03/11] s390/lowcore: Remove _AC() from LOWCORE_ALT_ADDRESS Heiko Carstens
2026-09-21  8:39 ` [PATCH v3 04/11] s390/percpu: Let MVIY_PERCPU() calculate alternative displacement Heiko Carstens
2026-09-21  8:39 ` [PATCH v3 05/11] s390/percpu/lowcore: Add and use LC_PERCPU lowcore offset defines Heiko Carstens
2026-09-21  8:40 ` [PATCH v3 06/11] s390/percpu: Rename inline assembly symbolic names Heiko Carstens
2026-09-21  8:40 ` [PATCH v3 07/11] s390/percpu: Use __PCPU_BEGIN() and __PCPU_END() for inline assemblies Heiko Carstens
2026-09-21  8:40 ` [PATCH v3 08/11] s390/percpu: Use percpu code section for this_cpu_cmpxchg128() Heiko Carstens
2026-09-21  8:40 ` [PATCH v3 09/11] s390/percpu: Use percpu code section for this_cpu_xchg() Heiko Carstens
2026-09-21  8:40 ` [PATCH v3 10/11] s390/percpu: Use percpu code section for this_cpu_cmpxchg() Heiko Carstens
2026-09-21  8:40 ` [PATCH v3 11/11] s390/percpu: Rework to simplify percpu_entry() and percpu_exit() Heiko Carstens
2026-09-21  9:55   ` David Laight
2026-09-21 10:07     ` Mark Rutland
2026-09-21 10:17       ` Heiko Carstens
2026-09-21  9:15 ` [PATCH v3 00/11] s390: More this_cpu_*() changes 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®