Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH 00/29] crypto: talitos - Driver cleanup
@ 2026-05-28  9:08 Paul Louvel
  2026-05-28  9:08 ` [PATCH 01/29] crypto: talitos/hash - Use CRYPTO_AHASH_BLOCK_ONLY API Paul Louvel
                   ` (28 more replies)
  0 siblings, 29 replies; 36+ messages in thread
From: Paul Louvel @ 2026-05-28  9:08 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller
  Cc: Thomas Petazzoni, Herve Codina, Christophe Leroy, linux-crypto,
	linux-kernel, Paul Louvel

The Freescale Integrated Security Engine (SEC) aka "Talitos" driver
implementation is a monolithic ~3800-line file that mixes SEC1 and SEC2
hardware variants with hash, skcipher, aead and hwrng algorithm.

This series reorganises the driver to improve readability and
maintainability.
One of the main motivation for this series is to eleminate all the
conditionals around the has_ftr_sec1(). Some checks still remains in
crypto algorithm implementation at the end of the series.

Patch 1 adds the CRYPTO_AHASH_ALG_BLOCK_ONLY flag for the ahash
implementation to eliminate manual partial-block buffering.

Driver reorganisation (patches 2-9):

  Move the driver into a dedicated directory, split the different crypto
  implementation into dedicated translation units.

Algorithm definition cleanup (patches 10-17):

  Remove algorithm property mutations from the registration loop, delete
  the now-unused priority field in struct talitos_alg_template, and
  convert hash, skcipher and aead to the type-specific init_tfm/exit_tfm
  API, replacing the deprecated cra_init/cra_exit fields.

  Use preprocessor macros to deduplicate the hash, skcipher and aead
  algorithm definitions.

SEC1/SEC2 ops abstraction (patches 18-27):

  Introduce struct talitos_ops, split SEC1/SEC2-specific
  code into separate function variants, and replace runtime is_sec1
  conditionals with indirect calls through the ops table.

  Export common channel and error handling routines, and move SEC1 and
  SEC2 ops into dedicated translation units.

  Introduce struct talitos_ptr_ops to abstract SEC1/SEC2 pointer
  helpers behind per-SEC-version ops, then remove the now-unused
  global pointer helper functions.

  Introduce per-SEC-version descriptor structures and ops.

Patch 28 cleans up the includes in the core driver file now that all
crypto implementation code has been moved out.

Patch 29 removes a now-useless macro.

No functional changes are intended for patches 2-29.

This series depends on the "crypto: talitos - bug fixes" series :
https://patch.msgid.link/20260507-bootlin_test-7-1-rc1_sec_bugfix-v3-0-c98d7589b942@bootlin.com

Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
Paul Louvel (29):
      crypto: talitos/hash - Use CRYPTO_AHASH_BLOCK_ONLY API
      crypto: talitos - Move driver into dedicated directory
      crypto: talitos - Add missing includes to driver header file
      crypto: talitos/hwrng - Move into separate file
      crypto: talitos - Prepare crypto implementation file splitting
      crypto: talitos - Introduce registration helper
      crypto: talitos/hash - Move into separate file
      crypto: talitos/skcipher - Move into separate file
      crypto: talitos/aead - Move into separate file
      crypto: talitos - Remove alg settings in talitos_register_common()
      crypto: talitos - Remove unused priority field in struct talitos_alg_template
      crypto: talitos/hash - Convert to init_tfm/exit_tfm type-specific API
      crypto: talitos/skcipher - Convert to init/exit type-specific API
      crypto: talitos/aead - Convert to init/exit type-specific API
      crypto: talitos/hash - Use macro for algorithm definitions
      crypto: talitos/skcipher - Use macro for algorithm definitions
      crypto: talitos/aead - Use macro for algorithm definitions
      crypto: talitos - Split SEC1/SEC2 code into separate function variants
      crypto: talitos - Introduce struct talitos_ops
      crypto: talitos - Replace SEC1/SEC2 conditionals with ops dispatch
      crypto: talitos - Export common channel and error handling routines
      crypto: talitos - Move SEC1 ops into talitos-sec1.c
      crypto: talitos - Move SEC2 ops into talitos-sec2.c
      crypto: talitos - Introduce per-SEC-version pointer helper ops
      crypto: talitos - Dispatch pointer helpers through ptr_ops
      crypto: talitos - Remove now-unused global pointer helpers
      crypto: talitos - Introduce per-SEC-version descriptor structures and ops
      crypto: talitos - Clean up includes in core driver file
      crypto: talitos - Remove TALITOS_DESC_SIZE macro

 drivers/crypto/Kconfig                    |   38 +-
 drivers/crypto/Makefile                   |    2 +-
 drivers/crypto/talitos.c                  | 3640 -----------------------------
 drivers/crypto/talitos/Kconfig            |   36 +
 drivers/crypto/talitos/Makefile           |    6 +
 drivers/crypto/talitos/talitos-aead.c     |  677 ++++++
 drivers/crypto/talitos/talitos-hash.c     |  711 ++++++
 drivers/crypto/talitos/talitos-rng.c      |   93 +
 drivers/crypto/talitos/talitos-sec1.c     |  374 +++
 drivers/crypto/talitos/talitos-sec2.c     |  404 ++++
 drivers/crypto/talitos/talitos-skcipher.c |  364 +++
 drivers/crypto/talitos/talitos.c          |  917 ++++++++
 drivers/crypto/{ => talitos}/talitos.h    |  255 +-
 13 files changed, 3810 insertions(+), 3707 deletions(-)
