From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DECE2385840C; Sun, 25 Sep 2022 08:17:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DECE2385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664093878; bh=kR24EcT74EOMzQYaXo7GCdFJ7dlbvCJTfv/O3dHjrZc=; h=From:To:Subject:Date:From; b=ZRPZOEC/4vGygDiOXmfp2UiXycmRjM5IUG8/lcMoj+LVCzHE4RreK3l2tt9l4Q2Ne WRyj1hF5vypeMaHCTWd4IGA92wS5lvKtWTzPAYDKnaEaNO8Rmk9lBmATE4mQhU+7aW 1ggdZgZHWC38rfrAPpiV89MdqqcODjGPRcarlZlw= From: "aurelien at aurel32 dot net" To: glibc-bugs@sourceware.org Subject: [Bug string/29611] New: Optimized AVX2 string functions unconditionally use BMI2 instructions Date: Sun, 25 Sep 2022 08:17:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: string X-Bugzilla-Version: 2.31 X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: aurelien at aurel32 dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: goldstein.w.n at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29611 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, caus= ing 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 microcod= e, 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 fl= ag. It also poses the question of backporting optimizations to stable release trees. --=20 You are receiving this mail because: You are on the CC list for the bug.=