<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/arch/s390/include/asm/bitops.h, branch v7.1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-10-09T17:51:43+00:00</updated>
<entry>
<title>Merge tag 's390-6.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux</title>
<updated>2025-10-09T17:51:43+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-10-09T17:51:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9361cace0d07954ad8f2345c057976ab1bf44488'/>
<id>urn:sha1:9361cace0d07954ad8f2345c057976ab1bf44488</id>
<content type='text'>
Pull more s390 updates from Alexander Gordeev:

 - Compile the decompressor with -Wno-pointer-sign flag to avoid a clang
   warning

 - Fix incomplete conversion to flag output macros in __xsch(), to avoid
   always zero return value instead of the expected condition code

 - Remove superfluous newlines from inline assemblies to improve
   compiler inlining decisions

 - Expose firmware provided UID Checking state in sysfs regardless of
   the device presence or state

 - CIO does not unregister subchannels when the attached device is
   invalid or unavailable. Update the purge function to remove I/O
   subchannels if the device number is found on cio_ignore list

 - Consolidate PAI crypto allocation and cleanup paths

 - The uv_get_secret_metadata() function has been removed some few
   months ago, remove also the function mention it in a comment

* tag 's390-6.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/uv: Fix comment of uv_find_secret() function
  s390/pai_crypto: Consolidate PAI crypto allocation and cleanup paths
  s390/cio: Update purge function to unregister the unused subchannels
  s390/pci: Expose firmware provided UID Checking state in sysfs
  s390: Remove superfluous newlines from inline assemblies
  s390/cio/ioasm: Fix __xsch() condition code handling
  s390: Add -Wno-pointer-sign to KBUILD_CFLAGS_DECOMPRESSOR
</content>
</entry>
<entry>
<title>Merge tag 's390-6.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux</title>
<updated>2025-09-30T02:14:25+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-09-30T02:14:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9cc220a422113f665e13364be1411c7bba9e3e30'/>
<id>urn:sha1:9cc220a422113f665e13364be1411c7bba9e3e30</id>
<content type='text'>
Pull s390 updates from Alexander Gordeev:

 - Refactor SCLP memory hotplug code

 - Introduce common boot_panic() decompressor helper macro and use it to
   get rid of nearly few identical implementations

 - Take into account additional key generation flags and forward it to
   the ep11 implementation. With that allow users to modify the key
   generation process, e.g. provide valid combinations of XCP_BLOB_*
   flags

 - Replace kmalloc() + copy_from_user() with memdup_user_nul() in s390
   debug facility and HMC driver

 - Add DAX support for DCSS memory block devices

 - Make the compiler statement attribute "assume" available with a new
   __assume macro

 - Rework ffs() and fls() family bitops functions, including source code
   improvements and generated code optimizations. Use the newly
   introduced __assume macro for that

 - Enable additional network features in default configurations

 - Use __GFP_ACCOUNT flag for user page table allocations to add missing
   kmemcg accounting

 - Add WQ_PERCPU flag to explicitly request the use of the per-CPU
   workqueue for 3590 tape driver

 - Switch power reading to the per-CPU and the Hiperdispatch to the
   default workqueue

 - Add memory allocation profiling hooks to allow better profiling data
   and the /proc/allocinfo output similar to other architectures

* tag 's390-6.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (21 commits)
  s390/mm: Add memory allocation profiling hooks
  s390: Replace use of system_wq with system_dfl_wq
  s390/diag324: Replace use of system_wq with system_percpu_wq
  s390/tape: Add WQ_PERCPU to alloc_workqueue users
  s390/bitops: Switch to generic ffs() if supported by compiler
  s390/bitops: Switch to generic fls(), fls64(), etc.
  s390/mm: Use __GFP_ACCOUNT for user page table allocations
  s390/configs: Enable additional network features
  s390/bitops: Cleanup __flogr()
  s390/bitops: Use __assume() for __flogr() inline assembly return value
  compiler_types: Add __assume macro
  s390/bitops: Limit return value range of __flogr()
  s390/dcssblk: Add DAX support
  s390/hmcdrv: Replace kmalloc() + copy_from_user() with memdup_user_nul()
  s390/debug: Replace kmalloc() + copy_from_user() with memdup_user_nul()
  s390/pkey: Forward keygenflags to ep11_unwrapkey
  s390/boot: Add common boot_panic() code
  s390/bitops: Optimize inlining
  s390/bitops: Slightly optimize ffs() and fls64()
  s390/sclp: Move memory hotplug code for better modularity
  ...
