Skip to content

crypto: permit asynchronous skciphers as driver fallbacks

Ard Biesheuvel linux-amlogic linux-arm-kernel linux-crypto linux-omap 4 versions – Applied

Status from this message: This series was applied to khilman/linux-amlogic.git (refs/heads/for-next).

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest13 patches 3 repliesApplied
  2. v313 patches 8 repliesSuperseded
  3. v213 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v112 patches0 repliesSuperseded

Changes in v4 from the cover letter

- add missing kerneldoc updates for sun8i-ce and sun8i-ss
- add acks from Horia, Jamie and Corentin
- rebase onto cryptodev/master

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/13crypto: amlogic-gxl - default to build as moduledrivers/crypto/amlogic/Kconfig+1 -10 replies
2/13crypto: amlogic-gxl - permit async skcipher as fallbackdrivers/crypto/amlogic/amlogic-gxl-cipher.c drivers/crypto/amlogic/amlogic-gxl.h+15 -150 replies
3/13crypto: omap-aes - permit asynchronous skcipher as fallbackdrivers/crypto/omap-aes.c drivers/crypto/omap-aes.h+19 -190 replies
4/13crypto: sun4i - permit asynchronous skcipher as fallbackdrivers/crypto/allwinner/sun4i-ss/sun4i-ss-cipher.c drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h+25 -240 replies
5/13crypto: sun8i-ce - permit asynchronous skcipher as fallbackdrivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h+25 -241 reply
6/13crypto: sun8i-ss - permit asynchronous skcipher as fallbackdrivers/crypto/allwinner/sun8i-ss/sun8i-ss-cipher.c drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h+34 -310 replies
7/13crypto: ccp - permit asynchronous skcipher as fallbackdrivers/crypto/ccp/ccp-crypto-aes-xts.c drivers/crypto/ccp/ccp-crypto.h+19 -181 reply
8/13crypto: chelsio - permit asynchronous skcipher as fallbackdrivers/crypto/chelsio/chcr_algo.c drivers/crypto/chelsio/chcr_crypto.h+25 -350 replies
9/13crypto: mxs-dcp - permit asynchronous skcipher as fallbackdrivers/crypto/mxs-dcp.c+17 -160 replies
10/13crypto: picoxcell - permit asynchronous skcipher as fallbackdrivers/crypto/picoxcell_crypto.c+22 -160 replies
11/13crypto: qce - permit asynchronous skcipher as fallbackdrivers/crypto/qce/cipher.h drivers/crypto/qce/skcipher.c+24 -210 replies
12/13crypto: sahara - permit asynchronous skcipher as fallbackdrivers/crypto/sahara.c+45 -510 replies
13/13crypto: mediatek - use AES library for GCM key derivationdrivers/crypto/Kconfig drivers/crypto/mediatek/mtk-aes.c+9 -570 replies

Reviews trailers per patch

6 of 13 patches have a Reviewed-by or Acked-by.

PatchCorentin LabbeHoria GeantăJamie IlesJohn Allen
1/13T-b
2/13T-b
3/13
4/13T-b
5/13A-b T-b
6/13A-b
7/13A-b
8/13
9/13R-b
10/13R-b
11/13
12/13R-b
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/13] crypto: permit asynchronous skciphers as driver fallbacks

The drivers for crypto accelerators in drivers/crypto all implement skciphers of an asynchronous nature, given that they are backed by hardware DMA that completes asynchronously wrt the execution flow.

However, in many cases, any fallbacks they allocate are limited to the synchronous variety, which rules out the use of SIMD implementations of AES in ECB, CBC and XTS modes, given that they are usually built on top of the asynchronous SIMD helper, which queues requests for asynchronous completion if they are issued from a context that does not permit the use of the SIMD register file.

This may result in sub-optimal AES implementations to be selected as fallbacks, or even less secure ones if the only synchronous alternative is table based, and therefore not time invariant.

