6c0556
commit e5fa62b8db546f8792ec9e5c61e6419f4f8e3f4d
6c0556
Author: Wilco Dijkstra <wdijkstr@arm.com>
6c0556
Date:   Thu Jan 6 14:36:28 2022 +0000
6c0556
6c0556
    AArch64: Check for SVE in ifuncs [BZ #28744]
6c0556
    
6c0556
    Add a check for SVE in the A64FX ifuncs for memcpy, memset and memmove.
6c0556
    This fixes BZ #28744.
6c0556
6c0556
Conflicts:
6c0556
	sysdeps/aarch64/multiarch/memcpy.c
6c0556
	sysdeps/aarch64/multiarch/memmove.c
6c0556
	sysdeps/aarch64/multiarch/memset.c
6c0556
	  (IFUNC resolver differences in the backport.)
6c0556
6c0556
diff --git a/sysdeps/aarch64/multiarch/memcpy.c b/sysdeps/aarch64/multiarch/memcpy.c
6c0556
index e0313c42e82a7b86..a6ebeb06d3bda00f 100644
6c0556
--- a/sysdeps/aarch64/multiarch/memcpy.c
6c0556
+++ b/sysdeps/aarch64/multiarch/memcpy.c
6c0556
@@ -44,7 +44,7 @@ libc_ifunc (__libc_memcpy,
6c0556
 		: (IS_THUNDERX2 (midr) || IS_THUNDERX2PA (midr)
6c0556
 		  ? __memcpy_thunderx2
6c0556
 # if HAVE_AARCH64_SVE_ASM
6c0556
-		  : (IS_A64FX (midr)
6c0556
+		  : (IS_A64FX (midr) && sve
6c0556
 		     ? __memcpy_a64fx
6c0556
 		     : __memcpy_generic)))));
6c0556
 # else
6c0556
diff --git a/sysdeps/aarch64/multiarch/memmove.c b/sysdeps/aarch64/multiarch/memmove.c
6c0556
index d96612b9cf7c3a4e..bea72b3eddde54c0 100644
6c0556
--- a/sysdeps/aarch64/multiarch/memmove.c
6c0556
+++ b/sysdeps/aarch64/multiarch/memmove.c
6c0556
@@ -41,7 +41,7 @@ libc_ifunc (__libc_memmove,
6c0556
 	     : (IS_FALKOR (midr) || IS_PHECDA (midr)
6c0556
 		? __memmove_falkor
6c0556
 # if HAVE_AARCH64_SVE_ASM
6c0556
-		: (IS_A64FX (midr)
6c0556
+		: (IS_A64FX (midr) && sve
6c0556
 		   ? __memmove_a64fx
6c0556
 		   : __memmove_generic))));
6c0556
 # else
6c0556
diff --git a/sysdeps/aarch64/multiarch/memset.c b/sysdeps/aarch64/multiarch/memset.c
6c0556
index 2c8cc72bb0b18474..e7bd412377533f18 100644
6c0556
--- a/sysdeps/aarch64/multiarch/memset.c
6c0556
+++ b/sysdeps/aarch64/multiarch/memset.c
6c0556
@@ -38,7 +38,7 @@ libc_ifunc (__libc_memset,
6c0556
 	    ((IS_FALKOR (midr) || IS_PHECDA (midr)) && zva_size == 64
6c0556
 	     ? __memset_falkor
6c0556
 # if HAVE_AARCH64_SVE_ASM
6c0556
-	     : (IS_A64FX (midr)
6c0556
+	     : (IS_A64FX (midr) && sve
6c0556
 		? __memset_a64fx
6c0556
 		: __memset_generic)));
6c0556
 # else