Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH 0/3] lib/raid: opt out of initializing MXCSR and 387 state
@ 2026-11-11 20:56 Eric Biggers
  2026-11-11 20:56 ` [PATCH 1/3] um: Define kernel_fpu_begin_mask() Eric Biggers
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Eric Biggers @ 2026-11-11 20:56 UTC (permalink / raw)
  To: akpm, linux-raid
  Cc: linux-crypto, x86, Christoph Hellwig, Richard Weinberger,
	Anton Ivanov, Johannes Berg, Eric Biggers

This series slightly reduces the overhead of the x86 kernel-mode "FPU"
sections in the RAID code by using kernel_fpu_begin_mask(0) instead of
kernel_fpu_begin(), thus opting out of the 'ldmxcsr' (and on 32-bit
kernels, also 'fninit').  MXCSR is irrelevant for integer code.

This mirrors similar optimizations for the crypto and CRC code
(https://lore.kernel.org/linux-crypto/20261105005523.84925-1-ebiggers@kernel.org/).
It's more important there than in the RAID code, since short lengths are
common in the x86-optimized crypto and CRC functions.  However, I think
it's worth updating the RAID code too for consistency.

Unlike the crypto and CRC code, the RAID code is built for user-mode
Linux.  Therefore, as a prerequisite for this change, patch 1 also
defines a stub for kernel_fpu_begin_mask() on user-mode Linux.

This series is targeting mm/mm-nonmm-unstable.

Eric Biggers (3):
  um: Define kernel_fpu_begin_mask()
  xor: opt out of initializing MXCSR and 387 state
  raid6: opt out of initializing MXCSR and 387 state

 arch/um/include/asm/fpu/api.h     |  1 +
 lib/raid/raid6/x86/avx2.c         | 12 ++++++------
 lib/raid/raid6/x86/avx512.c       | 12 ++++++------
 lib/raid/raid6/x86/recov_avx2.c   |  4 ++--
 lib/raid/raid6/x86/recov_avx512.c |  4 ++--
 lib/raid/raid6/x86/recov_ssse3.c  |  4 ++--
 lib/raid/raid6/x86/sse2.c         | 12 ++++++------
 lib/raid/xor/x86/xor-avx.c        |  2 +-
 lib/raid/xor/x86/xor-avx512.c     |  2 +-
 lib/raid/xor/x86/xor-sse.c        |  4 ++--
 10 files changed, 29 insertions(+), 28 deletions(-)


base-commit: d0ad02b9d5dd7ae551f450cfd233f3e28bbf59d3
-- 
2.56.1


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

end of thread, other threads:[~2026-11-12 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11 20:56 [PATCH 0/3] lib/raid: opt out of initializing MXCSR and 387 state Eric Biggers
2026-11-11 20:56 ` [PATCH 1/3] um: Define kernel_fpu_begin_mask() Eric Biggers
2026-11-12  7:28   ` Johannes Berg
2026-11-11 20:56 ` [PATCH 2/3] xor: opt out of initializing MXCSR and 387 state Eric Biggers
2026-11-11 20:56 ` [PATCH 3/3] raid6: " Eric Biggers
2026-11-12 13:40 ` [PATCH 0/3] lib/raid: " Christoph Hellwig

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