From: Eric Biggers <ebiggers@kernel.org>
To: Simon Richter <Simon.Richter@hogyros.de>
Cc: linux-fscrypt@vger.kernel.org, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-ext4@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
ceph-devel@vger.kernel.org
Subject: Re: [PATCH] fscrypt: don't use hardware offload Crypto API drivers
Date: Thu, 12 Jun 2025 00:59:14 +0000 [thread overview]
Message-ID: <20250612005914.GA546455@google.com> (raw)
In-Reply-To: <7f63be76-289b-4a99-b802-afd72e0512b8@hogyros.de>
On Thu, Jun 12, 2025 at 09:21:26AM +0900, Simon Richter wrote:
> Hi,
>
> On 6/12/25 05:58, Eric Biggers wrote:
>
> > But
> > otherwise this style of hardware offload is basically obsolete and has
> > been superseded by hardware-accelerated crypto instructions directly on
> > the CPU as well as inline storage encryption (UFS/eMMC).
>
> For desktop, yes, but embedded still has quite a few of these, for example
> the STM32 crypto offload engine, and I expect quite a few FPGA based
> implementations exist, so this would require vendors to maintain a fork to
> keep their out-of-tree drivers functional when updating the kernel.
>
> POWER also has an asynchronous offload engine with AES, SHA and gzip
> support, these are significantly faster than the CPU.
Do you know if anyone is actually still using a legacy-style accelerator with
fscrypt, and if so what specific performance improvements are they getting?
Arguing that legacy-style crypto acceleration could theoretically be useful in
general isn't really relevant here. What's relevant here is whether it's
actually useful and worthwhile with this specific kernel subsystem.
As I mentioned, fscrypt has never been optimized for legacy-style accelerators
anyway, and no one has ever tried to do so. It just hasn't been relevant.
Meanwhile, the real feedback I *do* get from users is that these drivers are
causing problems for users, since the Crypto API (unwisely) enables them by
default and thus fscrypt uses them by default.
There are people who do care about some of these drivers, but they tend to be
the manufacturer of the hardware, not the users. To me it seems like more of a
check-box exercise than something that is actually worth using in practice.
> If a buggy engine passes self-test, can this simply be fixed by adding more
> tests? :>
The crypto self-tests are disabled by default, just like any other kernel
subsystem. They are supposed to be run before a kernel is released, but for
most of the drivers they aren't, since people don't have the hardware. Thus, a
lot of drivers in-tree don't even pass the tests we do have.
Some distros do enable the crypto self-tests in production kernels, but only the
fast tests; the full set of tests is too slow to enable in production. But even
the full tests don't properly test the hardware offload drivers, which have
unique challenges that do not exist in software code.
- Eric
next prev parent reply other threads:[~2025-06-12 0:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 20:58 [PATCH] fscrypt: don't use hardware offload Crypto API drivers Eric Biggers
2025-06-12 0:21 ` Simon Richter
2025-06-12 0:59 ` Eric Biggers [this message]
2025-06-12 6:25 ` Eric Biggers
2025-06-12 8:50 ` Giovanni Cabiddu
2025-06-12 15:57 ` Eric Biggers
2025-06-13 1:23 ` Eric Biggers
2025-06-13 11:10 ` Giovanni Cabiddu
2025-06-25 6:32 ` Eric Biggers
2025-06-25 12:44 ` Theodore Ts'o
2025-06-25 18:38 ` Eric Biggers
2025-06-25 16:29 ` Maxime MERE
2025-06-25 19:17 ` Eric Biggers
2025-06-13 9:01 ` Maxime MERE
2025-06-13 14:42 ` Eric Biggers
2025-06-25 16:29 ` Maxime MERE
2025-06-25 18:57 ` Eric Biggers
2025-06-26 2:36 ` Eric Biggers
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=20250612005914.GA546455@google.com \
--to=ebiggers@kernel.org \
--cc=Simon.Richter@hogyros.de \
--cc=ceph-devel@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.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