[v3 PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-27 Thread Herbert Xu
From: Eric Biggers Instead of providing crypto_shash algorithms for the arch-optimized SHA-256 code, instead implement the SHA-256 library. This is much simpler, it makes the SHA-256 library functions be arch-optimized, and it fixes the longstanding issue where the arch-optimized SHA-256 was dis

[v2 PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-26 Thread Herbert Xu
From: Eric Biggers Instead of providing crypto_shash algorithms for the arch-optimized SHA-256 code, instead implement the SHA-256 library. This is much simpler, it makes the SHA-256 library functions be arch-optimized, and it fixes the longstanding issue where the arch-optimized SHA-256 was dis

Re: [PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-26 Thread Herbert Xu
On Fri, Apr 25, 2025 at 11:50:37PM -0700, Eric Biggers wrote: > > +void sha256_blocks_arch(u32 state[SHA256_STATE_WORDS], > + const u8 *data, size_t nblocks) > +{ > + if (static_branch_likely(&have_sha256_x86) && crypto_simd_usable()) { > + kernel_fpu_begin(); >

Re: [PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-26 Thread Eric Biggers
On Sun, Apr 27, 2025 at 08:18:56AM +0800, Herbert Xu wrote: > On Sat, Apr 26, 2025 at 11:03:26AM -0700, Eric Biggers wrote: > > > > The SHA-256 library functions currently work in any context, and this patch > > series preserves that behavior. Changing that would be a separate change. > > I've al

Re: [PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-26 Thread Herbert Xu
On Sat, Apr 26, 2025 at 11:03:26AM -0700, Eric Biggers wrote: > > The SHA-256 library functions currently work in any context, and this patch > series preserves that behavior. Changing that would be a separate change. I've already removed the SIMD fallback path and your patch is adding it back.

Re: [PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-26 Thread Eric Biggers
On Sat, Apr 26, 2025 at 06:50:43PM +0800, Herbert Xu wrote: > Eric Biggers wrote: > > > > +void sha256_blocks_arch(u32 state[SHA256_STATE_WORDS], > > + const u8 *data, size_t nblocks) > > +{ > > + if (static_branch_likely(&have_sha256_x86) && crypto_simd_usable()) > >

Re: [PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-26 Thread Herbert Xu
Eric Biggers wrote: > > +void sha256_blocks_arch(u32 state[SHA256_STATE_WORDS], > + const u8 *data, size_t nblocks) > +{ > + if (static_branch_likely(&have_sha256_x86) && crypto_simd_usable()) { > + kernel_fpu_begin(); > + static_call(sha256_

[PATCH 11/13] crypto: x86/sha256 - implement library instead of shash

2025-04-25 Thread Eric Biggers
From: Eric Biggers Instead of providing crypto_shash algorithms for the arch-optimized SHA-256 code, instead implement the SHA-256 library. This is much simpler, it makes the SHA-256 library functions be arch-optimized, and it fixes the longstanding issue where the arch-optimized SHA-256 was dis