* [PATCH] crypto: x86/aes-gcm-vaes-avx2 - initialize full %rax return register
@ 2025-11-02 1:52 Eric Biggers
2025-11-03 8:16 ` Ard Biesheuvel
2025-11-04 5:51 ` Eric Biggers
0 siblings, 2 replies; 3+ messages in thread
From: Eric Biggers @ 2025-11-02 1:52 UTC (permalink / raw)
To: linux-crypto
Cc: linux-kernel, Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu,
Eric Biggers
Update aes_gcm_dec_final_vaes_avx2() to be consistent with
aes_gcm_dec_final_aesni() and aes_gcm_dec_final_vaes_avx512() by
initializing the full %rax return register instead of just %al.
Technically this is unnecessary, since these functions return bool. But
I think it's worth being extra careful with the result of the tag
comparison and also keeping the different implementations consistent.
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
This patch is targeting libcrypto-next
arch/x86/crypto/aes-gcm-vaes-avx2.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/crypto/aes-gcm-vaes-avx2.S b/arch/x86/crypto/aes-gcm-vaes-avx2.S
index d9754e683bde..93c9504a488f 100644
--- a/arch/x86/crypto/aes-gcm-vaes-avx2.S
+++ b/arch/x86/crypto/aes-gcm-vaes-avx2.S
@@ -1121,10 +1121,11 @@ SYM_FUNC_END(aes_gcm_aad_update_vaes_avx2)
vpxor (%rax), GHASH_ACC, GHASH_ACC
vaesenclast GHASH_ACC, %xmm0, %xmm0
lea .Lselect_high_bytes_table(%rip), %rax
vmovdqu (%rax, TAGLEN64), %xmm1
vpshufb BSWAP_MASK, %xmm1, %xmm1 // select low bytes, not high
+ xor %eax, %eax
vptest %xmm1, %xmm0
sete %al
.endif
// No need for vzeroupper here, since only used xmm registers were used.
RET
base-commit: 5a2a5e62a5216ba05d4481cf90d915f4de0bfde9
--
2.51.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: x86/aes-gcm-vaes-avx2 - initialize full %rax return register
2025-11-02 1:52 [PATCH] crypto: x86/aes-gcm-vaes-avx2 - initialize full %rax return register Eric Biggers
@ 2025-11-03 8:16 ` Ard Biesheuvel
2025-11-04 5:51 ` Eric Biggers
1 sibling, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2025-11-03 8:16 UTC (permalink / raw)
To: Eric Biggers; +Cc: linux-crypto, linux-kernel, Jason A . Donenfeld, Herbert Xu
On Sun, 2 Nov 2025 at 02:53, Eric Biggers <ebiggers@kernel.org> wrote:
>
> Update aes_gcm_dec_final_vaes_avx2() to be consistent with
> aes_gcm_dec_final_aesni() and aes_gcm_dec_final_vaes_avx512() by
> initializing the full %rax return register instead of just %al.
> Technically this is unnecessary, since these functions return bool. But
> I think it's worth being extra careful with the result of the tag
> comparison and also keeping the different implementations consistent.
>
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
>
> This patch is targeting libcrypto-next
>
> arch/x86/crypto/aes-gcm-vaes-avx2.S | 1 +
> 1 file changed, 1 insertion(+)
>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto: x86/aes-gcm-vaes-avx2 - initialize full %rax return register
2025-11-02 1:52 [PATCH] crypto: x86/aes-gcm-vaes-avx2 - initialize full %rax return register Eric Biggers
2025-11-03 8:16 ` Ard Biesheuvel
@ 2025-11-04 5:51 ` Eric Biggers
1 sibling, 0 replies; 3+ messages in thread
From: Eric Biggers @ 2025-11-04 5:51 UTC (permalink / raw)
To: linux-crypto
Cc: linux-kernel, Ard Biesheuvel, Jason A . Donenfeld, Herbert Xu
On Sat, Nov 01, 2025 at 06:52:56PM -0700, Eric Biggers wrote:
> Update aes_gcm_dec_final_vaes_avx2() to be consistent with
> aes_gcm_dec_final_aesni() and aes_gcm_dec_final_vaes_avx512() by
> initializing the full %rax return register instead of just %al.
> Technically this is unnecessary, since these functions return bool. But
> I think it's worth being extra careful with the result of the tag
> comparison and also keeping the different implementations consistent.
>
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
>
> This patch is targeting libcrypto-next
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next
- Eric
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-04 5:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-02 1:52 [PATCH] crypto: x86/aes-gcm-vaes-avx2 - initialize full %rax return register Eric Biggers
2025-11-03 8:16 ` Ard Biesheuvel
2025-11-04 5:51 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).