linux/drivers/crypto
Maxime Méré 3525fe4752 crypto: stm32/hash - add full DMA support for stm32mpx
Due to a lack of alignment in the data sent by requests, the actual DMA
support of the STM32 hash driver is only working with digest calls.
This patch, based on the algorithm used in the driver omap-sham.c,
allows for the usage of DMA in any situation.

It has been functionally tested on STM32MP15, STM32MP13 and STM32MP25.

By checking the performance of this new driver with OpenSSL, the
following results were found:

Performance:

(datasize: 4096, number of hashes performed in 10s)

|type   |no DMA    |DMA support|software  |
|-------|----------|-----------|----------|
|md5    |13873.56k |10958.03k  |71163.08k |
|sha1   |13796.15k |10729.47k  |39670.58k |
|sha224 |13737.98k |10775.76k  |22094.64k |
|sha256 |13655.65k |10872.01k  |22075.39k |

CPU Usage:

(algorithm used: sha256, computation time: 20s, measurement taken at
~10s)

|datasize  |no DMA |DMA  | software |
|----------|-------|-----|----------|
|  2048    | 56%   | 49% | 50%      |
|  4096    | 54%   | 46% | 50%      |
|  8192    | 53%   | 40% | 50%      |
| 16384    | 53%   | 33% | 50%      |

Note: this update doesn't change the driver performance without DMA.

As shown, performance with DMA is slightly lower than without, but in
most cases, it will save CPU time.

Signed-off-by: Maxime Méré <maxime.mere@foss.st.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2024-04-19 18:54:19 +08:00
..
allwinner This update includes the following changes: 2024-03-15 14:46:54 -07:00
amcc crypto: crypto4xx - Remove cfb and ofb 2023-12-08 11:59:45 +08:00
amlogic crypto: amlogic - Use helper to set reqsize 2023-12-29 11:25:55 +08:00
aspeed crypto: aspeed - Remove cfb and ofb 2023-12-08 11:59:45 +08:00
axis crypto: artpec6 - Use helper to set reqsize 2023-12-29 11:25:55 +08:00
bcm crypto: bcm - Fix pointer arithmetic 2024-04-02 10:49:39 +08:00
caam crypto: caam - fix asynchronous hash 2024-01-26 16:35:55 +08:00
cavium crypto: nitrox - Remove cfb 2023-12-08 11:59:46 +08:00
ccp crypto: ccp - drop platform ifdef checks 2024-04-12 15:07:51 +08:00
ccree crypto: ccree - Remove ofb 2023-12-08 11:59:46 +08:00
chelsio crypto: chelsio - stop using crypto_ahash::init 2023-10-27 18:04:29 +08:00
gemini crypto: sl3516 - Use helper to set reqsize 2023-12-29 11:25:55 +08:00
hisilicon crypto: hisilicon/qm - Add the err memory release process to qm uninit 2024-04-12 15:07:53 +08:00
inside-secure crypto: safexcel - Remove cfb and ofb 2023-12-08 11:59:46 +08:00
intel crypto: qat - improve error logging to be consistent across features 2024-04-19 18:54:19 +08:00
marvell crypto: octeontx2 - add missing check for dma_map_single 2024-04-19 18:54:18 +08:00
nx crypto: nx - Avoid -Wflex-array-member-not-at-end warning 2024-04-02 10:49:38 +08:00
qce crypto: qce - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
rockchip This update includes the following changes: 2024-03-15 14:46:54 -07:00
starfive crypto: starfive - Use dma for aes requests 2024-04-02 10:49:38 +08:00
stm32 crypto: stm32/hash - add full DMA support for stm32mpx 2024-04-19 18:54:19 +08:00
tegra crypto: tegra - Add Tegra Security Engine driver 2024-04-12 15:07:51 +08:00
virtio This update includes the following changes: 2024-03-15 14:46:54 -07:00
xilinx crypto: xilinx - call finalize with bh disabled 2024-02-09 12:57:18 +08:00
atmel-aes-regs.h
atmel-aes.c crypto: atmel - Remove cfb and ofb 2023-12-08 11:59:45 +08:00
atmel-authenc.h crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
atmel-ecc.c crypto: drivers - Explicitly include correct DT includes 2023-08-23 11:04:23 +08:00
atmel-i2c.c This update includes the following changes: 2023-02-21 18:10:50 -08:00
atmel-i2c.h This update includes the following changes: 2023-02-21 18:10:50 -08:00
atmel-sha204a.c crypto: atmel - Switch i2c drivers back to use .probe() 2023-06-02 18:21:32 +08:00
atmel-sha-regs.h
atmel-sha.c crypto: atmel - remove unnecessary alignmask for ahashes 2023-10-27 18:04:28 +08:00
atmel-tdes-regs.h
atmel-tdes.c crypto: atmel - Remove cfb and ofb 2023-12-08 11:59:45 +08:00
exynos-rng.c crypto: exynos-rng - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
geode-aes.c crypto: geode - use DEFINE_SPINLOCK() for spinlock 2021-04-16 21:16:31 +10:00
geode-aes.h
hifn_795x.c crypto: hifn_795x - Remove cfb and ofb 2023-12-08 11:59:46 +08:00
img-hash.c crypto: img-hash - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
Kconfig crypto: tegra - Add Tegra Security Engine driver 2024-04-12 15:07:51 +08:00
Makefile crypto: tegra - Add Tegra Security Engine driver 2024-04-12 15:07:51 +08:00
mxs-dcp.c crypto: mxs-dcp - remove unnecessary alignmask for ahashes 2023-10-27 18:04:28 +08:00
n2_asm.S
n2_core.c Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" 2024-03-06 13:07:39 -08:00
n2_core.h
omap-aes-gcm.c crypto: omap - Use new crypto_engine_op interface 2023-08-18 17:01:11 +08:00
omap-aes.c crypto: omap-aes - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
omap-aes.h crypto: omap - Use new crypto_engine_op interface 2023-08-18 17:01:11 +08:00
omap-crypto.c crypto: omap - Avoid redundant copy when using truncated sg list 2021-08-21 15:44:53 +08:00
omap-crypto.h
omap-des.c crypto: omap-des - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
omap-sham.c crypto: omap-sham - stop setting alignmask for ahashes 2023-10-27 18:04:29 +08:00
padlock-aes.c
padlock-sha.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
qcom-rng.c crypto: qcom-rng - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
s5p-sss.c crypto: s5p-sss - remove unnecessary alignmask for ahashes 2023-10-27 18:04:28 +08:00
sa2ul.c crypto: sa2ul - Return crypto_aead_setkey to transfer the error 2023-12-01 18:03:26 +08:00
sa2ul.h crypto: sa2ul - change unsafe data size limit to 255 bytes 2023-05-19 16:45:43 +08:00
sahara.c crypto: sahara - add support for crypto_engine 2023-12-29 11:25:56 +08:00
talitos.c crypto: talitos - stop using crypto_ahash::init 2023-10-27 18:04:29 +08:00
talitos.h crypto: talitos - Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper 2022-10-21 19:05:24 +08:00