Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module/icp/asm-arm/sha2: enable non-SIMD asm kernels on armv5/6 #15623

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

Harry-Chen
Copy link
Contributor

Motivation and Context

My merged pull request #15557 fixes compilation of sha2 kernels on arm v5/6.

However, the compiler guards only allow sha256/512_armv7_impl to be used when __ARM_ARCH > 6. Therefore old arm architectures cannot leverage the well-written asm kernels zfs_sha256/512_block_armv7 (from openssl project) and always fall back to the generic C implementation. This might lead to unnecessary performance degradation.

These kernels are actually named armv4 from the openssl side. So I believe it has been guaranteed to work on old arm arches.

Description

This patch enables these ASM kernels on all arm architectures. Some compiler guards are adjusted accordingly to avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels on old architectures.

See also: 4c5fec0

How Has This Been Tested?

I have tested compilation on armv5te / armv6 architectures. No behavior changes are made to other architectures.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

My merged pull request openzfs#15557 fixes compilation of sha2 kernels on arm
v5/6. However, the compiler guards only allows sha256/512_armv7_impl to
be used when __ARM_ARCH > 6. This patch enables these ASM kernels on all
arm architectures. Some compiler guards are adjusted accordingly to
avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels
on old architectures.

Signed-off-by: Shengqi Chen <[email protected]>
Copy link
Contributor

@behlendorf behlendorf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Dec 5, 2023
@behlendorf behlendorf merged commit 727497c into openzfs:master Dec 5, 2023
23 of 26 checks passed
@Harry-Chen Harry-Chen deleted the sha2-arm-alg branch December 6, 2023 00:54
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
My merged pull request openzfs#15557 fixes compilation of sha2 kernels on arm
v5/6. However, the compiler guards only allows sha256/512_armv7_impl to
be used when __ARM_ARCH > 6. This patch enables these ASM kernels on all
arm architectures. Some compiler guards are adjusted accordingly to
avoid the unnecessary compilation of SIMD (e.g., neon, armv8ce) kernels
on old architectures.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Shengqi Chen <[email protected]>
Closes openzfs#15623
@Harry-Chen Harry-Chen mentioned this pull request Aug 23, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants