Created attachment 14093 [details] Sample fix for 2.35 branch The commit c6272098323153db373f2986c67786ea8c85f1cf ("x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #28896]") was backported as fd412fff6d2bd322ec24ebd13fab196efc6c5506 to the 2.35 branch, but the backported version doesn't cover all of the fallback cases in the original commit. (Looking at #28896, maybe the original version got backported rather than the revised version that went into master?) On my i7-9700KF, this causes string/tst-strncmp-rtm and string/tst-wcsncmp-rtm to fail with: error: ../sysdeps/x86/tst-string-rtm.h:63: TSX abort rate: 100.00% (3000 out of 3000) I've attached an example patch to fix this for 2.35 - just making the appropriate bit of sysdeps/x86_64/multiarch/strcmp-avx2.S match what's now in master - but a similar fix probably needs applying to the other release branches too.
Seems to be missing: https://sourceware.org/git/?p=glibc.git;a=commit;h=fd412fff6d2bd322ec24ebd13fab196efc6c5506 commit c6272098323153db373f2986c67786ea8c85f1cf Author: Noah Goldstein <goldstein.w.n@gmail.com> Date: Tue Feb 15 08:18:15 2022 -0600 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #28896]
The release/2.35/master branch has been updated by Sunil Pandey <skpgkp2@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ac87df8d750b0734e20ffb82d1d0d0efbe4b6212 commit ac87df8d750b0734e20ffb82d1d0d0efbe4b6212 Author: Noah Goldstein <goldstein.w.n@gmail.com> Date: Tue Feb 15 08:18:15 2022 -0600 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #29127] Re-cherry-pick commit c627209832 for strcmp-avx2.S change which was omitted in intial cherry pick because at the time this bug was not present on release branch. Fixes BZ #29127. In the overflow fallback strncmp-avx2-rtm and wcsncmp-avx2-rtm would call strcmp-avx2 and wcscmp-avx2 respectively. This would have not checks around vzeroupper and would trigger spurious aborts. This commit fixes that. test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass on AVX2 machines with and without RTM. Co-authored-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit c6272098323153db373f2986c67786ea8c85f1cf)
The release/2.34/master branch has been updated by Sunil Pandey <skpgkp2@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=83ae8287c1c3009459ff29241b647ff61363b22c commit 83ae8287c1c3009459ff29241b647ff61363b22c Author: Noah Goldstein <goldstein.w.n@gmail.com> Date: Tue Feb 15 08:18:15 2022 -0600 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #29127] Re-cherry-pick commit c627209832 for strcmp-avx2.S change which was omitted in intial cherry pick because at the time this bug was not present on release branch. Fixes BZ #29127. In the overflow fallback strncmp-avx2-rtm and wcsncmp-avx2-rtm would call strcmp-avx2 and wcscmp-avx2 respectively. This would have not checks around vzeroupper and would trigger spurious aborts. This commit fixes that. test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass on AVX2 machines with and without RTM. Co-authored-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit c6272098323153db373f2986c67786ea8c85f1cf)
The release/2.33/master branch has been updated by Sunil Pandey <skpgkp2@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=69f16619e7119e26d70c00ac8b8750ed350147a3 commit 69f16619e7119e26d70c00ac8b8750ed350147a3 Author: Noah Goldstein <goldstein.w.n@gmail.com> Date: Tue Feb 15 08:18:15 2022 -0600 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #29127] Re-cherry-pick commit c627209832 for strcmp-avx2.S change which was omitted in intial cherry pick because at the time this bug was not present on release branch. Fixes BZ #29127. In the overflow fallback strncmp-avx2-rtm and wcsncmp-avx2-rtm would call strcmp-avx2 and wcscmp-avx2 respectively. This would have not checks around vzeroupper and would trigger spurious aborts. This commit fixes that. test-strcmp, test-strncmp, test-wcscmp, and test-wcsncmp all pass on AVX2 machines with and without RTM. Co-authored-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit c6272098323153db373f2986c67786ea8c85f1cf)
Excellent - I can confirm the 2.35 branch fix works for me. Thanks very much!
Fixed on 2.35 branch.