public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug string/29611] New: Optimized AVX2 string functions unconditionally use BMI2 instructions
@ 2022-09-25  8:17 aurelien at aurel32 dot net
  2022-09-25 11:40 ` [Bug string/29611] " aurelien at aurel32 dot net
                   ` (67 more replies)
  0 siblings, 68 replies; 69+ messages in thread
From: aurelien at aurel32 dot net @ 2022-09-25  8:17 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=29611

            Bug ID: 29611
           Summary: Optimized AVX2 string functions unconditionally use
                    BMI2 instructions
           Product: glibc
           Version: 2.31
            Status: NEW
          Severity: critical
          Priority: P2
         Component: string
          Assignee: goldstein.w.n at gmail dot com
          Reporter: aurelien at aurel32 dot net
  Target Milestone: ---

Starting with commit aaa23c350715 ("x86: Optimize strlen-avx2.S"), the
optimized AVX2 string functions uses the bzhiq and sarxl instructions, causing
SIGILL on CPU which does have AVX2 instructions, but does not have BMI2
instructions.

For instance this happens on a Intel(R) Core(TM) i3-4000M CPU @ 2.40GHz:

cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i3-4000M CPU @ 2.40GHz
stepping        : 3
microcode       : 0x12

It *seems* that upgrading the microcode to level 0x28 fixes the issue. That
said why it is acceptable to have performance issues with an older microcode,
this should not prevent a system to boot.

This has been reported to affected Debian Bullseye (as the optimization have
been backported to the upstream release/2.31/master tree), Debian Sid and
Fedora Rawhide.

I think that the code should probably be reverted, or at least the IFUNC
functions using BMI2 instructions should be probably be gated by the CPU flag.
It also poses the question of backporting optimizations to stable release
trees.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-10-04  5:05 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25  8:17 [Bug string/29611] New: Optimized AVX2 string functions unconditionally use BMI2 instructions aurelien at aurel32 dot net
2022-09-25 11:40 ` [Bug string/29611] " aurelien at aurel32 dot net
2022-09-25 13:57 ` goldstein.w.n at gmail dot com
2022-09-25 14:09 ` goldstein.w.n at gmail dot com
2022-09-25 14:11 ` goldstein.w.n at gmail dot com
2022-09-26  5:18 ` aurelien at aurel32 dot net
2022-09-26  5:19 ` aurelien at aurel32 dot net
2022-09-26 14:05 ` goldstein.w.n at gmail dot com
2022-09-26 17:52 ` hjl.tools at gmail dot com
2022-09-28 14:01 ` skpgkp2 at gmail dot com
2022-09-28 14:01 ` skpgkp2 at gmail dot com
2022-09-28 15:01 ` goldstein.w.n at gmail dot com
2022-09-28 15:10 ` aurelien at aurel32 dot net
2022-09-28 15:52 ` goldstein.w.n at gmail dot com
2022-09-28 15:57 ` skpgkp2 at gmail dot com
2022-09-28 23:14 ` skpgkp2 at gmail dot com
2022-09-28 23:15 ` skpgkp2 at gmail dot com
2022-09-29  1:26 ` hjl.tools at gmail dot com
2022-09-29  1:59 ` cvs-commit at gcc dot gnu.org
2022-09-29  1:59 ` cvs-commit at gcc dot gnu.org
2022-09-29  2:00 ` cvs-commit at gcc dot gnu.org
2022-09-29  2:00 ` cvs-commit at gcc dot gnu.org
2022-09-29  2:34 ` cvs-commit at gcc dot gnu.org
2022-09-29  2:34 ` cvs-commit at gcc dot gnu.org
2022-09-29  2:35 ` cvs-commit at gcc dot gnu.org
2022-09-29  2:36 ` cvs-commit at gcc dot gnu.org
2022-09-29  2:36 ` cvs-commit at gcc dot gnu.org
2022-09-29  3:11 ` cvs-commit at gcc dot gnu.org
2022-09-29  3:11 ` cvs-commit at gcc dot gnu.org
2022-09-29 23:26 ` sam at gentoo dot org
2022-09-30 20:02 ` hjl.tools at gmail dot com
2022-10-01 15:23 ` aurelien at aurel32 dot net
2022-10-01 16:24 ` goldstein.w.n at gmail dot com
2022-10-01 16:51 ` goldstein.w.n at gmail dot com
2022-10-01 16:52 ` aurelien at aurel32 dot net
2022-10-03 21:46 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:46 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:47 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:47 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:47 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:47 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:47 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:51 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:51 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:51 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:51 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:51 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:51 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:51 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:55 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:55 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:55 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:56 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:56 ` cvs-commit at gcc dot gnu.org
2022-10-03 21:56 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:02 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:02 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:02 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:02 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:02 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:02 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:02 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:05 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:05 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:05 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:05 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:05 ` cvs-commit at gcc dot gnu.org
2022-10-03 22:05 ` cvs-commit at gcc dot gnu.org
2022-10-04  5:05 ` aurelien at aurel32 dot net

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 read-only IMAP folder(s) and NNTP newsgroup(s).