Blame SOURCES/glibc-rh642584.patch

b9ba6d
2010-10-13  H.J. Lu  <hongjiu.lu@intel.com>
b9ba6d
b9ba6d
	[BZ #12113]
b9ba6d
	* sysdeps/x86_64/pthreaddef.h (TCB_ALIGNMENT): Changed to 32.
b9ba6d
	* sysdeps/x86_64/tls.h (TLS_TCB_ALIGN): Defined with alignment
b9ba6d
	of "struct pthread".
b9ba6d
b9ba6d
Index: glibc-2.12-2-gc4ccff1/nptl/sysdeps/x86_64/pthreaddef.h
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/nptl/sysdeps/x86_64/pthreaddef.h
b9ba6d
+++ glibc-2.12-2-gc4ccff1/nptl/sysdeps/x86_64/pthreaddef.h
b9ba6d
@@ -27,8 +27,9 @@
b9ba6d
 /* Minimal stack size after allocating thread descriptor and guard size.  */
b9ba6d
 #define MINIMAL_REST_STACK	2048
b9ba6d
 
b9ba6d
-/* Alignment requirement for TCB.  */
b9ba6d
-#define TCB_ALIGNMENT		16
b9ba6d
+/* Alignment requirement for TCB.  Need to store post-AVX vector registers
b9ba6d
+   in the TCB and we want the storage to be aligned at 32-byte.  */
b9ba6d
+#define TCB_ALIGNMENT		32
b9ba6d
 
b9ba6d
 
b9ba6d
 /* Location of current stack frame.  The frame pointer is not usable.  */
b9ba6d
Index: glibc-2.12-2-gc4ccff1/nptl/sysdeps/x86_64/tls.h
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/nptl/sysdeps/x86_64/tls.h
b9ba6d
+++ glibc-2.12-2-gc4ccff1/nptl/sysdeps/x86_64/tls.h
b9ba6d
@@ -117,12 +117,7 @@ typedef struct
b9ba6d
 # define TLS_TCB_SIZE sizeof (struct pthread)
b9ba6d
 
b9ba6d
 /* Alignment requirements for the TCB.  */
b9ba6d
-//# define TLS_TCB_ALIGN __alignof__ (struct pthread)
b9ba6d
-// Normally the above would be correct  But we have to store post-AVX
b9ba6d
-// vector registers in the TCB and we want the storage to be aligned.
b9ba6d
-// unfortunately there isn't yet a type for these values and hence no
b9ba6d
-// 32-byte alignment requirement.  Make this explicit, for now.
b9ba6d
-# define TLS_TCB_ALIGN 32
b9ba6d
+# define TLS_TCB_ALIGN __alignof__ (struct pthread)
b9ba6d
 
b9ba6d
 /* The TCB can have any size and the memory following the address the
b9ba6d
    thread pointer points to is unspecified.  Allocate the TCB there.  */