Skip to content

lib/crypto: x86/sha: Add PHE Extensions support

AlanSong-oc linux-crypto lkml stable 3 versions – Applied

Status from this message: Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-fixes

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 2 repliesApplied
  2. v33 patches 9 repliesSuperseded
  3. v22 patches 6 repliesSuperseded

Changes in v4 from the cover letter

- Include benchmark results, test results, and the specification link directly in the commit message instead of the cover letter.
- Check CONFIG_CPU_SUP_ZHAOXIN directly in the condition rather than using #if/#endif for conditional compilation.
- Combine the CPU family check and the X86_FEATURE_PHE_EN feature check into a single condition.
- Correct the comment describing the instruction register requirements in both 32-bit and 64-bit operation modes.
- Fix the inline assembly constraints to match the instruction behavior for input and output registers.
- Only include XSHA256 support for SHA-256 and drop XSHA1 support.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/2crypto: padlock-sha - Disable for Zhaoxin processordrivers/crypto/padlock-sha.c+7 -01 reply
2/2lib/crypto: x86/sha256: PHE Extensions optimized SHA256 transform functionlib/crypto/x86/sha256.h+25 -01 reply

Reviews trailers per patch

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

Read the v4 thread

Cover letter [PATCH v4 0/2] lib/crypto: x86/sha: Add PHE Extensions support

This series adds support for PHE Extensions optimized SHA256 transform functions for Zhaoxin processors in lib/crypto, and disables the padlock-sha driver on Zhaoxin platforms due to self-test failures.

After applying this patch series, the data block processing throughput increases by approximately 2 to 5 times on the Zhaoxin KX-7000 platform, depending on block size and hash algorithm, as measured by CRYPTO_LIB_BENCHMARK. The KUnit test suites also pass successfully.

Changes in v4:
- Include benchmark results, test results, and the specification link directly in the commit message instead of the cover letter.
- Check CONFIG_CPU_SUP_ZHAOXIN directly in the condition rather than using #if/#endif for conditional compilation.
- Combine the CPU family check and the X86_FEATURE_PHE_EN feature check into a single condition.
- Correct the comment describing the instruction register requirements in both 32-bit and 64-bit operation modes.
- Fix the inline assembly constraints to match the instruction behavior for input and output registers.
- Only include XSHA256 support for SHA-256 and drop XSHA1 support.

Changes in v3:
- Implement PHE Extensions optimized SHA1 and SHA256 transform functions using inline assembly instead of separate assembly files
- Eliminate unnecessary casts
- Add CONFIG_CPU_SUP_ZHAOXIN check to compile out the code when disabled
- Use 'boot_cpu_data.x86' to identify the CPU family instead of 'cpu_data(0).x86'
- Only check X86_FEATURE_PHE_EN for CPU support, consistent with other CPU feature checks.
- Disable the padlock-sha driver on Zhaoxin processors with CPU family 0x07 and newer.

Changes in v2:
- Add Zhaoxin support to lib/crypto instead of extending the existing padlock-sha driver

AlanSong-oc (2):
crypto: padlock-sha - Disable for Zhaoxin processor lib/crypto: x86/sha256: PHE Extensions optimized SHA256 transform
function

 drivers/crypto/padlock-sha.c |  7 +++++++
 lib/crypto/x86/sha256.h      | 25 +++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
Signature · 1 line
2.34.1