---
base-commit: db8b9f227833e729faf44a512aa1e88a625b5ad8
change-id: 20260518-7-1-rc1_talitos_cleanup-9231a64e29fa
prerequisite-change-id: 20260504-bootlin_test-7-1-rc1_sec_bugfix-13169ed07ddc:v3
prerequisite-patch-id: 7b364911e4b8d1c1033eb14e67ed24dac6a4bc13
prerequisite-patch-id: 2c1cd7fdd003d9a116a697efa25d1716d548389f
prerequisite-patch-id: b12bdbf565747609e0cfe0609a42cf69b5d816a1
prerequisite-patch-id: 72cb2bc0fc2a48a5a029b049c199f4c86085cf04
prerequisite-patch-id: 5f1f5ad6add760161bd48875df48c0893aa12613
prerequisite-patch-id: 934931086968229434d15a2f2358aeb7e6975a1d
prerequisite-patch-id: 8a0b4828fc0690e0c841bc9adcc6568bb522e0e8
prerequisite-patch-id: 1d870f32e7dbf9a8bd3b8979558544107693e0f4
prerequisite-patch-id: 758c18d7c9fabb14bd90df62e5e8a62a6f880db4
prerequisite-patch-id: ce6e9e585f8edc1861ae6bb8fbdd836c20cbd290
prerequisite-patch-id: 9446dc03e442ea81c5f5b39e802e01b37da29971

Best regards,
--  
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2026-05-29 16:25 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28  9:08 [PATCH 00/29] crypto: talitos - Driver cleanup Paul Louvel
2026-05-28  9:08 ` [PATCH 01/29] crypto: talitos/hash - Use CRYPTO_AHASH_BLOCK_ONLY API Paul Louvel
2026-05-29 11:25   ` Christophe Leroy (CS GROUP)
2026-05-28  9:08 ` [PATCH 02/29] crypto: talitos - Move driver into dedicated directory Paul Louvel
2026-05-29 11:25   ` Christophe Leroy (CS GROUP)
2026-05-28  9:08 ` [PATCH 03/29] crypto: talitos - Add missing includes to driver header file Paul Louvel
2026-05-29 11:26   ` Christophe Leroy (CS GROUP)
2026-05-28  9:08 ` [PATCH 04/29] crypto: talitos/hwrng - Move into separate file Paul Louvel
2026-05-29 11:26   ` Christophe Leroy (CS GROUP)
2026-05-28  9:08 ` [PATCH 05/29] crypto: talitos - Prepare crypto implementation file splitting Paul Louvel
2026-05-29 13:21   ` Christophe Leroy (CS GROUP)
2026-05-29 16:24     ` David Laight
2026-05-28  9:08 ` [PATCH 06/29] crypto: talitos - Introduce registration helper Paul Louvel
2026-05-28  9:08 ` [PATCH 07/29] crypto: talitos/hash - Move into separate file Paul Louvel
2026-05-28  9:08 ` [PATCH 08/29] crypto: talitos/skcipher " Paul Louvel
2026-05-28  9:08 ` [PATCH 09/29] crypto: talitos/aead " Paul Louvel
2026-05-28  9:08 ` [PATCH 10/29] crypto: talitos - Remove alg settings in talitos_register_common() Paul Louvel
2026-05-28  9:08 ` [PATCH 11/29] crypto: talitos - Remove unused priority field in struct talitos_alg_template Paul Louvel
2026-05-28  9:08 ` [PATCH 12/29] crypto: talitos/hash - Convert to init_tfm/exit_tfm type-specific API Paul Louvel
2026-05-28  9:08 ` [PATCH 13/29] crypto: talitos/skcipher - Convert to init/exit " Paul Louvel
2026-05-28  9:08 ` [PATCH 14/29] crypto: talitos/aead " Paul Louvel
2026-05-28  9:08 ` [PATCH 15/29] crypto: talitos/hash - Use macro for algorithm definitions Paul Louvel
2026-05-28  9:08 ` [PATCH 16/29] crypto: talitos/skcipher " Paul Louvel
2026-05-28  9:08 ` [PATCH 17/29] crypto: talitos/aead " Paul Louvel
2026-05-28  9:08 ` [PATCH 18/29] crypto: talitos - Split SEC1/SEC2 code into separate function variants Paul Louvel
2026-05-28  9:08 ` [PATCH 19/29] crypto: talitos - Introduce struct talitos_ops Paul Louvel
2026-05-28  9:08 ` [PATCH 20/29] crypto: talitos - Replace SEC1/SEC2 conditionals with ops dispatch Paul Louvel
2026-05-28  9:08 ` [PATCH 21/29] crypto: talitos - Export common channel and error handling routines Paul Louvel
2026-05-28  9:08 ` [PATCH 22/29] crypto: talitos - Move SEC1 ops into talitos-sec1.c Paul Louvel
2026-05-28  9:08 ` [PATCH 23/29] crypto: talitos - Move SEC2 ops into talitos-sec2.c Paul Louvel
2026-05-28  9:08 ` [PATCH 24/29] crypto: talitos - Introduce per-SEC-version pointer helper ops Paul Louvel
2026-05-28  9:08 ` [PATCH 25/29] crypto: talitos - Dispatch pointer helpers through ptr_ops Paul Louvel
2026-05-28  9:08 ` [PATCH 26/29] crypto: talitos - Remove now-unused global pointer helpers Paul Louvel
2026-05-28  9:08 ` [PATCH 27/29] crypto: talitos - Introduce per-SEC-version descriptor structures and ops Paul Louvel
2026-05-28  9:08 ` [PATCH 28/29] crypto: talitos - Clean up includes in core driver file Paul Louvel
2026-05-28  9:08 ` [PATCH 29/29] crypto: talitos - Remove TALITOS_DESC_SIZE macro Paul Louvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox