Skip to content

Commit a35da57

Browse files
ubizjakbp3tk0v
authored andcommitted
crypto: x86 - Remove CONFIG_AS_GFNI
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
1 parent 03777db commit a35da57

File tree

6 files changed

+4
-31
lines changed

6 files changed

+4
-31
lines changed

arch/x86/Kconfig.assembler

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ config AS_AVX512
66
help
77
Supported by binutils >= 2.25 and LLVM integrated assembler
88

9-
config AS_GFNI
10-
def_bool $(as-instr,vgf2p8mulb %xmm0$(comma)%xmm1$(comma)%xmm2)
11-
help
12-
Supported by binutils >= 2.30 and LLVM integrated assembler
13-
149
config AS_VAES
1510
def_bool $(as-instr,vaesenc %ymm0$(comma)%ymm1$(comma)%ymm2)
1611
help

arch/x86/crypto/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ config CRYPTO_ARIA_AESNI_AVX2_X86_64
319319

320320
config CRYPTO_ARIA_GFNI_AVX512_X86_64
321321
tristate "Ciphers: ARIA with modes: ECB, CTR (AVX512/GFNI)"
322-
depends on 64BIT && AS_GFNI
322+
depends on 64BIT
323323
select CRYPTO_SKCIPHER
324324
select CRYPTO_ALGAPI
325325
select CRYPTO_ARIA

arch/x86/crypto/aria-aesni-avx-asm_64.S

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@
295295
vpshufb t1, t0, t2; \
296296
vpxor t2, x7, x7;
297297

298-
#ifdef CONFIG_AS_GFNI
299298
#define aria_sbox_8way_gfni(x0, x1, x2, x3, \
300299
x4, x5, x6, x7, \
301300
t0, t1, t2, t3, \
@@ -318,8 +317,6 @@
318317
vgf2p8affineinvqb $0, t2, x3, x3; \
319318
vgf2p8affineinvqb $0, t2, x7, x7
320319

321-
#endif /* CONFIG_AS_GFNI */
322-
323320
#define aria_sbox_8way(x0, x1, x2, x3, \
324321
x4, x5, x6, x7, \
325322
t0, t1, t2, t3, \
@@ -561,7 +558,6 @@
561558
y4, y5, y6, y7, \
562559
mem_tmp, 8);
563560

564-
#ifdef CONFIG_AS_GFNI
565561
#define aria_fe_gfni(x0, x1, x2, x3, \
566562
x4, x5, x6, x7, \
567563
y0, y1, y2, y3, \
@@ -719,8 +715,6 @@
719715
y4, y5, y6, y7, \
720716
mem_tmp, 8);
721717

722-
#endif /* CONFIG_AS_GFNI */
723-
724718
/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
725719
.section .rodata.cst16, "aM", @progbits, 16
726720
.align 16
@@ -772,7 +766,6 @@
772766
.Ltf_hi__x2__and__fwd_aff:
773767
.octa 0x3F893781E95FE1576CDA64D2BA0CB204
774768

775-
#ifdef CONFIG_AS_GFNI
776769
/* AES affine: */
777770
#define tf_aff_const BV8(1, 1, 0, 0, 0, 1, 1, 0)
778771
.Ltf_aff_bitmatrix:
@@ -871,7 +864,6 @@
871864
BV8(0, 0, 0, 0, 0, 1, 0, 0),
872865
BV8(0, 0, 0, 0, 0, 0, 1, 0),
873866
BV8(0, 0, 0, 0, 0, 0, 0, 1))
874-
#endif /* CONFIG_AS_GFNI */
875867

876868
/* 4-bit mask */
877869
.section .rodata.cst4.L0f0f0f0f, "aM", @progbits, 4
@@ -1140,7 +1132,6 @@ SYM_TYPED_FUNC_START(aria_aesni_avx_ctr_crypt_16way)
11401132
RET;
11411133
SYM_FUNC_END(aria_aesni_avx_ctr_crypt_16way)
11421134

1143-
#ifdef CONFIG_AS_GFNI
11441135
SYM_FUNC_START_LOCAL(__aria_aesni_avx_gfni_crypt_16way)
11451136
/* input:
11461137
* %r9: rk
@@ -1359,4 +1350,3 @@ SYM_TYPED_FUNC_START(aria_aesni_avx_gfni_ctr_crypt_16way)
13591350
FRAME_END
13601351
RET;
13611352
SYM_FUNC_END(aria_aesni_avx_gfni_ctr_crypt_16way)
1362-
#endif /* CONFIG_AS_GFNI */

arch/x86/crypto/aria-aesni-avx2-asm_64.S

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,6 @@
302302
vpbroadcastb ((round * 16) + idx + 4)(rk), t0; \
303303
vpxor t0, x7, x7;
304304

305-
#ifdef CONFIG_AS_GFNI
306305
#define aria_sbox_8way_gfni(x0, x1, x2, x3, \
307306
x4, x5, x6, x7, \
308307
t0, t1, t2, t3, \
@@ -325,7 +324,6 @@
325324
vgf2p8affineinvqb $0, t2, x3, x3; \
326325
vgf2p8affineinvqb $0, t2, x7, x7
327326

328-
#endif /* CONFIG_AS_GFNI */
329327
#define aria_sbox_8way(x0, x1, x2, x3, \
330328
x4, x5, x6, x7, \
331329
t0, t1, t2, t3, \
@@ -598,7 +596,7 @@
598596
aria_load_state_8way(y0, y1, y2, y3, \
599597
y4, y5, y6, y7, \
600598
mem_tmp, 8);
601-
#ifdef CONFIG_AS_GFNI
599+
602600
#define aria_fe_gfni(x0, x1, x2, x3, \
603601
x4, x5, x6, x7, \
604602
y0, y1, y2, y3, \
@@ -752,7 +750,6 @@
752750
aria_load_state_8way(y0, y1, y2, y3, \
753751
y4, y5, y6, y7, \
754752
mem_tmp, 8);
755-
#endif /* CONFIG_AS_GFNI */
756753

757754
.section .rodata.cst32.shufb_16x16b, "aM", @progbits, 32
758755
.align 32
@@ -806,7 +803,6 @@
806803
.Ltf_hi__x2__and__fwd_aff:
807804
.octa 0x3F893781E95FE1576CDA64D2BA0CB204
808805

809-
#ifdef CONFIG_AS_GFNI
810806
.section .rodata.cst8, "aM", @progbits, 8
811807
.align 8
812808
/* AES affine: */
@@ -868,8 +864,6 @@
868864
BV8(0, 0, 0, 0, 0, 0, 1, 0),
869865
BV8(0, 0, 0, 0, 0, 0, 0, 1))
870866

871-
#endif /* CONFIG_AS_GFNI */
872-
873867
/* 4-bit mask */
874868
.section .rodata.cst4.L0f0f0f0f, "aM", @progbits, 4
875869
.align 4
@@ -1219,7 +1213,6 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_ctr_crypt_32way)
12191213
RET;
12201214
SYM_FUNC_END(aria_aesni_avx2_ctr_crypt_32way)
12211215

1222-
#ifdef CONFIG_AS_GFNI
12231216
SYM_FUNC_START_LOCAL(__aria_aesni_avx2_gfni_crypt_32way)
12241217
/* input:
12251218
* %r9: rk
@@ -1438,4 +1431,3 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_ctr_crypt_32way)
14381431
FRAME_END
14391432
RET;
14401433
SYM_FUNC_END(aria_aesni_avx2_gfni_ctr_crypt_32way)
1441-
#endif /* CONFIG_AS_GFNI */

arch/x86/crypto/aria_aesni_avx2_glue.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ asmlinkage void aria_aesni_avx2_ctr_crypt_32way(const void *ctx, u8 *dst,
2626
const u8 *src,
2727
u8 *keystream, u8 *iv);
2828
EXPORT_SYMBOL_GPL(aria_aesni_avx2_ctr_crypt_32way);
29-
#ifdef CONFIG_AS_GFNI
3029
asmlinkage void aria_aesni_avx2_gfni_encrypt_32way(const void *ctx, u8 *dst,
3130
const u8 *src);
3231
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,
3736
const u8 *src,
3837
u8 *keystream, u8 *iv);
3938
EXPORT_SYMBOL_GPL(aria_aesni_avx2_gfni_ctr_crypt_32way);
40-
#endif /* CONFIG_AS_GFNI */
4139

4240
static struct aria_avx_ops aria_ops;
4341

@@ -213,7 +211,7 @@ static int __init aria_avx2_init(void)
213211
return -ENODEV;
214212
}
215213

216-
if (boot_cpu_has(X86_FEATURE_GFNI) && IS_ENABLED(CONFIG_AS_GFNI)) {
214+
if (boot_cpu_has(X86_FEATURE_GFNI)) {
217215
aria_ops.aria_encrypt_16way = aria_aesni_avx_gfni_encrypt_16way;
218216
aria_ops.aria_decrypt_16way = aria_aesni_avx_gfni_decrypt_16way;
219217
aria_ops.aria_ctr_crypt_16way = aria_aesni_avx_gfni_ctr_crypt_16way;

arch/x86/crypto/aria_aesni_avx_glue.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ asmlinkage void aria_aesni_avx_ctr_crypt_16way(const void *ctx, u8 *dst,
2626
const u8 *src,
2727
u8 *keystream, u8 *iv);
2828
EXPORT_SYMBOL_GPL(aria_aesni_avx_ctr_crypt_16way);
29-
#ifdef CONFIG_AS_GFNI
3029
asmlinkage void aria_aesni_avx_gfni_encrypt_16way(const void *ctx, u8 *dst,
3130
const u8 *src);
3231
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,
3736
const u8 *src,
3837
u8 *keystream, u8 *iv);
3938
EXPORT_SYMBOL_GPL(aria_aesni_avx_gfni_ctr_crypt_16way);
40-
#endif /* CONFIG_AS_GFNI */
4139

4240
static struct aria_avx_ops aria_ops;
4341

@@ -199,7 +197,7 @@ static int __init aria_avx_init(void)
199197
return -ENODEV;
200198
}
201199

202-
if (boot_cpu_has(X86_FEATURE_GFNI) && IS_ENABLED(CONFIG_AS_GFNI)) {
200+
if (boot_cpu_has(X86_FEATURE_GFNI)) {
203201
aria_ops.aria_encrypt_16way = aria_aesni_avx_gfni_encrypt_16way;
204202
aria_ops.aria_decrypt_16way = aria_aesni_avx_gfni_decrypt_16way;
205203
aria_ops.aria_ctr_crypt_16way = aria_aesni_avx_gfni_ctr_crypt_16way;

0 commit comments

Comments
 (0)