[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878qmwi9bc.ffs@tglx>
Date: Fri, 16 May 2025 22:34:31 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Eric Biggers <ebiggers@...nel.org>, Borislav Petkov <bp@...en8.de>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
Jain@...menos.rohan.me.apana.org.au, Ayush <Ayush.Jain3@....com>, Stephen
Rothwell <sfr@...b.auug.org.au>, x86-ml <x86@...nel.org>, lkml
<linux-kernel@...r.kernel.org>, linux-crypto@...r.kernel.org
Subject: Re: [PATCH] crypto: lib/sha256 - Disable SIMD
On Fri, May 16 2025 at 12:06, Eric Biggers wrote:
> What would you say about going back to my earlier plan to make irq_fpu_usable()
> return false when irqs_disabled(), like what arm64 does? (As I had in
> https://lore.kernel.org/lkml/20250220051325.340691-2-ebiggers@kernel.org/).
> + return !this_cpu_read(in_kernel_fpu) &&
> + !in_hardirq() && !irqs_disabled() && !in_nmi();
The !in_hardirq() is redundant because hard interrupt context runs with
interrupts disabled.
> I think that would handle all these cases, as well as others. We'd need to fix
> __save_processor_state() to save the FPU state directly without pretending that
> it's using kernel-mode FPU, but I don't know of any issues besides
> that.
Looks about right.
> Then we could also delete the irqs_disabled() checks that I added to
> kernel_fpu_begin() and kernel_fpu_end().
Yes. That conditional locking is horrible.
Thanks,
tglx
Powered by blists - more mailing lists