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