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

SHA2 reworking and API for iterating over multiple implementations #13741

Closed
wants to merge 8 commits into from

Commits on Mar 1, 2023

  1. Remove old or redundant SHA2 files

    We had three sha2.h headers in different places.
    The FreeBSD version, the Linux version and the generic solaris version.
    
    The only assembly used for acceleration was some old x86-64 openssl
    implementation for sha256 within the icp module.
    
    For FreeBSD the whole SHA2 files of FreeBSD were copied into OpenZFS,
    these files got removed also.
    
    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    mcmilk committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    b66feee View commit details
    Browse the repository at this point in the history
  2. Add ARM architecture to OpenZFS buildsystem

    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    mcmilk committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    213bfa5 View commit details
    Browse the repository at this point in the history
  3. Add SHA2 SIMD feature tests for FreeBSD

    These are added:
    - zfs_neon_available() for arm and aarch64
    - zfs_sha256_available() for arm and aarch64
    - zfs_sha512_available() for aarch64
    - zfs_shani_available() for x86_64
    
    Changes:
    - simd_powerpc.h: change license from CDDL to BSD
    
    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    mcmilk committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    6191dce View commit details
    Browse the repository at this point in the history
  4. Add SHA2 SIMD feature tests for Linux

    These are added:
    - zfs_neon_available() for arm and aarch64
    - zfs_sha256_available() for arm and aarch64
    - zfs_sha512_available() for aarch64
    - zfs_shani_available() for x86_64
    
    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    Co-Authored-By: Sebastian Gottschall <s.gottschall@dd-wrt.com>
    mcmilk and BrainSlayer committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    80937a2 View commit details
    Browse the repository at this point in the history
  5. Add SHA2 SIMD feature tests for libspl

    These are added via HWCAP interface:
    - zfs_neon_available() for arm and aarch64
    - zfs_sha256_available() for arm and aarch64
    - zfs_sha512_available() for aarch64
    
    This one via cpuid() call:
    - zfs_shani_available() for x86_64
    
    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    mcmilk committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    fb11b8f View commit details
    Browse the repository at this point in the history
  6. Add generic implementation handling and SHA2 impl

    The skeleton file module/icp/include/generic_impl.c can be used for
    iterating over different implementations of algorithms.
    
    It is used by SHA256, SHA512 and BLAKE3 currently.
    
    The Solaris SHA2 implementation got replaced with a version which is
    based on public domain code of cppcrypto v0.10.
    
    These assembly files are taken from current openssl master:
    - sha256-x86_64.S: x64, SSSE3, AVX, AVX2, SHA-NI (x86_64)
    - sha512-x86_64.S: x64, AVX, AVX2 (x86_64)
    - sha256-armv7.S: ARMv7, NEON, ARMv8-CE (arm)
    - sha512-armv7.S: ARMv7, NEON (arm)
    - sha256-armv8.S: ARMv7, NEON, ARMv8-CE (aarch64)
    - sha512-armv8.S: ARMv7, ARMv8-CE (aarch64)
    - sha256-ppc.S: Generic PPC64 LE/BE (ppc64)
    - sha512-ppc.S: Generic PPC64 LE/BE (ppc64)
    - sha256-p8.S: Power8 ISA Version 2.07 LE/BE (ppc64)
    - sha512-p8.S: Power8 ISA Version 2.07 LE/BE (ppc64)
    
    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    mcmilk committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    072eaf0 View commit details
    Browse the repository at this point in the history
  7. Update BLAKE3 for using the new impl handling

    This commit changes the BLAKE3 implementation handling and
    also the calls to it from the ztest command.
    
    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    mcmilk committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    e8deb33 View commit details
    Browse the repository at this point in the history
  8. Use SECTION_STATIC macro for sha2 x86_64 assembly

    - instead of ".section .rodata" we should use SECTION_STATIC
    
    Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
    mcmilk committed Mar 1, 2023
    Configuration menu
    Copy the full SHA
    e4650bf View commit details
    Browse the repository at this point in the history