]> www.infradead.org Git - users/hch/misc.git/commitdiff
crypto: x86 - Remove CONFIG_AS_GFNI
authorUros Bizjak <ubizjak@gmail.com>
Tue, 19 Aug 2025 08:57:49 +0000 (10:57 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 20 Aug 2025 18:48:07 +0000 (20:48 +0200)
Current minimum required version of binutils is 2.30, which supports GFNI
instruction mnemonics.

Remove check for assembler support of GFNI instructions and all relevant
macros for conditional compilation.

No functional change intended.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Link: https://lore.kernel.org/20250819085855.333380-1-ubizjak@gmail.com
arch/x86/Kconfig.assembler
arch/x86/crypto/Kconfig
arch/x86/crypto/aria-aesni-avx-asm_64.S
arch/x86/crypto/aria-aesni-avx2-asm_64.S
arch/x86/crypto/aria_aesni_avx2_glue.c
arch/x86/crypto/aria_aesni_avx_glue.c

index c827f694fb72d72d785992e6606f87d59fcf2751..6b95be002465794f40cace02fe2970925c379afa 100644 (file)
@@ -6,11 +6,6 @@ config AS_AVX512
        help
          Supported by binutils >= 2.25 and LLVM integrated assembler
 
-config AS_GFNI
-       def_bool $(as-instr,vgf2p8mulb %xmm0$(comma)%xmm1$(comma)%xmm2)
-       help
-         Supported by binutils >= 2.30 and LLVM integrated assembler
-
 config AS_VAES
        def_bool $(as-instr,vaesenc %ymm0$(comma)%ymm1$(comma)%ymm2)
        help
index 94016c60561e28e0aaa106683be41f344e636664..2f8a447f3546733ac505e28e89b189aaad25b6c1 100644 (file)
@@ -319,7 +319,7 @@ config CRYPTO_ARIA_AESNI_AVX2_X86_64
 
 config CRYPTO_ARIA_GFNI_AVX512_X86_64
        tristate "Ciphers: ARIA with modes: ECB, CTR (AVX512/GFNI)"
-       depends on 64BIT && AS_GFNI
+       depends on 64BIT
        select CRYPTO_SKCIPHER
        select CRYPTO_ALGAPI
        select CRYPTO_ARIA
index 9556dacd984154a2b6ede8808321b8c6c692f347..932fb17308e7946b1136121856653e8d46630632 100644 (file)
        vpshufb t1, t0, t2;                             \
        vpxor t2, x7, x7;
 
-#ifdef CONFIG_AS_GFNI
 #define aria_sbox_8way_gfni(x0, x1, x2, x3,            \
                            x4, x5, x6, x7,             \
                            t0, t1, t2, t3,             \
        vgf2p8affineinvqb $0, t2, x3, x3;               \
        vgf2p8affineinvqb $0, t2, x7, x7
 
-#endif /* CONFIG_AS_GFNI */
-
 #define aria_sbox_8way(x0, x1, x2, x3,                 \
                       x4, x5, x6, x7,                  \
                       t0, t1, t2, t3,                  \
                             y4, y5, y6, y7,            \
                             mem_tmp, 8);
 
-#ifdef CONFIG_AS_GFNI
 #define aria_fe_gfni(x0, x1, x2, x3,                   \
                     x4, x5, x6, x7,                    \
                     y0, y1, y2, y3,                    \
                             y4, y5, y6, y7,            \
                             mem_tmp, 8);
 
-#endif /* CONFIG_AS_GFNI */
-
 /* NB: section is mergeable, all elements must be aligned 16-byte blocks */
 .section       .rodata.cst16, "aM", @progbits, 16
 .align 16
 .Ltf_hi__x2__and__fwd_aff:
        .octa 0x3F893781E95FE1576CDA64D2BA0CB204
 
-#ifdef CONFIG_AS_GFNI
 /* AES affine: */
 #define tf_aff_const BV8(1, 1, 0, 0, 0, 1, 1, 0)
 .Ltf_aff_bitmatrix:
                    BV8(0, 0, 0, 0, 0, 1, 0, 0),
                    BV8(0, 0, 0, 0, 0, 0, 1, 0),
                    BV8(0, 0, 0, 0, 0, 0, 0, 1))
-#endif /* CONFIG_AS_GFNI */
 
 /* 4-bit mask */
 .section       .rodata.cst4.L0f0f0f0f, "aM", @progbits, 4
@@ -1140,7 +1132,6 @@ SYM_TYPED_FUNC_START(aria_aesni_avx_ctr_crypt_16way)
        RET;
 SYM_FUNC_END(aria_aesni_avx_ctr_crypt_16way)
 
-#ifdef CONFIG_AS_GFNI
 SYM_FUNC_START_LOCAL(__aria_aesni_avx_gfni_crypt_16way)
        /* input:
        *      %r9: rk
@@ -1359,4 +1350,3 @@ SYM_TYPED_FUNC_START(aria_aesni_avx_gfni_ctr_crypt_16way)
        FRAME_END
        RET;
 SYM_FUNC_END(aria_aesni_avx_gfni_ctr_crypt_16way)
-#endif /* CONFIG_AS_GFNI */
index c60fa2980630379b6e4d095d20f155ce204fff52..ed53d4f46bd7c34deb5276f0fdc6003b83680607 100644 (file)
        vpbroadcastb ((round * 16) + idx + 4)(rk), t0;  \
        vpxor t0, x7, x7;
 
-#ifdef CONFIG_AS_GFNI
 #define aria_sbox_8way_gfni(x0, x1, x2, x3,            \
                            x4, x5, x6, x7,             \
                            t0, t1, t2, t3,             \
        vgf2p8affineinvqb $0, t2, x3, x3;               \
        vgf2p8affineinvqb $0, t2, x7, x7
 
