public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Eric Biggers <ebiggers@kernel.org>, Borislav Petkov <bp@alien8.de>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	Jain@formenos.rohan.me.apana.org.au, Ayush <Ayush.Jain3@amd.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>, x86-ml <x86@kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH] crypto: lib/sha256 - Disable SIMD
Date: Fri, 16 May 2025 22:34:31 +0200	[thread overview]
Message-ID: <878qmwi9bc.ffs@tglx> (raw)
In-Reply-To: <20250516190637.GA32835@sol>

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

      reply	other threads:[~2025-05-16 20:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-16 11:22 cryptodev linux-next splat Borislav Petkov
2025-05-16 11:34 ` Herbert Xu
2025-05-16 11:48   ` [PATCH] crypto: lib/sha256 - Disable SIMD Herbert Xu
2025-05-16 12:27     ` Borislav Petkov
2025-05-16 17:03     ` Eric Biggers
2025-05-16 18:13       ` Borislav Petkov
2025-05-16 19:06         ` Eric Biggers
2025-05-16 20:34           ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878qmwi9bc.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=Ayush.Jain3@amd.com \
    --cc=Jain@formenos.rohan.me.apana.org.au \
    --cc=bp@alien8.de \
    --cc=ebiggers@kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox