diff --git a/glibc.spec b/glibc.spec index b045364115bdf69bed0fa6ff6f826e56290a4a95..d504bb5a146df4100129ca4462abeb70fd669c3c 100644 --- a/glibc.spec +++ b/glibc.spec @@ -67,7 +67,7 @@ ############################################################################## Name: glibc Version: 2.38 -Release: 75 +Release: 76 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -367,6 +367,7 @@ Patch277: loongarch-Drop-__GI_XXX-for-strcpy-stpcpy-IFUNC-impl.patch Patch278: x86-64-Don-t-use-SSE-resolvers-for-ISA-level-3-or-ab.patch Patch279: x86-64-Simplify-minimum-ISA-check-ifdef-conditional-.patch Patch280: x86-Skip-XSAVE-state-size-reset-if-ISA-level-require.patch +Patch281: x86-fix-wmemset-ifunc-stray-bug-33542.patch #openEuler patch list Patch9000: turn-default-value-of-x86_rep_stosb_threshold_form_2K_to_1M.patch @@ -1602,6 +1603,9 @@ fi %endif %changelog +* Wed Nov 05 2025 Qingqing Li - 2.38-76 +- x86: fix wmemset ifunc stray '!' (bug 33542) + * Tue Nov 04 2025 jinshuaiyu - 2.38-75 - Backport patches from glibc upstream 2.38 branch - Free dynarray buffer after parsing nsswitch.conf diff --git a/x86-fix-wmemset-ifunc-stray-bug-33542.patch b/x86-fix-wmemset-ifunc-stray-bug-33542.patch new file mode 100644 index 0000000000000000000000000000000000000000..118cce14888a27383593fe07d0884ffe074baa11 --- /dev/null +++ b/x86-fix-wmemset-ifunc-stray-bug-33542.patch @@ -0,0 +1,52 @@ +From 96f1804a0d968ec361211fb63486e672bf4f363b Mon Sep 17 00:00:00 2001 +From: Jiamei Xie +Date: Tue, 14 Oct 2025 20:14:11 +0800 +Subject: [PATCH] x86: fix wmemset ifunc stray '!' (bug 33542) + +The ifunc selector for wmemset had a stray '!' in the +X86_ISA_CPU_FEATURES_ARCH_P(...) check: + + if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2) + && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features, + AVX_Fast_Unaligned_Load, !)) + +This effectively negated the predicate and caused the AVX2/AVX512 +paths to be skipped, making the dispatcher fall back to the SSE2 +implementation even on CPUs where AVX2/AVX512 are available. The +regression leads to noticeable throughput loss for wmemset. + +Remove the stray '!' so the AVX_Fast_Unaligned_Load capability is +tested as intended and the correct AVX2/EVEX variants are selected. + +Impact: +- On AVX2/AVX512-capable x86_64, wmemset no longer incorrectly + falls back to SSE2; perf now shows __wmemset_evex/avx2 variants. + +Testing: +- benchtests/bench-wmemset shows improved bandwidth across sizes. +- perf confirm the selected symbol is no longer SSE2. + +Signed-off-by: xiejiamei +Signed-off-by: Li jing +Reviewed-by: Adhemerval Zanella +(cherry picked from commit 4d86b6cdd8132e0410347e07262239750f86dfb4) +--- + sysdeps/x86_64/multiarch/ifunc-wmemset.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysdeps/x86_64/multiarch/ifunc-wmemset.h b/sysdeps/x86_64/multiarch/ifunc-wmemset.h +index 1fbbd3d68e..7f68fabfc8 100644 +--- a/sysdeps/x86_64/multiarch/ifunc-wmemset.h ++++ b/sysdeps/x86_64/multiarch/ifunc-wmemset.h +@@ -35,7 +35,7 @@ IFUNC_SELECTOR (void) + + if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX2) + && X86_ISA_CPU_FEATURES_ARCH_P (cpu_features, +- AVX_Fast_Unaligned_Load, !)) ++ AVX_Fast_Unaligned_Load,)) + { + if (X86_ISA_CPU_FEATURE_USABLE_P (cpu_features, AVX512VL)) + { +-- +2.27.0 +