Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Bartosz Golaszewski <brgl@kernel.org>
Cc: Demi Marie Obenour <demiobenour@gmail.com>,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] drivers/crypto: Mark QCE as BROKEN
Date: Thu, 23 Jul 2026 19:06:08 -0700	[thread overview]
Message-ID: <20260724020608.GA51735@sol> (raw)
In-Reply-To: <CAMRc=Me55rUmjjR+ZzdWd2ss9JJMZzJch0zKd4GqONBjCzFMYQ@mail.gmail.com>

On Wed, Jul 22, 2026 at 01:33:51AM -0700, Bartosz Golaszewski wrote:
> We can offload crypto operations to the QCE saving CPU cycles

Here are benchmark results for SHA-256 on the SM8650 HDK, hashing 50000
4096-byte messages (matching dm-verity's and fsverity's workloads), with
all your pending patches applied:

sha256-lib (i.e. ARMv8 CE):

    Wall-clock elapsed time: 0.10s
    CPU time used: 0.10s
    CPU time spent in hardirq context: 0.00s
    CPU time spent in softirq context: 0.00s

sha256-qce:

    Wall-clock elapsed time: 10.76s
    CPU time used: 5.14s
    CPU time spent in hardirq context: 0.77s
    CPU time spent in softirq context: 2.31s

So sha256-qce is over 100 times slower and uses over 50 times more CPU
than ARMv8 CE, over half of that in hardirq or softirq context.

This was even worse than what I got last time I tried this!  So I tried
rolling back your BAM locking patches:

    Wall-clock elapsed time: 4.85s
    CPU time used: 2.78s
    CPU time spent in hardirq context: 0.55s
    CPU time spent in softirq context: 0.94s

That's more in line with what I measured last time I tried this, but
still atrocious.  It's still far more CPU time used than just doing the
hashing on the CPU, and much of it spent in hardirq and softirq
contexts.  The BAM locking just makes it even worse.

With that, plus the security claims not panning out either when
considering the actual code and usage in Linux, and also all the bugs
(both historical and current unfixed ones), I don't think there's any
credibility left.  This legacy driver should just be deleted.

To be clear: completely separate from QCE, Qualcomm SoCs have good
support for crypto acceleration in ICE and the ARMv8 CE.  That's great!
And that is, of course, what is *actually* being used in Linux.  That's
what we'll support.  Let's stop wasting time on a dead-end approach.

I understand there may be a desire to keep this driver around so that
support for restricted media content can be added to it.  However, that
would be new functionality that has nothing to do with what the driver
currently does and doesn't use the kernel's crypto API.  There's no need
to keep the driver around for this.  Just put together a clean proposal
to add a new version of the driver with just the needed functionality
(note that drivers/crypto/ probably won't be the right place for it).

- Eric


      parent reply	other threads:[~2026-07-24  2:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12 21:31 [PATCH v2] drivers/crypto: Mark QCE as BROKEN Demi Marie Obenour via B4 Relay
2026-07-13  2:57 ` Eric Biggers
2026-07-13  4:47 ` Greg KH
2026-07-13 13:07   ` Eric Biggers
2026-07-13 13:19     ` Greg KH
2026-07-13 14:42     ` Demi Marie Obenour
2026-07-13 15:31       ` Greg KH
2026-07-13 19:49         ` Demi Marie Obenour
2026-07-13 19:56           ` Demi Marie Obenour
2026-07-17  8:18 ` Herbert Xu
2026-07-21  8:24   ` Bartosz Golaszewski
2026-07-21 18:29     ` Demi Marie Obenour
2026-07-22  8:33       ` Bartosz Golaszewski
2026-07-22 15:46         ` Demi Marie Obenour
2026-07-22 16:33           ` Eric Biggers
2026-07-22 16:20         ` Eric Biggers
2026-07-23  9:44           ` Bartosz Golaszewski
2026-07-23 14:17             ` Eric Biggers
2026-07-23 20:58               ` Eric Biggers
2026-07-24  2:06         ` 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=20260724020608.GA51735@sol \
    --to=ebiggers@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=davem@davemloft.net \
    --cc=demiobenour@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=stable@vger.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