Bug 28502 - [devel-5.10] Enhance SM3 SM4 drivers with optimizations and compatibility fixes
Summary: [devel-5.10] Enhance SM3 SM4 drivers with optimizations and compatibility fixes
Status: NEW
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: X86 (show other bugs) X86
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: Guanjun
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-24 17:30 UTC by LeoLiu-oc
Modified: 2025-12-24 17:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LeoLiu-oc zhaoxin_group 2025-12-24 17:30:12 UTC
crypto: sm3 - Refactor code and harden security

This patch series refactors the SM3 driver to improve code clarity,
performance, and compatibility.
Key changes include simplifying CPU feature verification using
x86_match_cpu() and boot_cpu_has(), optimizing the sm3_generic_block_fn()
assembly implementation for GCC compliance, and adjusting the cra_priority
to ensure the GMI driver takes precedence over sm3-avx on specific kernel
branches.
Security is enhanced by replacing manual zeroing with memzero_explicit()
for state cleanup.
Additionally, support for legacy ZX-C processors is removed due to
unreliable feature detection via FMS.

crypto: sm4 - Refactor mode handling and optimize performance

This patch series addresses critical issues in the SM4 driver's mode
implementations and optimizes performance.
Fixes include resolving last-block processing in CTR, OFB, and CFB modes
by updating IVs or using ECB workarounds, correcting block size
definitions for OFB/CFB (now 1 byte), and removing redundant IV size
declarations in ECB mode.
The assembly implementation of rep_xcrypt() is optimized for GCC
compliance, and cra_priority is updated to prioritize the GMI driver over
sm4-aesni-avx2 across multiple kernel branches.
Legacy ZX-C processor support is dropped due to unreliable GMI feature
detection.
Comment 1 小龙 admin 2025-12-24 17:35:41 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/6264