Re: [PATCH] crypto: qce - Replace with stub driver
Demi Marie Obenour <[email protected]> Fri, 31 Jul 2026 01:32:11 -0400
| Newsgroups | org.kernel.vger.linux-crypto,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------8Y1ZwW6gByfOgAxE8eSRugEz Content-Type: multipart/mixed; boundary="------------92vHKN2OdgGoaT10ogyC5U4F"; protected-headers="v1"; hp="clear" Message-ID: <[email protected]> Date: Fri, 31 Jul 2026 01:32:11 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] crypto: qce - Replace with stub driver To: Eric Biggers <[email protected]>, [email protected], Herbert Xu <[email protected]> Cc: [email protected], [email protected], [email protected], Bartosz Golaszewski <[email protected]>, Kuldeep Singh <[email protected]>, Dmitry Baryshkov <[email protected]>, Konrad Dybcio <[email protected]>, Greg Kroah-Hartman <[email protected]> References: <[email protected]> Content-Language: en-US From: Demi Marie Obenour <[email protected]> Autocrypt: [email protected]; keydata= xsFNBFp+A0oBEADffj6anl9/BHhUSxGTICeVl2tob7hPDdhHNgPR4C8xlYt5q49yB+l2nipd aq+4Gk6FZfqC825TKl7eRpUjMriwle4r3R0ydSIGcy4M6eb0IcxmuPYfbWpr/si88QKgyGSV Z7GeNW1UnzTdhYHuFlk8dBSmB1fzhEYEk0RcJqg4AKoq6/3/UorR+FaSuVwT7rqzGrTlscnT DlPWgRzrQ3jssesI7sZLm82E3pJSgaUoCdCOlL7MMPCJwI8JpPlBedRpe9tfVyfu3euTPLPx wcV3L/cfWPGSL4PofBtB8NUU6QwYiQ9Hzx4xOyn67zW73/G0Q2vPPRst8LBDqlxLjbtx/WLR 6h3nBc3eyuZ+q62HS1pJ5EvUT1vjyJ1ySrqtUXWQ4XlZyoEFUfpJxJoN0A9HCxmHGVckzTRl 5FMWo8TCniHynNXsBtDQbabt7aNEOa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RK+tSUe/u3wdLRDPwv/DTzGI36Kgky9MsDC5gpIwNbOJP2G/q1wT1o Gkw4IXfWv2ufWiXqJ+k7HEi2N1sree7Dy9KBCqb+ca1vFhYPDJfhP75I/VnzHVssZ/rYZ9+5 1yDoUABoNdJNSGUYl+Yh9Pw9pE3Kt4EFzUlFZWbE4xKL/NPno+z4J9aWemLLszcYz/u3XnbO vUSQHSrmfOzX3cV4yfmjM5lewgSstoxGyTx2M8enslgdXhPthZlDnTnOT+C+OTsh8+m5tos8 HQjaPM01MKBiAqdPgksm1wu2DrrwUi6ChRVTUBcj6+/9IJ81H2P2gJk3Ls3AVIxIffLoY34E +MYSfkEjBz0E8CLOcAw7JIwAaeBT In-Reply-To: <[email protected]> --------------92vHKN2OdgGoaT10ogyC5U4F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 7/31/26 01:08, Eric Biggers wrote: > None of the algorithms the QCE driver registers with the crypto API are= > even close to being useful. They're massively outperformed by the > CPU-based crypto (even actually using far more CPU cycles than the > CPU-based crypto, due to the massive driver overhead), don't provide an= y > security benefits over the CPU-based crypto, and have various other > issues. They're also unrelated to the Inline Crypto Engine which works= > far better and is what is actually being used these days. >=20 > Due to the major performance problems people experienced when > accidentally using this driver, the algorithms were already demoted to > below the priority of ARMv8 CE in the crypto API several years ago. > Regardless of priority, these algorithms also aren't compatible with th= e > most common uses of in-kernel crypto; for example, they don't support > dm-crypt because they allocate memory, and they don't support IPsec > since they take a mutex which isn't compatible with softirq context. >=20 > It's time to move on and just drop this obsolete functionality entirely= =2E >=20 > However, the driver does serve one purpose which is to bind to the > devicetree node and allow the interconnects to scale down (though even > that part is broken, as it holds static interconnect bandwidth votes). >=20 > Thus, clear out the crypto functionality, leaving just a stub driver > that drops the interconnection bandwidth votes to zero. >=20 > Tested on the SM8650 HDK. >=20 > Signed-off-by: Eric Biggers <[email protected]> Some thoughts: 1. Should this be put under a different subdirectory? This is now a power management driver, not a crypto driver. IMO it should just fall under ARCH_QCOM, without a separate Kconfig entry (or at least a "default y" one). 2. Should it be re-added to the defconfigs? Most distros will want to turn it on, as it saves power and is minuscule. 3. Will this the smallest driver in the whole kernel? > --- > drivers/crypto/Kconfig | 117 +---- > drivers/crypto/qce/Makefile | 7 - > drivers/crypto/qce/aead.c | 787 ----------------------------------= > drivers/crypto/qce/aead.h | 56 --- > drivers/crypto/qce/cipher.h | 56 --- > drivers/crypto/qce/common.c | 564 ------------------------ > drivers/crypto/qce/common.h | 94 ---- > drivers/crypto/qce/core.c | 271 ------------ > drivers/crypto/qce/core.h | 64 --- > drivers/crypto/qce/dma.c | 135 ------ > drivers/crypto/qce/dma.h | 47 -- > drivers/crypto/qce/qcrypto.c | 43 ++ > drivers/crypto/qce/regs-v5.h | 322 -------------- > drivers/crypto/qce/sha.c | 498 --------------------- > drivers/crypto/qce/sha.h | 71 --- > drivers/crypto/qce/skcipher.c | 434 ------------------- > 16 files changed, 50 insertions(+), 3516 deletions(-) > delete mode 100644 drivers/crypto/qce/aead.c > delete mode 100644 drivers/crypto/qce/aead.h > delete mode 100644 drivers/crypto/qce/cipher.h > delete mode 100644 drivers/crypto/qce/common.c > delete mode 100644 drivers/crypto/qce/common.h > delete mode 100644 drivers/crypto/qce/core.c > delete mode 100644 drivers/crypto/qce/core.h > delete mode 100644 drivers/crypto/qce/dma.c > delete mode 100644 drivers/crypto/qce/dma.h > create mode 100644 drivers/crypto/qce/qcrypto.c > delete mode 100644 drivers/crypto/qce/regs-v5.h > delete mode 100644 drivers/crypto/qce/sha.c > delete mode 100644 drivers/crypto/qce/sha.h > delete mode 100644 drivers/crypto/qce/skcipher.c >=20 > diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig > index 0189dfdcbbe1..03113ad3467c 100644 > --- a/drivers/crypto/Kconfig > +++ b/drivers/crypto/Kconfig > @@ -527,119 +527,16 @@ source "drivers/crypto/marvell/Kconfig" > source "drivers/crypto/intel/Kconfig" > =20 > config CRYPTO_DEV_QCE > - tristate "Qualcomm crypto engine accelerator" > - depends on (BROKEN && ARCH_QCOM) || COMPILE_TEST > + tristate "Qualcomm crypto engine" > + depends on ARCH_QCOM || COMPILE_TEST > depends on HAS_IOMEM > help > - This driver supports Qualcomm crypto engine accelerator > - hardware. To compile this driver as a module, choose M here. The > - module will be called qcrypto. > - > - This driver does not have exclusive access to the > - hardware, causing races with the secure world. It > - is also slower than the CPU. > + This driver provides a stub for the Qualcomm crypto engine. It exis= ts > + only to bind to the devicetree node and allow interconnects to scal= e > + down, saving power. It doesn't expose any cryptographic functionali= ty. Should this mention why the cryptographic functionality available in the hardware has been proven unsuitable for use? --=20 Sincerely, Demi Marie Obenour (she/her/hers) --------------92vHKN2OdgGoaT10ogyC5U4F-- --------------8Y1ZwW6gByfOgAxE8eSRugEz Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEopQtqVJW1aeuo9/sszaHOrMp8lMFAmpsM2gACgkQszaHOrMp 8lMpZQ//XmVsj3tB3HhWXcYdo+MuFGqo0LEB/WLs84lQS9j/8jPpEEXLR2LBjNff pd8Oip7/yDaN6I5K7bSUKBHFjVZYZ1EuAP89pgQGk3zkUdTz6q7gpop65PbU1+nO 55YRhqbDOeD3PDue2JswDg2gVljwqCjbifxHiQBTl0UsTWv2aMJ4u30Ca9ml9DCy 0UCr2C8bjjLcY3m8NTpJSglU3biU7JOOBlw4ie/mQcmKk+LlvLjNWam/hQpDfU4Z xNOva6EVAQ6q5fwy/AeZ3BP0ItDaoxcjjb0pfO2VNe9Cj/JO2pXp5LzlujaD7EAi eBFjCFlzNKkrOvwTuaeDUf0hXS/fpr44VxURHjz5RWl5ygSjIktmCFMvA8GK1+SM 39xoAE1VsTCG+jCRM/fou4MbtBZPLgqNGE8g6KPoItKYJqb2cMRWZOVxHge/6ex1 FBKyITbYiuYmazv0obKDSwuJO9h+D+a2gg8hBLyliTap+/d846gQMxQ9fhDWOGhQ kspyE+OnneI2zQzURHpd5rxvqIMPhmwi0PLCzQYCHhwjF13wVnxsJg2qOarpzT41 qOE+XazlsoxTJjsARymKMd3SfReNKmJYMpqSDi+5gX4LDe1CK3Dqb3JuA1lvsWzf e3AQeZuL/67+fbt5rYZ2hoUpnFRMXqijqH8gR4ThSVpQ2Fnjypc= =5vyR -----END PGP SIGNATURE----- --------------8Y1ZwW6gByfOgAxE8eSRugEz--