All of lore.kernel.org
 help / color / mirror / Atom feed
* + um-define-kernel_fpu_begin_mask.patch added to mm-nonmm-unstable branch
@ 2026-11-13  2:41 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-13  2:41 UTC (permalink / raw)
  To: mm-commits, richard, johannes, hch, anton.ivanov, ebiggers, akpm


The patch titled
     Subject: um: define kernel_fpu_begin_mask()
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     um-define-kernel_fpu_begin_mask.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/um-define-kernel_fpu_begin_mask.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Eric Biggers <ebiggers@kernel.org>
Subject: um: define kernel_fpu_begin_mask()
Date: Wed, 11 Nov 2026 12:56:02 -0800

Patch series "lib/raid: opt out of initializing MXCSR and 387 state".

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 patch (of 3):

Define a stub for kernel_fpu_begin_mask() on user-mode Linux so that
lib/raid/ can switch from kernel_fpu_begin() to kernel_fpu_begin_mask().

Note: this causes a checkpatch error due to the macro's value not having
outer parentheses, but it's left as-is for consistency with the existing
kernel_fpu_begin() and kernel_fpu_end() definitions right next to it.

Link: https://lore.kernel.org/20261111205604.47547-1-ebiggers@kernel.org
Link: https://lore.kernel.org/20261111205604.47547-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
---

 arch/um/include/asm/fpu/api.h |    1 +
 1 file changed, 1 insertion(+)

--- a/arch/um/include/asm/fpu/api.h~um-define-kernel_fpu_begin_mask
+++ a/arch/um/include/asm/fpu/api.h
@@ -11,6 +11,7 @@
  * UML code tree. */
 
 #define kernel_fpu_begin() (void)0
+#define kernel_fpu_begin_mask(mask) (void)(mask)
 #define kernel_fpu_end() (void)0
 
 static inline bool irq_fpu_usable(void)
_

Patches currently in -mm which might be from ebiggers@kernel.org are

xor-remove-obsolete-mmx-optimized-code.patch
raid6-remove-obsolete-mmx-optimized-code.patch
raid6-simplify-cpu-feature-checks.patch
um-define-kernel_fpu_begin_mask.patch
xor-opt-out-of-initializing-mxcsr-and-387-state.patch
raid6-opt-out-of-initializing-mxcsr-and-387-state.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13  2:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  2:41 + um-define-kernel_fpu_begin_mask.patch added to mm-nonmm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.