Re: [PATCH] crypto: lib/sha256 - Disable SIMD

From: Borislav Petkov
Date: Fri May 16 2025 - 14:13:59 EST


On Fri, May 16, 2025 at 10:03:16AM -0700, Eric Biggers wrote:
> That's silly. We should just fix x86's irq_fpu_usable() to return false
> before the CPU is properly initialized. It already checks a per-cpu bool, so
> it shouldn't be too hard to fit that in.

Probably.

There's a fpu__init_cpu() call almost right after load_ucode_ap() which causes
this thing.

I'm not sure how much initialized stuff you need for SHA256 SIMD... perhaps
swap fpu__init_cpu() and load_ucode_ap() calls after proper code audit whether
that's ok.

Or add a "is the FPU initialized" check, as you propose, which is probably
easier.

As always, the x86 CPU init path is nasty and needs careful auditing.

> Using the generic SHA-256 code explicitly is also an option,

Or that.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette