glibc/SOURCES/glibc-upstream-2.34-288.patch
2022-11-15 11:09:11 +00:00

34 lines
1.1 KiB
Diff

commit 820504e3edd7276bf869d543ad5b57187ff9c9b6
Author: Noah Goldstein <goldstein.w.n@gmail.com>
Date: Fri Jun 3 18:52:37 2022 -0500
x86: ZERO_UPPER_VEC_REGISTERS_RETURN_XTEST expect no transactions
Give fall-through path to `vzeroupper` and taken-path to `vzeroall`.
Generally even on machines with RTM the expectation is the
string-library functions will not be called in transactions.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit c28db9cb29a7d6cf3ce08fd8445e6b7dea03f35b)
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
index 93e44be22e2275f1..04478b097cdffe20 100644
--- a/sysdeps/x86_64/sysdep.h
+++ b/sysdeps/x86_64/sysdep.h
@@ -99,11 +99,11 @@ lose: \
to avoid RTM abort triggered by VZEROUPPER inside transactionally. */
#define ZERO_UPPER_VEC_REGISTERS_RETURN_XTEST \
xtest; \
- jz 1f; \
- vzeroall; \
+ jnz 1f; \
+ vzeroupper; \
ret; \
1: \
- vzeroupper; \
+ vzeroall; \
ret
/* Can be used to replace vzeroupper that is not directly before a