-#endif /* CONFIG_AS_GFNI */
 #define aria_sbox_8way(x0, x1, x2, x3,                 \
                       x4, x5, x6, x7,                  \
                       t0, t1, t2, t3,                  \
        aria_load_state_8way(y0, y1, y2, y3,            \
                             y4, y5, y6, y7,            \
                             mem_tmp, 8);
-#ifdef CONFIG_AS_GFNI
+
 #define aria_fe_gfni(x0, x1, x2, x3,                   \
                     x4, x5, x6, x7,                    \
                     y0, y1, y2, y3,                    \
        aria_load_state_8way(y0, y1, y2, y3,            \
                             y4, y5, y6, y7,            \
                             mem_tmp, 8);
-#endif /* CONFIG_AS_GFNI */
 
 .section        .rodata.cst32.shufb_16x16b, "aM", @progbits, 32
 .align 32
 .Ltf_hi__x2__and__fwd_aff:
        .octa 0x3F893781E95FE1576CDA64D2BA0CB204
 
-#ifdef CONFIG_AS_GFNI
 .section       .rodata.cst8, "aM", @progbits, 8
 .align 8
 /* AES affine: */
                    BV8(0, 0, 0, 0, 0, 0, 1, 0),
                    BV8(0, 0, 0, 0, 0, 0, 0, 1))
 
-#endif /* CONFIG_AS_GFNI */
-
 /* 4-bit mask */
 .section       .rodata.cst4.L0f0f0f0f, "aM", @progbits, 4
 .align 4
@@ -1219,7 +1213,6 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_ctr_crypt_32way)
        RET;
 SYM_FUNC_END(aria_aesni_avx2_ctr_crypt_32way)
 
-#ifdef CONFIG_AS_GFNI
 SYM_FUNC_START_LOCAL(__aria_aesni_avx2_gfni_crypt_32way)
        /* input:
         *      %r9: rk
@@ -1438,4 +1431,3 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_ctr_crypt_32way)
        FRAME_END
        RET;
 SYM_FUNC_END(aria_aesni_avx2_gfni_ctr_crypt_32way)
-#endif /* CONFIG_AS_GFNI */
index 007b250f774cd9daaaa80bfab0f05625127d99c2..1487a49bfbaccf187fa2e420ef8e0bedaf837f9e 100644 (file)
@@ -26,7 +26,6 @@ asmlinkage void aria_aesni_avx2_ctr_crypt_32way(const void *ctx, u8 *dst,
                                                const u8 *src,
                                                u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx2_ctr_crypt_32way);
-#ifdef CONFIG_AS_GFNI
 asmlinkage void aria_aesni_avx2_gfni_encrypt_32way(const void *ctx, u8 *dst,
                                                   const u8 *src);
 EXPORT_SYMBOL_GPL(aria_aesni_avx2_gfni_encrypt_32way);
@@ -37,7 +36,6 @@ asmlinkage void aria_aesni_avx2_gfni_ctr_crypt_32way(const void *ctx, u8 *dst,
                                                     const u8 *src,
                                                     u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx2_gfni_ctr_crypt_32way);
-#endif /* CONFIG_AS_GFNI */
 
 static struct aria_avx_ops aria_ops;
 
@@ -213,7 +211,7 @@ static int __init aria_avx2_init(void)
                return -ENODEV;
        }
 
-       if (boot_cpu_has(X86_FEATURE_GFNI) && IS_ENABLED(CONFIG_AS_GFNI)) {
+       if (boot_cpu_has(X86_FEATURE_GFNI)) {
                aria_ops.aria_encrypt_16way = aria_aesni_avx_gfni_encrypt_16way;
                aria_ops.aria_decrypt_16way = aria_aesni_avx_gfni_decrypt_16way;
                aria_ops.aria_ctr_crypt_16way = aria_aesni_avx_gfni_ctr_crypt_16way;
index 4c88ef4eba8278c9e445512a57cb1b1f2e634cdd..e4e3d78915a5fd0d2e76bc0c03d8a17d0ea18f05 100644 (file)
@@ -26,7 +26,6 @@ asmlinkage void aria_aesni_avx_ctr_crypt_16way(const void *ctx, u8 *dst,
                                               const u8 *src,
                                               u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx_ctr_crypt_16way);
-#ifdef CONFIG_AS_GFNI
 asmlinkage void aria_aesni_avx_gfni_encrypt_16way(const void *ctx, u8 *dst,
                                                  const u8 *src);
 EXPORT_SYMBOL_GPL(aria_aesni_avx_gfni_encrypt_16way);
@@ -37,7 +36,6 @@ asmlinkage void aria_aesni_avx_gfni_ctr_crypt_16way(const void *ctx, u8 *dst,
                                                    const u8 *src,
                                                    u8 *keystream, u8 *iv);
 EXPORT_SYMBOL_GPL(aria_aesni_avx_gfni_ctr_crypt_16way);
-#endif /* CONFIG_AS_GFNI */
 
 static struct aria_avx_ops aria_ops;
 
@@ -199,7 +197,7 @@ static int __init aria_avx_init(void)
                return -ENODEV;
        }
 
-       if (boot_cpu_has(X86_FEATURE_GFNI) && IS_ENABLED(CONFIG_AS_GFNI)) {
+       if (boot_cpu_has(X86_FEATURE_GFNI)) {
                aria_ops.aria_encrypt_16way = aria_aesni_avx_gfni_encrypt_16way;
                aria_ops.aria_decrypt_16way = aria_aesni_avx_gfni_decrypt_16way;
                aria_ops.aria_ctr_crypt_16way = aria_aesni_avx_gfni_ctr_crypt_16way;