So switch all these cases over to the asynchronous API, by moving the subrequest into the skcipher request context, and permitting it to complete asynchronously via the caller provided completion function.

Patch #1 is not related, but touches the same driver as #2 so it is included anyway. Patch #13 removes another sync skcipher allocation by switching to the AES library interface.

v4:
- add missing kerneldoc updates for sun8i-ce and sun8i-ss
- add acks from Horia, Jamie and Corentin
- rebase onto cryptodev/master

v3:
- disregard the fallback skcipher_request when taking the request context size for TFMs that don't need the fallback at all (picoxcell, qce)
- fix error handling in fallback skcipher allocation and remove pointless memset()s (qce)

v2:
- address issue found by build robot in patch #7
- add patch #13
- rebase onto cryptodev/master

Cc Corentin Labbe <[email protected]>
Cc Corentin Labbe <[email protected]>
Cc Herbert Xu <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc Tom Lendacky <[email protected]>
Cc John Allen <[email protected]>
Cc Ayush Sawal <[email protected]>
Cc Vinay Kumar Yadav <[email protected]>
Cc Rohit Maheshwari <[email protected]>
Cc Shawn Guo <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Pengutronix Kernel Team <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc NXP Linux Team <[email protected]>
Cc Jamie Iles <[email protected]>
Cc Eric Biggers <[email protected]>
Cc Tero Kristo <[email protected]>
Cc Matthias Brugger <[email protected]>
Cc Horia Geantă <[email protected]>

Ard Biesheuvel (13):
crypto: amlogic-gxl - default to build as module
crypto: amlogic-gxl - permit async skcipher as fallback
crypto: omap-aes - permit asynchronous skcipher as fallback
crypto: sun4i - permit asynchronous skcipher as fallback
crypto: sun8i-ce - permit asynchronous skcipher as fallback
crypto: sun8i-ss - permit asynchronous skcipher as fallback
crypto: ccp - permit asynchronous skcipher as fallback
crypto: chelsio - permit asynchronous skcipher as fallback
crypto: mxs-dcp - permit asynchronous skcipher as fallback
crypto: picoxcell - permit asynchronous skcipher as fallback
crypto: qce - permit asynchronous skcipher as fallback
crypto: sahara - permit asynchronous skcipher as fallback
crypto: mediatek - use AES library for GCM key derivation

 drivers/crypto/Kconfig                        |  3 +-
 .../allwinner/sun4i-ss/sun4i-ss-cipher.c      | 46 ++++-----
 drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h  |  3 +-
 .../allwinner/sun8i-ce/sun8i-ce-cipher.c      | 41 ++++----
 drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h  |  8 +-
 .../allwinner/sun8i-ss/sun8i-ss-cipher.c      | 39 ++++----
 drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h  | 26 ++---
 drivers/crypto/amlogic/Kconfig                |  2 +-
 drivers/crypto/amlogic/amlogic-gxl-cipher.c   | 27 +++---
 drivers/crypto/amlogic/amlogic-gxl.h          |  3 +-
 drivers/crypto/ccp/ccp-crypto-aes-xts.c       | 33 ++++---
 drivers/crypto/ccp/ccp-crypto.h               |  4 +-
 drivers/crypto/chelsio/chcr_algo.c            | 57 +++++------
 drivers/crypto/chelsio/chcr_crypto.h          |  3 +-
 drivers/crypto/mediatek/mtk-aes.c             | 63 ++----------
 drivers/crypto/mxs-dcp.c                      | 33 +++----
 drivers/crypto/omap-aes.c                     | 35 ++++---
 drivers/crypto/omap-aes.h                     |  3 +-
 drivers/crypto/picoxcell_crypto.c             | 38 ++++----
 drivers/crypto/qce/cipher.h                   |  3 +-
 drivers/crypto/qce/skcipher.c                 | 42 ++++----
 drivers/crypto/sahara.c                       | 96 +++++++++----------
 22 files changed, 280 insertions(+), 328 deletions(-)
Signature · 1 line
2.17.1