</content>
</entry>
<entry>
<title>s390: Remove superfluous newlines from inline assemblies</title>
<updated>2025-09-29T11:52:08+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-09-25T08:45:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4335edb7138b45abab65f01d2be77a9be9cfd2fe'/>
<id>urn:sha1:4335edb7138b45abab65f01d2be77a9be9cfd2fe</id>
<content type='text'>
Remove superfluous newlines from inline assemblies. Compilers use the
number of lines of inline assemblies as heuristic for the complexity
and inline decisions. Therefore inline assemblies should only contain
as many lines as required.

A lot of inline assemblies contain a superfluous newline for the last
line. Remove such newlines to improve compiler inlining decisions.

Suggested-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Reviewed-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Reviewed-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/bitops: Switch to generic ffs() if supported by compiler</title>
<updated>2025-09-24T14:24:18+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-09-22T11:40:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6c4e0cb3d87ad63a30e05e7624a45a6f01240e70'/>
<id>urn:sha1:6c4e0cb3d87ad63a30e05e7624a45a6f01240e70</id>
<content type='text'>
Use generic ffs() / __builtin_ffs() if supported by the compiler. GCC 16
will have support for __builtin_ffs().
See gcc commit f50cff9766c5 ("s390: Implement clz and ctz for SI mode").

In the distant future when GCC 16 becomes the minimum supported version,
this allows to get rid of the flogr inline assembly.

Kernel image size is reduced by ~500 bytes (gcc 16 beta + defconfig).

Acked-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/bitops: Switch to generic fls(), fls64(), etc.</title>
<updated>2025-09-24T14:24:17+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-09-22T11:40:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b80a23c0e33ae5a3ae68e0cf5b5a59e8a368c37'/>
<id>urn:sha1:7b80a23c0e33ae5a3ae68e0cf5b5a59e8a368c37</id>
<content type='text'>
Switch to generic fls(), fls64(), etc. which are implemented with
__builtin_ctzl(), __builtin_clzl().
Those builtins are available for all supported compilers.

Kernel image size is reduced by ~10kb (gcc 15.1.0 + defconfig).

Acked-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/bitops: Cleanup __flogr()</title>
<updated>2025-09-18T12:06:41+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-09-16T13:48:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f46ccdb87a2573a23ee2d2c21a6b087af9ae76c0'/>
<id>urn:sha1:f46ccdb87a2573a23ee2d2c21a6b087af9ae76c0</id>
<content type='text'>
The flogr() inline assembly has no side effects and generates the same
output if the input does not change. Therefore remove the volatile
qualifier to allow the compiler to optimize the inline assembly away,
if possible.

Also remove the superfluous '\n' which makes the inline assembly appear
larger than it is according to compiler heuristics (number of lines).

Furthermore change the return type of flogr() to unsigned long and add the
const attribute to the function.

This reduces the kernel image size by 994 bytes (defconfig, gcc 15.2.0).

Suggested-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Reviewed-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/bitops: Use __assume() for __flogr() inline assembly return value</title>
<updated>2025-09-18T12:06:40+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-09-16T13:48:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=79161603952c842eb22313f2060051b359b0a592'/>
<id>urn:sha1:79161603952c842eb22313f2060051b359b0a592</id>
<content type='text'>
Use __assume() to tell compilers that the output operand of the __flogr()
inline assembly contains a value in the range of 0..64. This allows to
optimize the logical AND operation away.

This reduces the kernel image size by 2804 bytes (defconfig, gcc 15.2.0).

Suggested-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Reviewed-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390/bitops: Limit return value range of __flogr()</title>
<updated>2025-09-18T12:06:40+00:00</updated>
<author>
<name>Heiko Carstens</name>
<email>hca@linux.ibm.com</email>
</author>
<published>2025-09-16T13:48:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a9f859b516ac98c06b0d24e691fceab32a9665d5'/>
<id>urn:sha1:a9f859b516ac98c06b0d24e691fceab32a9665d5</id>
<content type='text'>
With the recent ffs() and ffs64() optimization a logical AND operation was
removed, which allowed the compiler to tell the return value range of both
functions. This may lead to compile warnings as reported by the kernel test
robot:

   drivers/infiniband/hw/mlx5/mr.c: In function 'mlx5r_cache_create_ent_locked':
