diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2026-11-04 16:55:21 -0800 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2026-11-09 15:17:29 -0800 |
| commit | f7d80cca846cae3094396a8e93f74f42f41df50b (patch) | |
| tree | b99890abe83f2896986eb429daff18d3f40f06cc /scripts/Makefile.thinlto | |
| parent | 7475ea8b58616b33c04afb976cf0fbaad9dd63fb (diff) | |
| download | linux-next-f7d80cca846cae3094396a8e93f74f42f41df50b.tar.gz linux-next-f7d80cca846cae3094396a8e93f74f42f41df50b.zip | |
lib/crc: x86: Opt out of initializing MXCSR and 387 state
The CRC code using "kernel-mode FPU" is integer code that does not use
any MMX or x87 instructions. To the extent that float-domain
instructions are used at all, they are only moves and shuffles, neither
of which raises SIMD floating-point exceptions or depends on MXCSR.
Therefore, there's no need to initialize MXCSR or the 387 FPU state.
Opt out of this initialization by using kernel_fpu_begin_mask(0) instead
of kernel_fpu_begin(). This eliminates an 'ldmxcsr' instruction in
every kernel-mode FPU section, reducing overhead, which matters most for
short input lengths. On 32-bit kernels it also eliminates 'fninit'.
A precedent for this optimization can be found in
commit a58db7ad80e8 ("netfilter: nft_set_pipapo_avx2: Skip LDMXCSR, we
don't need a valid MXCSR state").
Link: https://patch.msgid.link/20261105005523.84925-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
