Linux cryptographic layer development
 help / color / mirror / Atom feed
* [PATCH RESEND] crypto: x86/aria - add missing vzeroupper in AVX2 code
@ 2026-08-31 21:17 Eric Biggers
  2026-09-02  8:38 ` Herbert Xu
  2026-09-04  3:41 ` Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Biggers @ 2026-08-31 21:17 UTC (permalink / raw)
  To: linux-crypto, Herbert Xu
  Cc: linux-kernel, x86, Eric Biggers, stable, Taehee Yoo

Since the AVX2 optimized ARIA code uses YMM registers, execute
vzeroupper before returning from it.  This is needed to avoid degrading
the performance of any later SSE code that may happen to be executed.

Fixes: 37d8d3ae7a58 ("crypto: x86/aria - implement aria-avx2")
Cc: stable@vger.kernel.org
Cc: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---

This didn't get picked up by the x86 maintainers yet.  Herbert, can you
take this through the crypto tree?

 arch/x86/crypto/aria-aesni-avx2-asm_64.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/crypto/aria-aesni-avx2-asm_64.S b/arch/x86/crypto/aria-aesni-avx2-asm_64.S
index ed53d4f46bd7..fda8cb8a99a8 100644
--- a/arch/x86/crypto/aria-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/aria-aesni-avx2-asm_64.S
@@ -982,6 +982,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_encrypt_32way)
 		     %ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
 		     %ymm15, %rax);
 
+	vzeroupper;
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_encrypt_32way)
@@ -1007,6 +1008,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_decrypt_32way)
 		     %ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
 		     %ymm15, %rax);
 
+	vzeroupper;
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_decrypt_32way)
@@ -1209,6 +1211,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_ctr_crypt_32way)
 		     %ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
 		     %ymm15, %r10);
 
+	vzeroupper;
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_ctr_crypt_32way)
@@ -1359,6 +1362,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_encrypt_32way)
 		     %ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
 		     %ymm15, %rax);
 
+	vzeroupper;
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_gfni_encrypt_32way)
@@ -1384,6 +1388,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_decrypt_32way)
 		     %ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
 		     %ymm15, %rax);
 
+	vzeroupper;
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_gfni_decrypt_32way)
@@ -1428,6 +1433,7 @@ SYM_TYPED_FUNC_START(aria_aesni_avx2_gfni_ctr_crypt_32way)
 		     %ymm8, %ymm9, %ymm10, %ymm11, %ymm12, %ymm13, %ymm14,
 		     %ymm15, %r10);
 
+	vzeroupper;
 	FRAME_END
 	RET;
 SYM_FUNC_END(aria_aesni_avx2_gfni_ctr_crypt_32way)

base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] crypto: x86/aria - add missing vzeroupper in AVX2 code
  2026-08-31 21:17 [PATCH RESEND] crypto: x86/aria - add missing vzeroupper in AVX2 code Eric Biggers
@ 2026-09-02  8:38 ` Herbert Xu
  2026-09-02 16:27   ` Eric Biggers
  2026-09-04  3:41 ` Herbert Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2026-09-02  8:38 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-crypto, linux-kernel, x86, stable, Taehee Yoo

On Mon, Aug 31, 2026 at 02:17:15PM -0700, Eric Biggers wrote:
> Since the AVX2 optimized ARIA code uses YMM registers, execute
> vzeroupper before returning from it.  This is needed to avoid degrading
> the performance of any later SSE code that may happen to be executed.
> 
> Fixes: 37d8d3ae7a58 ("crypto: x86/aria - implement aria-avx2")
> Cc: stable@vger.kernel.org
> Cc: Taehee Yoo <ap420073@gmail.com>
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
> 
> This didn't get picked up by the x86 maintainers yet.  Herbert, can you
> take this through the crypto tree?

OK I could do that.  I presume you want this to go into 7.3, right?

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] crypto: x86/aria - add missing vzeroupper in AVX2 code
  2026-09-02  8:38 ` Herbert Xu
@ 2026-09-02 16:27   ` Eric Biggers
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Biggers @ 2026-09-02 16:27 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto, linux-kernel, x86, stable, Taehee Yoo

On Wed, Sep 02, 2026 at 06:38:29PM +1000, Herbert Xu wrote:
> On Mon, Aug 31, 2026 at 02:17:15PM -0700, Eric Biggers wrote:
> > Since the AVX2 optimized ARIA code uses YMM registers, execute
> > vzeroupper before returning from it.  This is needed to avoid degrading
> > the performance of any later SSE code that may happen to be executed.
> > 
> > Fixes: 37d8d3ae7a58 ("crypto: x86/aria - implement aria-avx2")
> > Cc: stable@vger.kernel.org
> > Cc: Taehee Yoo <ap420073@gmail.com>
> > Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> > ---
> > 
> > This didn't get picked up by the x86 maintainers yet.  Herbert, can you
> > take this through the crypto tree?
> 
> OK I could do that.  I presume you want this to go into 7.3, right?
> 

It is a bug fix, so yes it should go into 7.3.

- Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND] crypto: x86/aria - add missing vzeroupper in AVX2 code
  2026-08-31 21:17 [PATCH RESEND] crypto: x86/aria - add missing vzeroupper in AVX2 code Eric Biggers
  2026-09-02  8:38 ` Herbert Xu
@ 2026-09-04  3:41 ` Herbert Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2026-09-04  3:41 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-crypto, linux-kernel, x86, stable, Taehee Yoo

On Mon, Aug 31, 2026 at 02:17:15PM -0700, Eric Biggers wrote:
> Since the AVX2 optimized ARIA code uses YMM registers, execute
> vzeroupper before returning from it.  This is needed to avoid degrading
> the performance of any later SSE code that may happen to be executed.
> 
> Fixes: 37d8d3ae7a58 ("crypto: x86/aria - implement aria-avx2")
> Cc: stable@vger.kernel.org
> Cc: Taehee Yoo <ap420073@gmail.com>
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
> 
> This didn't get picked up by the x86 maintainers yet.  Herbert, can you
> take this through the crypto tree?
> 
>  arch/x86/crypto/aria-aesni-avx2-asm_64.S | 6 ++++++
>  1 file changed, 6 insertions(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-04  3:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 21:17 [PATCH RESEND] crypto: x86/aria - add missing vzeroupper in AVX2 code Eric Biggers
2026-09-02  8:38 ` Herbert Xu
2026-09-02 16:27   ` Eric Biggers
2026-09-04  3:41 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox