]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Merge tag 'fpsimd-on-stack-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Dec 2025 02:53:50 +0000 (18:53 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Dec 2025 02:53:50 +0000 (18:53 -0800)
Pull arm64 FPSIMD on-stack buffer updates from Eric Biggers:
 "This is a core arm64 change. However, I was asked to take this because
  most uses of kernel-mode FPSIMD are in crypto or CRC code.

  In v6.8, the size of task_struct on arm64 increased by 528 bytes due
  to the new 'kernel_fpsimd_state' field. This field was added to allow
  kernel-mode FPSIMD code to be preempted.

  Unfortunately, 528 bytes is kind of a lot for task_struct. This
  regression in the task_struct size was noticed and reported.

  Recover that space by making this state be allocated on the stack at
  the beginning of each kernel-mode FPSIMD section.

  To make it easier for all the users of kernel-mode FPSIMD to do that
  correctly, introduce and use a 'scoped_ksimd' abstraction"

* tag 'fpsimd-on-stack-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux: (23 commits)
  lib/crypto: arm64: Move remaining algorithms to scoped ksimd API
  lib/crypto: arm/blake2b: Move to scoped ksimd API
  arm64/fpsimd: Allocate kernel mode FP/SIMD buffers on the stack
  arm64/fpu: Enforce task-context only for generic kernel mode FPU
  net/mlx5: Switch to more abstract scoped ksimd guard API on arm64
  arm64/xorblocks:  Switch to 'ksimd' scoped guard API
  crypto/arm64: sm4 - Switch to 'ksimd' scoped guard API
  crypto/arm64: sm3 - Switch to 'ksimd' scoped guard API
  crypto/arm64: sha3 - Switch to 'ksimd' scoped guard API
  crypto/arm64: polyval - Switch to 'ksimd' scoped guard API
  crypto/arm64: nhpoly1305 - Switch to 'ksimd' scoped guard API
  crypto/arm64: aes-gcm - Switch to 'ksimd' scoped guard API
  crypto/arm64: aes-blk - Switch to 'ksimd' scoped guard API
  crypto/arm64: aes-ccm - Switch to 'ksimd' scoped guard API
  raid6: Move to more abstract 'ksimd' guard API
  crypto: aegis128-neon - Move to more abstract 'ksimd' guard API
  crypto/arm64: sm4-ce-gcm - Avoid pointless yield of the NEON unit
  crypto/arm64: sm4-ce-ccm - Avoid pointless yield of the NEON unit
  crypto/arm64: aes-ce-ccm - Avoid pointless yield of the NEON unit
  lib/crc: Switch ARM and arm64 to 'ksimd' scoped guard API
  ...

1  2 
arch/arm64/include/asm/processor.h
arch/arm64/include/asm/simd.h
arch/arm64/kernel/fpsimd.c

Simple merge
Simple merge
index 6d956ed23bd216f18e47a5dc51d0e8d857aba7a2,32e68c7eb3a25218e2f1b815d475cc7e8bdb8cb8..c154f72634e028ba41411f8222c35179321933d4
@@@ -1947,11 -1960,11 +1973,11 @@@ void __efi_fpsimd_begin(void
        if (!system_supports_fpsimd())
                return;
  
 -      WARN_ON(preemptible());
 -
        if (may_use_simd()) {
-               kernel_neon_begin();
+               kernel_neon_begin(&efi_fpsimd_state);
        } else {
 +              WARN_ON(preemptible());
 +
                /*
                 * If !efi_sve_state, SVE can't be in use yet and doesn't need
                 * preserving: