public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] lib/crypto: x86/sha: Add PHE Extensions support
@ 2026-03-13  8:01 AlanSong-oc
  2026-03-13  8:01 ` [PATCH v4 1/2] crypto: padlock-sha - Disable for Zhaoxin processor AlanSong-oc
  2026-03-13  8:01 ` [PATCH v4 2/2] lib/crypto: x86/sha256: PHE Extensions optimized SHA256 transform function AlanSong-oc
  0 siblings, 2 replies; 5+ messages in thread
From: AlanSong-oc @ 2026-03-13  8:01 UTC (permalink / raw)
  To: herbert, davem, ebiggers, Jason, ardb, linux-crypto, linux-kernel,
	x86
  Cc: CobeChen, TonyWWang-oc, YunShen, GeorgeXue, LeoLiu, HansHu,
	AlanSong-oc

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


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

end of thread, other threads:[~2026-03-14 18:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-13  8:01 [PATCH v4 0/2] lib/crypto: x86/sha: Add PHE Extensions support AlanSong-oc
2026-03-13  8:01 ` [PATCH v4 1/2] crypto: padlock-sha - Disable for Zhaoxin processor AlanSong-oc
2026-03-14 18:40   ` Eric Biggers
2026-03-13  8:01 ` [PATCH v4 2/2] lib/crypto: x86/sha256: PHE Extensions optimized SHA256 transform function AlanSong-oc
2026-03-14 18:50   ` Eric Biggers

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