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

AlanSong-oc posted 2 patches 3 weeks, 4 days ago
drivers/crypto/padlock-sha.c |  7 +++++++
lib/crypto/x86/sha256.h      | 25 +++++++++++++++++++++++++
2 files changed, 32 insertions(+)
[PATCH v4 0/2] lib/crypto: x86/sha: Add PHE Extensions support
Posted by AlanSong-oc 3 weeks, 4 days ago
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(+)

-- 
2.34.1