Skip to content

crypto: x86 - split common glue code into helper modules

Jussi Kivilinna linux-crypto 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11crypto: ablk_helper - move ablk_* functions from serpent-sse2/avx glue code to shared modulearch/x86/crypto/Makefile arch/x86/crypto/ablk_helper.c arch/x86/crypto/serpent_avx_glue.c +3 more+201 -2180 replies
2/11crypto: twofish-avx - change to use shared ablk_* functionsarch/x86/crypto/twofish_avx_glue.c crypto/Kconfig+7 -1100 replies
3/11crypto: aes_ni - change to use shared ablk_* functionsarch/x86/crypto/ablk_helper.c arch/x86/crypto/aesni-intel_glue.c arch/x86/include/asm/crypto/ablk_helper.h +1 more+20 -1020 replies
4/11crypto: serpent-sse2 - prepare serpent-sse2 glue code into generic x86 glue code for 128bit block ciphersarch/x86/crypto/serpent_sse2_glue.c+303 -1630 replies
5/11crypto: serpent-sse2 - split generic glue code to new helper modulearch/x86/crypto/Makefile arch/x86/crypto/glue_helper.c arch/x86/crypto/serpent_sse2_glue.c +2 more+431 -3510 replies
6/11crypto: serpent-avx: remove duplicated glue code and use shared glue code from glue_helperarch/x86/crypto/serpent_avx_glue.c crypto/Kconfig+95 -3040 replies
7/11crypto: camellia-x86_64 - remove duplicated glue code and use shared glue code from glue_helperarch/x86/crypto/camellia_glue.c crypto/Kconfig+87 -2690 replies
8/11crypto: twofish-x86_64-3way - remove duplicated glue code and use shared glue code from glue_helperarch/x86/crypto/twofish_glue_3way.c crypto/Kconfig+94 -2720 replies
9/11crypto: twofish-avx - remove duplicated glue code and use shared glue code from glue_helperarch/x86/crypto/twofish_avx_glue.c arch/x86/crypto/twofish_glue_3way.c arch/x86/include/asm/crypto/twofish.h +1 more+162 -4870 replies
10/11crypto: move arch/x86/include/asm/serpent-{sse2|avx}.h to arch/x86/include/asm/crypto/arch/x86/crypto/serpent_avx_glue.c arch/x86/crypto/serpent_sse2_glue.c arch/x86/include/asm/crypto/serpent-avx.h +3 more+97 -970 replies
11/11crypto: move arch/x86/include/asm/aes.h to arch/x86/include/asm/crypto/arch/x86/crypto/aes_glue.c arch/x86/crypto/aesni-intel_glue.c arch/x86/include/asm/aes.h +1 more+13 -130 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] crypto: x86 - split common glue code into helper modules

Currently several block-ciphers in arch/x86/crypto duplicate glue code for using assembler implementations that process multiple blocks parallel. This patchset adds shared glue_helper module for these 128bit cipher modules to use.

Downside of generalisation of glue code is slightly increased overhead. Tcrypt test results of camellia-x86_64, twofish-x86_64-3way and serpent-sse2 (new/old ratio, average of ecb, cbc, ctr):

            camellia  twofish   serpent
  16 bytes: 0.926x    0.945x    0.980x
  64 bytes: 0.977x    0.968x    0.982x
 256 bytes: 0.980x    0.984x    0.982x
1024 bytes: 0.987x    0.992x    0.985x
4096 bytes: 0.988x    0.993x    0.985x

For ciphers utilising SSE/AVX instructions, shared ablk_helper module is added for registering async-ciphers.

---

Jussi Kivilinna (11):
crypto: ablk_helper - move ablk_* functions from serpent-sse2/avx glue code to shared module
crypto: twofish-avx - change to use shared ablk_* functions
crypto: aes_ni - change to use shared ablk_* functions
crypto: serpent-sse2 - prepare serpent-sse2 glue code into generic x86 glue code for 128bit block ciphers
crypto: serpent-sse2 - split generic glue code to new helper module
crypto: serpent-avx: remove duplicated glue code and use shared glue code from glue_helper
crypto: camellia-x86_64 - remove duplicated glue code and use shared glue code from glue_helper
crypto: twofish-x86_64-3way - remove duplicated glue code and use shared glue code from glue_helper
crypto: twofish-avx - remove duplicated glue code and use shared glue code from glue_helper
crypto: move arch/x86/include/asm/serpent-{sse2|avx}.h to arch/x86/include/asm/crypto/
crypto: move arch/x86/include/asm/aes.h to arch/x86/include/asm/crypto/

 arch/x86/crypto/Makefile                   |    3 
 arch/x86/crypto/ablk_helper.c              |  149 ++++++
 arch/x86/crypto/aes_glue.c                 |    2 
 arch/x86/crypto/aesni-intel_glue.c         |  102 ----
 arch/x86/crypto/camellia_glue.c            |  355 ++++-----------
 arch/x86/crypto/glue_helper.c              |  307 +++++++++++++
 arch/x86/crypto/serpent_avx_glue.c         |  513 ++++-----------------
 arch/x86/crypto/serpent_sse2_glue.c        |  513 ++++-----------------
 arch/x86/crypto/twofish_avx_glue.c         |  672 ++++------------------------
 arch/x86/crypto/twofish_glue_3way.c        |  407 ++++-------------
 arch/x86/include/asm/aes.h                 |   11 
 arch/x86/include/asm/crypto/ablk_helper.h  |   31 +
 arch/x86/include/asm/crypto/aes.h          |   11 
 arch/x86/include/asm/crypto/glue_helper.h  |  115 +++++
 arch/x86/include/asm/crypto/serpent-avx.h  |   32 +
 arch/x86/include/asm/crypto/serpent-sse2.h |   63 +++
 arch/x86/include/asm/crypto/twofish.h      |   46 ++
 arch/x86/include/asm/serpent-avx.h         |   32 -
 arch/x86/include/asm/serpent-sse2.h        |   63 ---
 crypto/Kconfig                             |   21 +
 20 files changed, 1286 insertions(+), 2162 deletions(-)
 create mode 100644 arch/x86/crypto/ablk_helper.c
 create mode 100644 arch/x86/crypto/glue_helper.c
 delete mode 100644 arch/x86/include/asm/aes.h
 create mode 100644 arch/x86/include/asm/crypto/ablk_helper.h
 create mode 100644 arch/x86/include/asm/crypto/aes.h
 create mode 100644 arch/x86/include/asm/crypto/glue_helper.h
 create mode 100644 arch/x86/include/asm/crypto/serpent-avx.h
 create mode 100644 arch/x86/include/asm/crypto/serpent-sse2.h
 create mode 100644 arch/x86/include/asm/crypto/twofish.h
 delete mode 100644 arch/x86/include/asm/serpent-avx.h
 delete mode 100644 arch/x86/include/asm/serpent-sse2.h