about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2022-06-03 18:52:37 -0500
committerSunil K Pandey <skpgkp2@gmail.com>2022-07-18 22:13:57 -0700
commita2e10e7a0291b2fe3c67ca9635bc41745e216c95 (patch)
treeeb0a4f69df77da23c9b186a51381e89d827c47f2
parent289f772721e088f4b3f9204903bc6cba7e860849 (diff)
downloadglibc-a2e10e7a0291b2fe3c67ca9635bc41745e216c95.tar.gz
glibc-a2e10e7a0291b2fe3c67ca9635bc41745e216c95.tar.xz
glibc-a2e10e7a0291b2fe3c67ca9635bc41745e216c95.zip
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)
-rw-r--r--sysdeps/x86_64/sysdep.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h
index 93e44be22e..04478b097c 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