mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 10:54:35 +03:00
Convert all HAVE_<name> SIMD gates to HAVE_SIMD(<name>)
The original names no longer exist, and the new ones will need to be selectable based on the current compilation target. Sponsored-by: TrueNAS Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@truenas.com> Closes #18285
This commit is contained in:
committed by
Brian Behlendorf
parent
92a6ab405f
commit
35f74f84e6
@@ -179,7 +179,7 @@ rijndael_key_setup_dec_intel(uint32_t rk[], const uint32_t cipherKey[],
|
||||
}
|
||||
|
||||
|
||||
#elif defined(HAVE_AES) /* guard by instruction set */
|
||||
#elif HAVE_SIMD(AES) /* guard by instruction set */
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* Copyright (c) 2022 Tino Reichardt <milky-zfs@mcmilk.de>
|
||||
*/
|
||||
|
||||
#if defined(HAVE_AVX2)
|
||||
#if HAVE_SIMD(AVX2)
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
@@ -1822,7 +1822,7 @@ CMP_MSB_MASK:
|
||||
.long 0x80000000, 0x80000000, 0x80000000, 0x80000000
|
||||
BLAKE3_IV:
|
||||
.long 0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A
|
||||
#endif /* HAVE_AVX2 */
|
||||
#endif /* HAVE_SIMD(AVX2) */
|
||||
|
||||
#ifdef __ELF__
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* Copyright (c) 2022 Tino Reichardt <milky-zfs@mcmilk.de>
|
||||
*/
|
||||
|
||||
#if defined(HAVE_AVX512F) && defined(HAVE_AVX512VL)
|
||||
#if HAVE_SIMD(AVX512F) && HAVE_SIMD(AVX512VL)
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
@@ -2588,7 +2588,7 @@ BLAKE3_IV_2:
|
||||
BLAKE3_IV_3:
|
||||
.long 0xA54FF53A
|
||||
|
||||
#endif /* HAVE_AVX512 */
|
||||
#endif /* HAVE_SIMD(AVX512) */
|
||||
|
||||
#ifdef __ELF__
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* Copyright (c) 2022 Tino Reichardt <milky-zfs@mcmilk.de>
|
||||
*/
|
||||
|
||||
#if defined(HAVE_SSE2)
|
||||
#if HAVE_SIMD(SSE2)
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
@@ -2293,7 +2293,7 @@ PBLENDW_0x3F_MASK:
|
||||
PBLENDW_0xC0_MASK:
|
||||
.long 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF
|
||||
|
||||
#endif /* HAVE_SSE2 */
|
||||
#endif /* HAVE_SIMD(SSE2) */
|
||||
|
||||
#ifdef __ELF__
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* Copyright (c) 2022 Tino Reichardt <milky-zfs@mcmilk.de>
|
||||
*/
|
||||
|
||||
#if defined(HAVE_SSE4_1)
|
||||
#if HAVE_SIMD(SSE4_1)
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
@@ -2031,7 +2031,7 @@ BLAKE3_BLOCK_LEN:
|
||||
CMP_MSB_MASK:
|
||||
.long 0x80000000, 0x80000000, 0x80000000, 0x80000000
|
||||
|
||||
#endif /* HAVE_SSE4_1 */
|
||||
#endif /* HAVE_SIMD(SSE4_1) */
|
||||
|
||||
#ifdef __ELF__
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// perlasm source: https://github.com/google/boringssl/blob/d5440dd2c2c500ac2d3bba4afec47a054b4d99ae/crypto/fipsmodule/aes/asm/aes-gcm-avx2-x86_64.pl
|
||||
// generated source: https://github.com/google/boringssl/blob/d5440dd2c2c500ac2d3bba4afec47a054b4d99ae/gen/bcm/aes-gcm-avx2-x86_64-linux.S
|
||||
|
||||
#if defined(__x86_64__) && defined(HAVE_AVX2) && \
|
||||
defined(HAVE_VAES) && defined(HAVE_VPCLMULQDQ)
|
||||
#if defined(__x86_64__) && HAVE_SIMD(AVX2) && \
|
||||
HAVE_SIMD(VAES) && HAVE_SIMD(VPCLMULQDQ)
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
@@ -1288,4 +1288,4 @@ SET_SIZE(aes_gcm_dec_update_vaes_avx2)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
||||
#endif /* defined(__x86_64__) && defined(HAVE_AVX2) && defined(HAVE_VAES) ... */
|
||||
#endif /* defined(__x86_64__) && HAVE_SIMD(AVX2) && HAVE_SIMD(VAES) ... */
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
# and modified for ICP. Modification are kept at a bare minimum to ease later
|
||||
# upstream merges.
|
||||
|
||||
#if defined(__x86_64__) && defined(HAVE_AVX) && \
|
||||
defined(HAVE_AES) && defined(HAVE_PCLMULQDQ)
|
||||
#if defined(__x86_64__) && HAVE_SIMD(AVX) && \
|
||||
HAVE_SIMD(AES) && HAVE_SIMD(PCLMULQDQ)
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
.text
|
||||
|
||||
#ifdef HAVE_MOVBE
|
||||
#if HAVE_SIMD(MOVBE)
|
||||
.balign 32
|
||||
FUNCTION(_aesni_ctr32_ghash_6x)
|
||||
.cfi_startproc
|
||||
@@ -380,7 +380,7 @@ FUNCTION(_aesni_ctr32_ghash_6x)
|
||||
.cfi_endproc
|
||||
SET_SIZE(_aesni_ctr32_ghash_6x)
|
||||
STACK_FRAME_NON_STANDARD _aesni_ctr32_ghash_6x
|
||||
#endif /* ifdef HAVE_MOVBE */
|
||||
#endif /* HAVE_SIMD(MOVBE) */
|
||||
|
||||
.balign 32
|
||||
FUNCTION(_aesni_ctr32_ghash_no_movbe_6x)
|
||||
@@ -781,7 +781,7 @@ ENTRY_ALIGN(aesni_gcm_decrypt, 32)
|
||||
vmovdqu %xmm2,96(%rsp)
|
||||
vmovdqu %xmm3,112(%rsp)
|
||||
|
||||
#ifdef HAVE_MOVBE
|
||||
#if HAVE_SIMD(MOVBE)
|
||||
#ifdef _KERNEL
|
||||
testl $1,gcm_avx_can_use_movbe(%rip)
|
||||
#else
|
||||
@@ -992,7 +992,7 @@ ENTRY_ALIGN(aesni_gcm_encrypt, 32)
|
||||
movq $192,%r10
|
||||
vpshufb %xmm0,%xmm8,%xmm8
|
||||
|
||||
#ifdef HAVE_MOVBE
|
||||
#if HAVE_SIMD(MOVBE)
|
||||
#ifdef _KERNEL
|
||||
testl $1,gcm_avx_can_use_movbe(%rip)
|
||||
#else
|
||||
@@ -1266,7 +1266,7 @@ SECTION_STATIC
|
||||
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
|
||||
! defined(HAVE_STACK_FRAME_NON_STANDARD_ASM)
|
||||
.section .discard.func_stack_frame_non_standard, "aw"
|
||||
#ifdef HAVE_MOVBE
|
||||
#if HAVE_SIMD(MOVBE)
|
||||
.long _aesni_ctr32_ghash_6x - .
|
||||
#endif
|
||||
.long _aesni_ctr32_ghash_no_movbe_6x - .
|
||||
@@ -1279,4 +1279,4 @@ SECTION_STATIC
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
||||
#endif /* defined(__x86_64__) && defined(HAVE_AVX) && defined(HAVE_AES) ... */
|
||||
#endif /* defined(__x86_64__) && HAVE_SIMD(AVX) && HAVE_SIMD(AES) ... */
|
||||
|
||||
@@ -91,7 +91,7 @@ gcm_mul_pclmulqdq(uint64_t *x_in, uint64_t *y, uint64_t *res) {
|
||||
(void) x_in, (void) y, (void) res;
|
||||
}
|
||||
|
||||
#elif defined(HAVE_PCLMULQDQ) /* guard by instruction set */
|
||||
#elif HAVE_SIMD(PCLMULQDQ) /* guard by instruction set */
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
|
||||
@@ -95,8 +95,8 @@
|
||||
# and modified for ICP. Modification are kept at a bare minimum to ease later
|
||||
# upstream merges.
|
||||
|
||||
#if defined(__x86_64__) && defined(HAVE_AVX) && \
|
||||
defined(HAVE_AES) && defined(HAVE_PCLMULQDQ)
|
||||
#if defined(__x86_64__) && HAVE_SIMD(AVX) && \
|
||||
HAVE_SIMD(AES) && HAVE_SIMD(PCLMULQDQ)
|
||||
|
||||
#define _ASM
|
||||
#include <sys/asm_linkage.h>
|
||||
@@ -654,4 +654,4 @@ SET_OBJ(.Lrem_8bit)
|
||||
.section .note.GNU-stack,"",%progbits
|
||||
#endif
|
||||
|
||||
#endif /* defined(__x86_64__) && defined(HAVE_AVX) && defined(HAVE_AES) ... */
|
||||
#endif /* defined(__x86_64__) && HAVE_SIMD(AVX) && HAVE_SIMD(AES) ... */
|
||||
|
||||
@@ -4054,7 +4054,7 @@ ENTRY_ALIGN(zfs_sha512_transform_avx2, 64)
|
||||
SET_SIZE(zfs_sha512_transform_avx2)
|
||||
STACK_FRAME_NON_STANDARD zfs_sha512_transform_avx2
|
||||
|
||||
#ifdef HAVE_SHA512EXT
|
||||
#if HAVE_SIMD(SHA512EXT)
|
||||
ENTRY_ALIGN(zfs_sha512_transform_sha512ext, 64)
|
||||
.cfi_startproc
|
||||
ENDBR
|
||||
@@ -4324,7 +4324,7 @@ ENTRY_ALIGN(zfs_sha512_transform_sha512ext, 64)
|
||||
.cfi_endproc
|
||||
SET_SIZE(zfs_sha512_transform_sha512ext)
|
||||
STACK_FRAME_NON_STANDARD zfs_sha512_transform_sha512ext
|
||||
#endif /* HAVE_SHA512EXT */
|
||||
#endif /* HAVE_SIMD(SHA512EXT) */
|
||||
|
||||
/* Workaround for missing asm macro in RHEL 8. */
|
||||
#if defined(__linux__) && defined(HAVE_STACK_FRAME_NON_STANDARD) && \
|
||||
@@ -4333,7 +4333,7 @@ STACK_FRAME_NON_STANDARD zfs_sha512_transform_sha512ext
|
||||
.long zfs_sha512_transform_x64 - .
|
||||
.long zfs_sha512_transform_avx - .
|
||||
.long zfs_sha512_transform_avx2 - .
|
||||
#ifdef HAVE_SHA512EXT
|
||||
#if HAVE_SIMD(SHA512EXT)
|
||||
.long zfs_sha512_transform_sha512ext - .
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user