Blame SOURCES/0001-mesa-add-support-for-CET-to-x86-x86-64-asm-files.patch

928187
diff -up mesa-19.1.4/meson.build.cet mesa-19.1.4/meson.build
928187
--- mesa-19.1.4/meson.build.cet	2019-08-08 02:39:16.000000000 +1000
928187
+++ mesa-19.1.4/meson.build	2019-08-09 15:31:35.381426323 +1000
928187
@@ -1061,6 +1061,10 @@ foreach f : ['strtof', 'mkostemp', 'posi
928187
   endif
928187
 endforeach
928187
 
928187
+if cc.has_header('cet.h')
928187
+   pre_args += '-DHAVE_CET_H'
928187
+endif
928187
+
928187
 # strtod locale support
928187
 if cc.links('''
928187
     #define _GNU_SOURCE
928187
diff -up mesa-19.1.4/src/mesa/x86/3dnow_xform1.S.cet mesa-19.1.4/src/mesa/x86/3dnow_xform1.S
928187
--- mesa-19.1.4/src/mesa/x86/3dnow_xform1.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/3dnow_xform1.S	2019-08-09 15:31:35.381426323 +1000
928187
@@ -37,7 +37,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points1_general )
928187
 HIDDEN(_mesa_3dnow_transform_points1_general)
928187
 GLNAME( _mesa_3dnow_transform_points1_general ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -102,7 +102,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points1_identity )
928187
 HIDDEN(_mesa_3dnow_transform_points1_identity)
928187
 GLNAME( _mesa_3dnow_transform_points1_identity ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -150,7 +150,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points1_3d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points1_3d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points1_3d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -208,7 +208,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points1_perspective )
928187
 HIDDEN(_mesa_3dnow_transform_points1_perspective)
928187
 GLNAME( _mesa_3dnow_transform_points1_perspective ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -262,7 +262,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points1_2d )
928187
 HIDDEN(_mesa_3dnow_transform_points1_2d)
928187
 GLNAME( _mesa_3dnow_transform_points1_2d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -318,7 +318,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points1_2d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points1_2d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points1_2d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -372,7 +372,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points1_3d )
928187
 HIDDEN(_mesa_3dnow_transform_points1_3d)
928187
 GLNAME( _mesa_3dnow_transform_points1_3d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
diff -up mesa-19.1.4/src/mesa/x86/3dnow_xform2.S.cet mesa-19.1.4/src/mesa/x86/3dnow_xform2.S
928187
--- mesa-19.1.4/src/mesa/x86/3dnow_xform2.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/3dnow_xform2.S	2019-08-09 15:31:35.382426334 +1000
928187
@@ -37,7 +37,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points2_general )
928187
 HIDDEN(_mesa_3dnow_transform_points2_general)
928187
 GLNAME( _mesa_3dnow_transform_points2_general ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -118,7 +118,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points2_perspective )
928187
 HIDDEN(_mesa_3dnow_transform_points2_perspective)
928187
 GLNAME( _mesa_3dnow_transform_points2_perspective ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -174,7 +174,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points2_3d )
928187
 HIDDEN(_mesa_3dnow_transform_points2_3d)
928187
 GLNAME( _mesa_3dnow_transform_points2_3d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -251,7 +251,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points2_3d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points2_3d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points2_3d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -310,7 +310,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points2_2d )
928187
 HIDDEN(_mesa_3dnow_transform_points2_2d)
928187
 GLNAME( _mesa_3dnow_transform_points2_2d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -374,7 +374,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points2_2d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points2_2d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points2_2d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -430,7 +430,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points2_identity )
928187
 HIDDEN(_mesa_3dnow_transform_points2_identity)
928187
 GLNAME( _mesa_3dnow_transform_points2_identity ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
diff -up mesa-19.1.4/src/mesa/x86/3dnow_xform3.S.cet mesa-19.1.4/src/mesa/x86/3dnow_xform3.S
928187
--- mesa-19.1.4/src/mesa/x86/3dnow_xform3.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/3dnow_xform3.S	2019-08-09 15:31:35.382426334 +1000
928187
@@ -37,7 +37,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points3_general )
928187
 HIDDEN(_mesa_3dnow_transform_points3_general)
928187
 GLNAME( _mesa_3dnow_transform_points3_general ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -122,7 +122,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points3_perspective )
928187
 HIDDEN(_mesa_3dnow_transform_points3_perspective)
928187
 GLNAME( _mesa_3dnow_transform_points3_perspective ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -203,7 +203,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points3_3d )
928187
 HIDDEN(_mesa_3dnow_transform_points3_3d)
928187
 GLNAME( _mesa_3dnow_transform_points3_3d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -291,7 +291,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points3_3d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points3_3d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points3_3d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -367,7 +367,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points3_2d )
928187
 HIDDEN(_mesa_3dnow_transform_points3_2d)
928187
 GLNAME( _mesa_3dnow_transform_points3_2d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -440,7 +440,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points3_2d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points3_2d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points3_2d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -507,7 +507,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points3_identity )
928187
 HIDDEN(_mesa_3dnow_transform_points3_identity)
928187
 GLNAME( _mesa_3dnow_transform_points3_identity ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
diff -up mesa-19.1.4/src/mesa/x86/3dnow_xform4.S.cet mesa-19.1.4/src/mesa/x86/3dnow_xform4.S
928187
--- mesa-19.1.4/src/mesa/x86/3dnow_xform4.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/3dnow_xform4.S	2019-08-09 15:31:35.383426344 +1000
928187
@@ -37,7 +37,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points4_general )
928187
 HIDDEN(_mesa_3dnow_transform_points4_general)
928187
 GLNAME( _mesa_3dnow_transform_points4_general ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -130,7 +130,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points4_perspective )
928187
 HIDDEN(_mesa_3dnow_transform_points4_perspective)
928187
 GLNAME( _mesa_3dnow_transform_points4_perspective ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -210,7 +210,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points4_3d )
928187
 HIDDEN(_mesa_3dnow_transform_points4_3d)
928187
 GLNAME( _mesa_3dnow_transform_points4_3d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -300,7 +300,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points4_3d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points4_3d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points4_3d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
     MOV_L     ( ARG_DEST, ECX )
928187
     MOV_L     ( ARG_MATRIX, ESI )
928187
@@ -373,7 +373,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points4_2d )
928187
 HIDDEN(_mesa_3dnow_transform_points4_2d)
928187
 GLNAME( _mesa_3dnow_transform_points4_2d ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -448,7 +448,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points4_2d_no_rot )
928187
 HIDDEN(_mesa_3dnow_transform_points4_2d_no_rot)
928187
 GLNAME( _mesa_3dnow_transform_points4_2d_no_rot ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
@@ -516,7 +516,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_3dnow_transform_points4_identity )
928187
 HIDDEN(_mesa_3dnow_transform_points4_identity)
928187
 GLNAME( _mesa_3dnow_transform_points4_identity ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L    ( ESI )
928187
 
928187
     MOV_L     ( ARG_DEST, ECX )
928187
diff -up mesa-19.1.4/src/mesa/x86-64/xform4.S.cet mesa-19.1.4/src/mesa/x86-64/xform4.S
928187
--- mesa-19.1.4/src/mesa/x86-64/xform4.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86-64/xform4.S	2019-08-09 15:31:35.384426355 +1000
928187
@@ -21,6 +21,11 @@
928187
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
928187
  * OTHER DEALINGS IN THE SOFTWARE.
928187
  */
928187
+#ifdef HAVE_CET_H
928187
+#include <cet.h>
928187
+#else
928187
+#define _CET_ENDBR
928187
+#endif
928187
 
928187
 #ifdef USE_X86_64_ASM
928187
 
928187
@@ -32,6 +37,7 @@
928187
 .globl _mesa_x86_64_cpuid
928187
 .hidden _mesa_x86_64_cpuid
928187
 _mesa_x86_64_cpuid:
928187
+	_CET_ENDBR
928187
 	pushq	%rbx
928187
 	movl	(%rdi), %eax
928187
 	movl	8(%rdi), %ecx
928187
@@ -54,6 +60,7 @@ _mesa_x86_64_transform_points4_general:
928187
  *	rsi = matrix
928187
  *	rdx = source
928187
  */
928187
+	_CET_ENDBR
928187
 	movl V4F_COUNT(%rdx), %ecx	/* count */
928187
 	movzbl V4F_STRIDE(%rdx), %eax	/* stride */
928187
 
928187
@@ -129,7 +136,7 @@ p4_constants:
928187
  * because it ensures that the last matrix row (or is it column?) is 0,0,0,1
928187
  */
928187
 _mesa_x86_64_transform_points4_3d:
928187
-
928187
+	_CET_ENDBR
928187
 	leaq p4_constants(%rip), %rax
928187
 
928187
 	prefetchnta 64(%rsi)
928187
@@ -197,7 +204,7 @@ p4_3d_done:
928187
 .globl _mesa_x86_64_transform_points4_identity
928187
 .hidden _mesa_x86_64_transform_points4_identity
928187
 _mesa_x86_64_transform_points4_identity:
928187
-
928187
+	_CET_ENDBR
928187
 	movl V4F_COUNT(%rdx), %ecx	/* count */
928187
 	movzbl V4F_STRIDE(%rdx), %eax	/* stride */
928187
 
928187
@@ -226,7 +233,7 @@ p4_identity_done:
928187
 .globl _mesa_3dnow_transform_points4_3d_no_rot
928187
 .hidden _mesa_3dnow_transform_points4_3d_no_rot
928187
 _mesa_3dnow_transform_points4_3d_no_rot:
928187
-
928187
+	_CET_ENDBR
928187
 	movl V4F_COUNT(%rdx), %ecx	/* count */
928187
 	movzbl V4F_STRIDE(%rdx), %eax	/* stride */
928187
 
928187
@@ -291,7 +298,7 @@ p4_3d_no_rot_done:
928187
 .globl _mesa_3dnow_transform_points4_perspective
928187
 .hidden _mesa_3dnow_transform_points4_perspective
928187
 _mesa_3dnow_transform_points4_perspective:
928187
-
928187
+	_CET_ENDBR
928187
 	movl V4F_COUNT(%rdx), %ecx	/* count */
928187
 	movzbl V4F_STRIDE(%rdx), %eax	/* stride */
928187
 
928187
@@ -358,7 +365,7 @@ p4_perspective_done:
928187
 .globl _mesa_3dnow_transform_points4_2d_no_rot
928187
 .hidden _mesa_3dnow_transform_points4_2d_no_rot
928187
 _mesa_3dnow_transform_points4_2d_no_rot:
928187
-
928187
+	_CET_ENDBR
928187
 	movl V4F_COUNT(%rdx), %ecx	/* count */
928187
 	movzbl V4F_STRIDE(%rdx), %eax	/* stride */
928187
 
928187
@@ -414,7 +421,7 @@ p4_2d_no_rot_done:
928187
 .globl _mesa_3dnow_transform_points4_2d
928187
 .hidden _mesa_3dnow_transform_points4_2d
928187
 _mesa_3dnow_transform_points4_2d:
928187
-
928187
+	_CET_ENDBR
928187
 	movl V4F_COUNT(%rdx), %ecx	/* count */
928187
 	movzbl V4F_STRIDE(%rdx), %eax	/* stride */
928187
 
928187
diff -up mesa-19.1.4/src/mesa/x86/assyntax.h.cet mesa-19.1.4/src/mesa/x86/assyntax.h
928187
--- mesa-19.1.4/src/mesa/x86/assyntax.h.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/assyntax.h	2019-08-09 15:31:35.384426355 +1000
928187
@@ -1736,4 +1736,11 @@
928187
 #  define HIDDEN(x)
928187
 #endif
928187
 
928187
+/* Control flow enforcement support */
928187
+#ifdef HAVE_CET_H
928187
+#include <cet.h>
928187
+#else
928187
+#define _CET_ENDBR
928187
+#endif
928187
+
928187
 #endif /* __ASSYNTAX_H__ */
928187
diff -up mesa-19.1.4/src/mesa/x86/common_x86_asm.S.cet mesa-19.1.4/src/mesa/x86/common_x86_asm.S
928187
--- mesa-19.1.4/src/mesa/x86/common_x86_asm.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/common_x86_asm.S	2019-08-09 15:31:35.385426365 +1000
928187
@@ -49,7 +49,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_x86_has_cpuid)
928187
 HIDDEN(_mesa_x86_has_cpuid)
928187
 GLNAME(_mesa_x86_has_cpuid):
928187
-
928187
+	_CET_ENDBR
928187
 	/* Test for the CPUID command.  If the ID Flag bit in EFLAGS
928187
 	 * (bit 21) is writable, the CPUID command is present */
928187
 	PUSHF_L
928187
@@ -73,7 +73,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_x86_cpuid)
928187
 HIDDEN(_mesa_x86_cpuid)
928187
 GLNAME(_mesa_x86_cpuid):
928187
-
928187
+	_CET_ENDBR
928187
 	MOV_L	(REGOFF(4, ESP), EAX)		/* cpuid op */
928187
 	PUSH_L	(EDI)
928187
 	PUSH_L	(EBX)
928187
@@ -97,7 +97,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_x86_cpuid_eax)
928187
 HIDDEN(_mesa_x86_cpuid_eax)
928187
 GLNAME(_mesa_x86_cpuid_eax):
928187
-
928187
+	_CET_ENDBR
928187
 	MOV_L	(REGOFF(4, ESP), EAX)		/* cpuid op */
928187
 	PUSH_L	(EBX)
928187
 
928187
@@ -110,7 +110,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_x86_cpuid_ebx)
928187
 HIDDEN(_mesa_x86_cpuid_ebx)
928187
 GLNAME(_mesa_x86_cpuid_ebx):
928187
-
928187
+	_CET_ENDBR
928187
 	MOV_L	(REGOFF(4, ESP), EAX)		/* cpuid op */
928187
 	PUSH_L	(EBX)
928187
 
928187
@@ -124,7 +124,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_x86_cpuid_ecx)
928187
 HIDDEN(_mesa_x86_cpuid_ecx)
928187
 GLNAME(_mesa_x86_cpuid_ecx):
928187
-
928187
+	_CET_ENDBR
928187
 	MOV_L	(REGOFF(4, ESP), EAX)		/* cpuid op */
928187
 	PUSH_L	(EBX)
928187
 
928187
@@ -138,7 +138,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_x86_cpuid_edx)
928187
 HIDDEN(_mesa_x86_cpuid_edx)
928187
 GLNAME(_mesa_x86_cpuid_edx):
928187
-
928187
+	_CET_ENDBR
928187
 	MOV_L	(REGOFF(4, ESP), EAX)		/* cpuid op */
928187
 	PUSH_L	(EBX)
928187
 
928187
@@ -164,7 +164,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME( _mesa_test_os_sse_support )
928187
 HIDDEN(_mesa_test_os_sse_support)
928187
 GLNAME( _mesa_test_os_sse_support ):
928187
-
928187
+	_CET_ENDBR
928187
 	XORPS	( XMM0, XMM0 )
928187
 
928187
 	RET
928187
@@ -179,7 +179,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME( _mesa_test_os_sse_exception_support )
928187
 HIDDEN(_mesa_test_os_sse_exception_support)
928187
 GLNAME( _mesa_test_os_sse_exception_support ):
928187
-
928187
+	_CET_ENDBR
928187
 	PUSH_L	( EBP )
928187
 	MOV_L	( ESP, EBP )
928187
 	SUB_L	( CONST( 8 ), ESP )
928187
diff -up mesa-19.1.4/src/mesa/x86/mmx_blendtmp.h.cet mesa-19.1.4/src/mesa/x86/mmx_blendtmp.h
928187
--- mesa-19.1.4/src/mesa/x86/mmx_blendtmp.h.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/mmx_blendtmp.h	2019-08-09 15:31:35.385426365 +1000
928187
@@ -15,7 +15,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( TAG(_mesa_mmx_blend) )
928187
 HIDDEN( TAG(_mesa_mmx_blend) )
928187
 GLNAME( TAG(_mesa_mmx_blend) ):
928187
-
928187
+    _CET_ENDBR
928187
     PUSH_L     ( EBP )
928187
     MOV_L      ( ESP, EBP )
928187
     PUSH_L     ( ESI )
928187
diff -up mesa-19.1.4/src/mesa/x86/read_rgba_span_x86.S.cet mesa-19.1.4/src/mesa/x86/read_rgba_span_x86.S
928187
--- mesa-19.1.4/src/mesa/x86/read_rgba_span_x86.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/read_rgba_span_x86.S	2019-08-09 15:32:08.817778784 +1000
928187
@@ -29,7 +29,12 @@
928187
  *
928187
  * \author Ian Romanick <idr@us.ibm.com>
928187
  */
928187
-
928187
+/* Control flow enforcement support */
928187
+#ifdef HAVE_CET_H
928187
+#include <cet.h>
928187
+#else
928187
+#define _CET_ENDBR
928187
+#endif
928187
 	.file	"read_rgba_span_x86.S"
928187
 #if !defined(__MINGW32__) && !defined(__APPLE__) /* this one cries for assyntax.h */
928187
 /* Kevin F. Quinn 2nd July 2006
928187
@@ -80,6 +85,7 @@
928187
 .hidden _generic_read_RGBA_span_BGRA8888_REV_MMX
928187
 	.type	_generic_read_RGBA_span_BGRA8888_REV_MMX, @function
928187
 _generic_read_RGBA_span_BGRA8888_REV_MMX:
928187
+	_CET_ENDBR
928187
 	pushl	%ebx
928187
 
928187
 #ifdef USE_INNER_EMMS
928187
@@ -175,6 +181,7 @@ _generic_read_RGBA_span_BGRA8888_REV_MMX
928187
 .hidden _generic_read_RGBA_span_BGRA8888_REV_SSE
928187
 	.type	_generic_read_RGBA_span_BGRA8888_REV_SSE, @function
928187
 _generic_read_RGBA_span_BGRA8888_REV_SSE:
928187
+	_CET_ENDBR
928187
 	pushl	%esi
928187
 	pushl	%ebx
928187
 	pushl	%ebp
928187
@@ -338,6 +345,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE
928187
 .hidden _generic_read_RGBA_span_BGRA8888_REV_SSE2
928187
 	.type	_generic_read_RGBA_span_BGRA8888_REV_SSE2, @function
928187
 _generic_read_RGBA_span_BGRA8888_REV_SSE2:
928187
+	_CET_ENDBR
928187
 	pushl	%esi
928187
 	pushl	%ebx
928187
 
928187
@@ -498,7 +506,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE
928187
 	.type	_generic_read_RGBA_span_RGB565_MMX, @function
928187
 
928187
 _generic_read_RGBA_span_RGB565_MMX:
928187
-
928187
+	_CET_ENDBR
928187
 #ifdef USE_INNER_EMMS
928187
 	emms
928187
 #endif
928187
diff -up mesa-19.1.4/src/mesa/x86/sse_normal.S.cet mesa-19.1.4/src/mesa/x86/sse_normal.S
928187
--- mesa-19.1.4/src/mesa/x86/sse_normal.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/sse_normal.S	2019-08-09 15:31:35.386426376 +1000
928187
@@ -47,7 +47,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME(_mesa_sse_transform_rescale_normals_no_rot)
928187
 HIDDEN(_mesa_sse_transform_rescale_normals_no_rot)
928187
 GLNAME(_mesa_sse_transform_rescale_normals_no_rot):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L  ( ESI )
928187
 	PUSH_L  ( EDI )
928187
@@ -109,7 +109,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME(_mesa_sse_transform_rescale_normals)
928187
 HIDDEN(_mesa_sse_transform_rescale_normals)
928187
 GLNAME(_mesa_sse_transform_rescale_normals):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L  ( ESI )
928187
 	PUSH_L  ( EDI )
928187
@@ -202,7 +202,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME(_mesa_sse_transform_normals_no_rot)
928187
 HIDDEN(_mesa_sse_transform_normals_no_rot)
928187
 GLNAME(_mesa_sse_transform_normals_no_rot):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L  ( ESI )
928187
 	PUSH_L  ( EDI )
928187
diff -up mesa-19.1.4/src/mesa/x86/sse_xform1.S.cet mesa-19.1.4/src/mesa/x86/sse_xform1.S
928187
--- mesa-19.1.4/src/mesa/x86/sse_xform1.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/sse_xform1.S	2019-08-09 15:31:35.386426376 +1000
928187
@@ -46,7 +46,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points1_general)
928187
 HIDDEN( _mesa_sse_transform_points1_general )
928187
 GLNAME( _mesa_sse_transform_points1_general ):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L    ( ESI )
928187
     PUSH_L    ( EDI )
928187
@@ -103,7 +103,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points1_identity)
928187
 HIDDEN(_mesa_sse_transform_points1_identity)
928187
 GLNAME( _mesa_sse_transform_points1_identity ):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L    ( ESI )
928187
     PUSH_L    ( EDI )
928187
@@ -155,7 +155,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points1_3d_no_rot)
928187
 HIDDEN(_mesa_sse_transform_points1_3d_no_rot)
928187
 GLNAME(_mesa_sse_transform_points1_3d_no_rot):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L( ESI )
928187
     PUSH_L( EDI )
928187
@@ -216,7 +216,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points1_perspective)
928187
 HIDDEN(_mesa_sse_transform_points1_perspective)
928187
 GLNAME(_mesa_sse_transform_points1_perspective):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L   ( ESI )
928187
     PUSH_L   ( EDI )
928187
@@ -275,7 +275,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points1_2d)
928187
 HIDDEN(_mesa_sse_transform_points1_2d)
928187
 GLNAME(_mesa_sse_transform_points1_2d):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L( ESI )
928187
     PUSH_L( EDI )
928187
@@ -330,7 +330,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points1_2d_no_rot)
928187
 HIDDEN(_mesa_sse_transform_points1_2d_no_rot)
928187
 GLNAME(_mesa_sse_transform_points1_2d_no_rot):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
@@ -387,7 +387,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points1_3d)
928187
 HIDDEN(_mesa_sse_transform_points1_3d)
928187
 GLNAME(_mesa_sse_transform_points1_3d):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
diff -up mesa-19.1.4/src/mesa/x86/sse_xform2.S.cet mesa-19.1.4/src/mesa/x86/sse_xform2.S
928187
--- mesa-19.1.4/src/mesa/x86/sse_xform2.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/sse_xform2.S	2019-08-09 15:31:35.387426386 +1000
928187
@@ -46,7 +46,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points2_general)
928187
 HIDDEN (_mesa_sse_transform_points2_general)
928187
 GLNAME( _mesa_sse_transform_points2_general ):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L    ( ESI )
928187
     PUSH_L    ( EDI )
928187
@@ -107,7 +107,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points2_identity)
928187
 HIDDEN(_mesa_sse_transform_points2_identity)
928187
 GLNAME( _mesa_sse_transform_points2_identity ):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L    ( ESI )
928187
     PUSH_L    ( EDI )
928187
@@ -160,7 +160,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points2_3d_no_rot)
928187
 HIDDEN(_mesa_sse_transform_points2_3d_no_rot)
928187
 GLNAME(_mesa_sse_transform_points2_3d_no_rot):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L( ESI )
928187
     PUSH_L( EDI )
928187
@@ -221,7 +221,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points2_perspective)
928187
 HIDDEN(_mesa_sse_transform_points2_perspective)
928187
 GLNAME(_mesa_sse_transform_points2_perspective):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L   ( ESI )
928187
     PUSH_L   ( EDI )
928187
@@ -280,7 +280,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points2_2d)
928187
 HIDDEN(_mesa_sse_transform_points2_2d)
928187
 GLNAME(_mesa_sse_transform_points2_2d):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L( ESI )
928187
     PUSH_L( EDI )
928187
@@ -343,7 +343,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points2_2d_no_rot)
928187
 HIDDEN(_mesa_sse_transform_points2_2d_no_rot)
928187
 GLNAME(_mesa_sse_transform_points2_2d_no_rot):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
@@ -400,7 +400,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points2_3d)
928187
 HIDDEN(_mesa_sse_transform_points2_3d)
928187
 GLNAME(_mesa_sse_transform_points2_3d):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
diff -up mesa-19.1.4/src/mesa/x86/sse_xform3.S.cet mesa-19.1.4/src/mesa/x86/sse_xform3.S
928187
--- mesa-19.1.4/src/mesa/x86/sse_xform3.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/sse_xform3.S	2019-08-09 15:31:35.388426397 +1000
928187
@@ -46,7 +46,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points3_general)
928187
 HIDDEN(_mesa_sse_transform_points3_general)
928187
 GLNAME( _mesa_sse_transform_points3_general ):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L    ( ESI )
928187
     PUSH_L    ( EDI )
928187
@@ -116,7 +116,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points3_identity)
928187
 HIDDEN(_mesa_sse_transform_points3_identity)
928187
 GLNAME( _mesa_sse_transform_points3_identity ):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L    ( ESI )
928187
     PUSH_L    ( EDI )
928187
@@ -171,7 +171,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points3_3d_no_rot)
928187
 HIDDEN(_mesa_sse_transform_points3_3d_no_rot)
928187
 GLNAME(_mesa_sse_transform_points3_3d_no_rot):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L( ESI )
928187
     PUSH_L( EDI )
928187
@@ -239,7 +239,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points3_perspective)
928187
 HIDDEN(_mesa_sse_transform_points3_perspective)
928187
 GLNAME(_mesa_sse_transform_points3_perspective):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L   ( ESI )
928187
     PUSH_L   ( EDI )
928187
@@ -312,7 +312,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points3_2d)
928187
 HIDDEN(_mesa_sse_transform_points3_2d)
928187
 GLNAME(_mesa_sse_transform_points3_2d):
928187
-
928187
+    _CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
     PUSH_L( ESI )
928187
     PUSH_L( EDI )
928187
@@ -377,7 +377,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points3_2d_no_rot)
928187
 HIDDEN(_mesa_sse_transform_points3_2d_no_rot)
928187
 GLNAME(_mesa_sse_transform_points3_2d_no_rot):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
@@ -438,7 +438,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME(_mesa_sse_transform_points3_3d)
928187
 HIDDEN(_mesa_sse_transform_points3_3d)
928187
 GLNAME(_mesa_sse_transform_points3_3d):
928187
-
928187
+	_CET_ENDBR
928187
 #define FRAME_OFFSET 8
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
diff -up mesa-19.1.4/src/mesa/x86/sse_xform4.S.cet mesa-19.1.4/src/mesa/x86/sse_xform4.S
928187
--- mesa-19.1.4/src/mesa/x86/sse_xform4.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/sse_xform4.S	2019-08-09 15:31:35.388426397 +1000
928187
@@ -43,7 +43,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_sse_transform_points4_general )
928187
 HIDDEN(_mesa_sse_transform_points4_general)
928187
 GLNAME( _mesa_sse_transform_points4_general ):
928187
-
928187
+	_CET_ENDBR
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
 
928187
@@ -115,7 +115,7 @@ ALIGNTEXT4
928187
 GLOBL GLNAME( _mesa_sse_transform_points4_3d )
928187
 HIDDEN(_mesa_sse_transform_points4_3d)
928187
 GLNAME( _mesa_sse_transform_points4_3d ):
928187
-
928187
+	_CET_ENDBR
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
 
928187
@@ -187,7 +187,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_sse_transform_points4_identity )
928187
 HIDDEN(_mesa_sse_transform_points4_identity)
928187
 GLNAME( _mesa_sse_transform_points4_identity ):
928187
-
928187
+	_CET_ENDBR
928187
 	PUSH_L( ESI )
928187
 	PUSH_L( EDI )
928187
 
928187
diff -up mesa-19.1.4/src/mesa/x86/x86_cliptest.S.cet mesa-19.1.4/src/mesa/x86/x86_cliptest.S
928187
--- mesa-19.1.4/src/mesa/x86/x86_cliptest.S.cet	2019-08-08 02:39:17.000000000 +1000
928187
+++ mesa-19.1.4/src/mesa/x86/x86_cliptest.S	2019-08-09 15:31:35.388426397 +1000
928187
@@ -103,7 +103,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_x86_cliptest_points4 )
928187
 HIDDEN(_mesa_x86_cliptest_points4)
928187
 GLNAME( _mesa_x86_cliptest_points4 ):
928187
-
928187
+	_CET_ENDBR
928187
 #ifdef ELFPIC
928187
 #define FRAME_OFFSET 20
928187
 #else
928187
@@ -278,7 +278,7 @@ ALIGNTEXT16
928187
 GLOBL GLNAME( _mesa_x86_cliptest_points4_np )
928187
 HIDDEN(_mesa_x86_cliptest_points4_np)
928187
 GLNAME( _mesa_x86_cliptest_points4_np ):
928187
-
928187
+	_CET_ENDBR
928187
 #ifdef ELFPIC
928187
 #define FRAME_OFFSET 20
928187
 #else