]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
s390/percpu: Provide arch_raw_cpu_ptr()
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 17 Mar 2026 19:54:28 +0000 (20:54 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 24 Mar 2026 20:00:41 +0000 (21:00 +0100)
commitfa8be59ce23df05d3e1190ce4238f6f875d3868d
treea1892fd141250193b0e5dd278ba7b9e177f1368b
parent7bbf70131f937ee5871e22d159ed2fc66795722f
s390/percpu: Provide arch_raw_cpu_ptr()

Provide an s390 specific arch_raw_cpu_ptr() implementation which avoids the
detour over get_lowcore() to get the lowcore pointer. The inline assembly
is implemented with an alternative so that relocated lowcore (percpu offset
is at a different address) is handled correctly.

This turns code like this

  102f78:       a7 39 00 00             lghi    %r3,0
  102f7c:       e3 20 33 b8 00 08       ag      %r2,952(%r3)

which adds the percpu offset to register r2 into a single instruction

  102f7c:       e3 20 33 b8 00 08       ag      %r2,952(%r0)

and also avoids the need of a base register, thus reducing register
pressure.

With defconfig bloat-o-meter -t provides this result:

add/remove: 12/26 grow/shrink: 183/3391 up/down: 14880/-41950 (-27070)

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/percpu.h