&gt;&gt; drivers/infiniband/hw/mlx5/mr.c:840:31: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
     840 |         sprintf(ent-&gt;name, "%d", order);
         |                               ^
   In function 'mlx5_mkey_cache_debugfs_add_ent',
       inlined from 'mlx5r_cache_create_ent_locked' at drivers/infiniband/hw/mlx5/mr.c:930:3:
   drivers/infiniband/hw/mlx5/mr.c:840:9: note: 'sprintf' output between 2 and 5 bytes into a destination of size 4
     840 |         sprintf(ent-&gt;name, "%d", order);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add the AND operation again to address the warning.

From a correctness point of view the AND operation is not necessary,
however there is no other way to tell the compiler that the returned
value of the flogr inline assembly is in the range of 0..64.

This increases the kernel image size by 566 bytes (defconfig, gcc 15.2.0).

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Closes: https://lore.kernel.org/oe-kbuild-all/202508211859.UoYsJbLN-lkp@intel.com/
Fixes: de88e74889a3 ("s390/bitops: Slightly optimize ffs() and fls64()")
Suggested-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Reviewed-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>s390: Add __attribute_const__ to ffs()-family implementations</title>
<updated>2025-09-08T21:58:52+00:00</updated>
<author>
<name>Kees Cook</name>
<email>kees@kernel.org</email>
</author>
<published>2025-08-04T16:44:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b77fee88bfdfcba2f92c9de2ed1af793c96c46d8'/>
<id>urn:sha1:b77fee88bfdfcba2f92c9de2ed1af793c96c46d8</id>
<content type='text'>
While tracking down a problem where constant expressions used by
BUILD_BUG_ON() suddenly stopped working[1], we found that an added static
initializer was convincing the compiler that it couldn't track the state
of the prior statically initialized value. Tracing this down found that
ffs() was used in the initializer macro, but since it wasn't marked with
__attribute__const__, the compiler had to assume the function might
change variable states as a side-effect (which is not true for ffs(),
which provides deterministic math results).

Add missing __attribute_const__ annotations to S390's implementations of
ffs(), __ffs(), fls(), and __fls() functions. These are pure mathematical
functions that always return the same result for the same input with no
side effects, making them eligible for compiler optimization.

Build tested ARCH=s390 defconfig with GCC s390x-linux-gnu 14.2.0.

Link: https://github.com/KSPP/linux/issues/364 [1]
Acked-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://lore.kernel.org/r/20250804164417.1612371-14-kees@kernel.org
Signed-off-by: Kees Cook &lt;kees@kernel.org&gt;
</content>
</entry>
<entry>
<title>s390/bitops: Optimize inlining</title>
<updated>2025-08-20T14:38:24+00:00</updated>
<author>
<name>Juergen Christ</name>
<email>jchrist@linux.ibm.com</email>
</author>
<published>2025-08-11T15:22:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=669bc57e7016cf9d1a9eedb2a984c4fb4fd67f3d'/>
<id>urn:sha1:669bc57e7016cf9d1a9eedb2a984c4fb4fd67f3d</id>
<content type='text'>
GCC inlining heuristics prevent code growth due to inlining into cold
paths.  This causes GCC to emit a partially specialized version of
__flogr for non-constant input for all occurrences on cold paths.
This happens since the overhead seen during inlining includes setting
up a union register_pair, calling flogr, and extracting and casting
the result.  This overhead is not removed until the function is
lowered into RTL.  But this happens after inlining.

For -ftrivial-var-auto-init=zero builds, an additional initialization
of the union register_pair adds another statement to be inlinined.
This is unneeded since the even register is initialized anyway and the
odd register is not an input register.  It is only marked as such
since the whole pair has to be marked as a read/write output register.
Mark the union register_pair as uninitialized to get rid of this
statement.  This, however, does not change the code since the
initialization happens when part of the register pair is written.
Nevertheless, GCC function size approximation during inlining is
reduced by one statement.

Force inlining of flogr and also flatten some other functions that
should be leaf functions but are called in cold context, like, e.g.,
__init functions.

Acked-by: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Signed-off-by: Juergen Christ &lt;jchrist@linux.ibm.com&gt;
Signed-off-by: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
</content>
</entry>
</feed>
