public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Simon Richter <Simon.Richter@hogyros.de>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	linux-crypto@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org, x86@kernel.org,
	Harald Freudenberger <freude@linux.ibm.com>,
	Holger Dengler <dengler@linux.ibm.com>
Subject: Re: [PATCH 0/3] crypto: Remove arch-optimized des and des3_ede code
Date: Fri, 27 Mar 2026 17:24:23 +0000	[thread overview]
Message-ID: <20260327172423.GA3407398@google.com> (raw)
In-Reply-To: <35e00d0f-85f6-457a-99b4-703caf3e1e6e@hogyros.de>

On Fri, Mar 27, 2026 at 06:59:21PM +0900, Simon Richter wrote:
> On 3/27/26 5:27 AM, Eric Biggers wrote:
> 
> > In general that's good of course, but DES and 3DES?  Really?  Why is
> > effort going into these obsolete algorithms at all?
> 
> If there's dedicated instructions, we need to emulate them, even if the
> kernel stops using them, because userspace might still use them. The
> alternative is implementing them as a trap in the kernel that delegates to
> the crypto subsystem, and nobody wants that. O_O

While I appreciate the sudden eagerness to implement these instructions
in QEMU after them not being supported for 15 years, I'd suggest that
the instructions for the more modern algorithms should be prioritized.

> I wonder if it would make sense to split between "crypto" and "offload"
> subsystems, so the "crypto" side can focus on a small number of contemporary
> algorithms and give them simple, easily auditable interfaces, and move all
> the complexity of asynchronous request processing in offload hardware over
> to the "offloading" side. The userspace API would also move to the
> "offloading" subsystem.

lib/crypto/ and crypto/ already largely provides that distinction, no?

> This would give the offloading subsystem a bit more flexibility in API
> design as well, so we could maybe represent offload capabilities in network
> or storage hardware as well

The kernel already has perfectly good support for inline storage
encryption in the block layer.  See
Documentation/block/inline-encryption.rst.  It's a completely different
model from non-inline crypto engines.  Trying to create some common
abstraction is not going to succeed.

> However, even from the "crypto" perspective I believe that we can't get
> around support for asynchronous offload devices, because of mobile devices.
> I suspect no one would be building dedicated silicon for asynchronous AES
> into mobile CPUs if that wasn't worth it somehow

They do it anyway.  It's a checkbox feature.  I.e. the purpose is for it
to be advertised on a list of features.

> so if such a device is
> present, we want to use it as much as possible, because the expectation is
> that while the difference in performance compared to the CPU is hardly
> noticeable, the difference in battery lifetime is (that's why dropping async
> request support from fscrypt makes it largely useless on mobile).

I'm quite familiar with how fscrypt is being used on mobile, thanks.
Most people do use hardware offload with fscrypt, but it is *inline*
hardware offload.  That remains fully supported via blk-crypto and is
unrelated to the crypto API.  The rest just use the CPU.

I've only ever heard of one case almost a decade ago where someone
intentionally used a non-inline offload engine with fscrypt.  And I even
recently showed that on the same line of SoCs that was being used in
that case, it is no longer worth it, if it ever was.

Every other case has just been someone using one by mistake and getting
their performance tanked or encountering driver bugs as a result.

Anyway, this seems very off-topic for this thread, which is about
whether the architecture-optimized DES and 3DES code should be removed.

- Eric

      reply	other threads:[~2026-03-27 17:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-26 20:12 [PATCH 0/3] crypto: Remove arch-optimized des and des3_ede code Eric Biggers
2026-03-26 20:12 ` [PATCH 1/3] crypto: s390 - Remove " Eric Biggers
2026-03-27  8:52   ` Holger Dengler
2026-03-27 17:32     ` Eric Biggers
2026-03-26 20:12 ` [PATCH 2/3] crypto: sparc " Eric Biggers
2026-03-26 20:12 ` [PATCH 3/3] crypto: x86 " Eric Biggers
2026-03-26 20:20 ` [PATCH 0/3] crypto: Remove arch-optimized " John Paul Adrian Glaubitz
2026-03-26 20:27   ` Eric Biggers
2026-03-26 21:07     ` Eric Biggers
2026-03-27  9:59     ` Simon Richter
2026-03-27 17:24       ` Eric Biggers [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=20260327172423.GA3407398@google.com \
    --to=ebiggers@kernel.org \
    --cc=Simon.Richter@hogyros.de \
    --cc=dengler@linux.ibm.com \
    --cc=freude@linux.ibm.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --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