• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From a632d534c73eeb3e3db8c7540d811194ef7c79ff Mon Sep 17 00:00:00 2001
2From: Bernd Edlinger <bernd.edlinger@hotmail.de>
3Date: Tue, 22 Aug 2023 16:07:30 +0200
4Subject: [PATCH] Avoid clobbering non-volatile XMM registers
5
6This affects some Poly1305 assembler functions
7which are only used for certain CPU types.
8
9Remove those functions for Windows targets,
10as a simple interim solution.
11
12Fixes #21522
13
14Reviewed-by: Tomas Mraz <tomas@openssl.org>
15Reviewed-by: Paul Dale <pauli@openssl.org>
16(Merged from https://github.com/openssl/openssl/pull/21808)
17
18(cherry picked from commit 7b8e27bc2e02238986d89ef0ece067ec1b48e165)
19---
20 crypto/poly1305/asm/poly1305-x86_64.pl | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23diff --git a/crypto/poly1305/asm/poly1305-x86_64.pl b/crypto/poly1305/asm/poly1305-x86_64.pl
24index 5f834d8faf..801455c639 100755
25--- a/crypto/poly1305/asm/poly1305-x86_64.pl
26+++ b/crypto/poly1305/asm/poly1305-x86_64.pl
27@@ -193,7 +193,7 @@ $code.=<<___	if ($avx>1);
28 	bt	\$`5+32`,%r9		# AVX2?
29 	cmovc	%rax,%r10
30 ___
31-$code.=<<___	if ($avx>3);
32+$code.=<<___	if ($avx>3 && !$win64);
33 	mov	\$`(1<<31|1<<21|1<<16)`,%rax
34 	shr	\$32,%r9
35 	and	%rax,%r9
36@@ -2722,7 +2722,7 @@ $code.=<<___;
37 .cfi_endproc
38 .size	poly1305_blocks_avx512,.-poly1305_blocks_avx512
39 ___
40-if ($avx>3) {
41+if ($avx>3 && !$win64) {
42 ########################################################################
43 # VPMADD52 version using 2^44 radix.
44 #
45--
462.34.1
47
48