From c8a72a27e56237ae50cdd90bd87f0661343ce39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20F=C3=BCl=C3=B6p?= Date: Thu, 19 Feb 2026 19:10:02 +0100 Subject: [PATCH] ICP: AES-GCM assembly: remove unused Gmul functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the AES-GCM assembly files we are defining Gmul functions we don't use anywhere. Just remove the dead code. Reviewed-by: Brian Behlendorf Signed-off-by: Attila Fülöp Closes #18226 --- .../asm-x86_64/modes/aesni-gcm-avx2-vaes.S | 36 ----------- module/icp/asm-x86_64/modes/ghash-x86_64.S | 64 ------------------- .../icp/include/modes/gcm_asm_rename_funcs.h | 1 - 3 files changed, 101 deletions(-) diff --git a/module/icp/asm-x86_64/modes/aesni-gcm-avx2-vaes.S b/module/icp/asm-x86_64/modes/aesni-gcm-avx2-vaes.S index 52821dbb2..626f4639c 100644 --- a/module/icp/asm-x86_64/modes/aesni-gcm-avx2-vaes.S +++ b/module/icp/asm-x86_64/modes/aesni-gcm-avx2-vaes.S @@ -159,42 +159,6 @@ ENDBR .cfi_endproc SET_SIZE(gcm_init_vpclmulqdq_avx2) -ENTRY_ALIGN(gcm_gmult_vpclmulqdq_avx2, 32) -.cfi_startproc - -ENDBR - - - - vmovdqu (%rdi),%xmm0 - vmovdqu .Lbswap_mask(%rip),%xmm1 - vmovdqu 128-16(%rsi),%xmm2 - vmovdqu .Lgfpoly(%rip),%xmm3 - vpshufb %xmm1,%xmm0,%xmm0 - - vpclmulqdq $0x00,%xmm2,%xmm0,%xmm4 - vpclmulqdq $0x01,%xmm2,%xmm0,%xmm5 - vpclmulqdq $0x10,%xmm2,%xmm0,%xmm6 - vpxor %xmm6,%xmm5,%xmm5 - vpclmulqdq $0x01,%xmm4,%xmm3,%xmm6 - vpshufd $0x4e,%xmm4,%xmm4 - vpxor %xmm4,%xmm5,%xmm5 - vpxor %xmm6,%xmm5,%xmm5 - vpclmulqdq $0x11,%xmm2,%xmm0,%xmm0 - vpclmulqdq $0x01,%xmm5,%xmm3,%xmm4 - vpshufd $0x4e,%xmm5,%xmm5 - vpxor %xmm5,%xmm0,%xmm0 - vpxor %xmm4,%xmm0,%xmm0 - - - vpshufb %xmm1,%xmm0,%xmm0 - vmovdqu %xmm0,(%rdi) - - - RET - -.cfi_endproc -SET_SIZE(gcm_gmult_vpclmulqdq_avx2) ENTRY_ALIGN(gcm_ghash_vpclmulqdq_avx2, 32) .cfi_startproc diff --git a/module/icp/asm-x86_64/modes/ghash-x86_64.S b/module/icp/asm-x86_64/modes/ghash-x86_64.S index 6c5bbf0fb..8295f91d2 100644 --- a/module/icp/asm-x86_64/modes/ghash-x86_64.S +++ b/module/icp/asm-x86_64/modes/ghash-x86_64.S @@ -103,63 +103,6 @@ .text -/* Windows userland links with OpenSSL */ -#if !defined (_WIN32) || defined (_KERNEL) -ENTRY_ALIGN(gcm_gmult_clmul, 16) - -.cfi_startproc - ENDBR - -.L_gmult_clmul: - movdqu (%rdi),%xmm0 - movdqa .Lbswap_mask(%rip),%xmm5 - movdqu (%rsi),%xmm2 - movdqu 32(%rsi),%xmm4 -.byte 102,15,56,0,197 - movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 - pxor %xmm0,%xmm3 -.byte 102,15,58,68,194,0 -.byte 102,15,58,68,202,17 -.byte 102,15,58,68,220,0 - pxor %xmm0,%xmm3 - pxor %xmm1,%xmm3 - - movdqa %xmm3,%xmm4 - psrldq $8,%xmm3 - pslldq $8,%xmm4 - pxor %xmm3,%xmm1 - pxor %xmm4,%xmm0 - - movdqa %xmm0,%xmm4 - movdqa %xmm0,%xmm3 - psllq $5,%xmm0 - pxor %xmm0,%xmm3 - psllq $1,%xmm0 - pxor %xmm3,%xmm0 - psllq $57,%xmm0 - movdqa %xmm0,%xmm3 - pslldq $8,%xmm0 - psrldq $8,%xmm3 - pxor %xmm4,%xmm0 - pxor %xmm3,%xmm1 - - - movdqa %xmm0,%xmm4 - psrlq $1,%xmm0 - pxor %xmm4,%xmm1 - pxor %xmm0,%xmm4 - psrlq $5,%xmm0 - pxor %xmm4,%xmm0 - psrlq $1,%xmm0 - pxor %xmm1,%xmm0 -.byte 102,15,56,0,197 - movdqu %xmm0,(%rdi) - RET -.cfi_endproc -SET_SIZE(gcm_gmult_clmul) -#endif /* !_WIN32 || _KERNEL */ - ENTRY_ALIGN(gcm_init_htab_avx, 32) .cfi_startproc ENDBR @@ -272,13 +215,6 @@ ENTRY_ALIGN(gcm_init_htab_avx, 32) SET_SIZE(gcm_init_htab_avx) #if !defined (_WIN32) || defined (_KERNEL) -ENTRY_ALIGN(gcm_gmult_avx, 32) -.cfi_startproc - ENDBR - jmp .L_gmult_clmul -.cfi_endproc -SET_SIZE(gcm_gmult_avx) - ENTRY_ALIGN(gcm_ghash_avx, 32) .cfi_startproc ENDBR diff --git a/module/icp/include/modes/gcm_asm_rename_funcs.h b/module/icp/include/modes/gcm_asm_rename_funcs.h index 08c51aeed..5e88921cf 100644 --- a/module/icp/include/modes/gcm_asm_rename_funcs.h +++ b/module/icp/include/modes/gcm_asm_rename_funcs.h @@ -33,7 +33,6 @@ /* module/icp/asm-x86_64/modes/aesni-gcm-avx2-vaes.S */ #define gcm_init_vpclmulqdq_avx2 icp_gcm_init_vpclmulqdq_avx2 -#define gcm_gmult_vpclmulqdq_avx2 icp_gcm_gmult_vpclmulqdq_avx2 #define gcm_ghash_vpclmulqdq_avx2 icp_gcm_ghash_vpclmulqdq_avx2 #define aes_gcm_enc_update_vaes_avx2 icp_aes_gcm_enc_update_vaes_avx2 #define aes_gcm_dec_update_vaes_avx2 icp_aes_gcm_dec_update_vaes_avx2