Browse Source

nptl: Increase default TCB alignment to 32

rseq support will use a 32-byte aligned field in struct pthread,
so the whole struct needs to have at least that alignment.

nptl/tst-tls3mod.c uses TCB_ALIGNMENT, therefore include <descr.h>
to obtain the fallback definition.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
siddhesh/realpath-and-getcwd
Florian Weimer 4 years ago
parent
commit
23c77f6018
  1. 4
      nptl/descr.h
  2. 1
      nptl/tst-tls3mod.c
  3. 3
      sysdeps/aarch64/nptl/pthreaddef.h
  4. 3
      sysdeps/alpha/nptl/pthreaddef.h
  5. 3
      sysdeps/arc/nptl/pthreaddef.h
  6. 3
      sysdeps/arm/nptl/pthreaddef.h
  7. 3
      sysdeps/csky/nptl/pthreaddef.h
  8. 3
      sysdeps/ia64/nptl/pthreaddef.h
  9. 3
      sysdeps/m68k/nptl/pthreaddef.h
  10. 3
      sysdeps/microblaze/nptl/pthreaddef.h
  11. 3
      sysdeps/mips/nptl/pthreaddef.h
  12. 3
      sysdeps/nios2/nptl/pthreaddef.h
  13. 3
      sysdeps/powerpc/nptl/pthreaddef.h
  14. 3
      sysdeps/riscv/nptl/pthreaddef.h
  15. 3
      sysdeps/s390/nptl/pthreaddef.h
  16. 3
      sysdeps/sh/nptl/pthreaddef.h
  17. 3
      sysdeps/sparc/sparc32/pthreaddef.h
  18. 4
      sysdeps/sparc/sparc64/pthreaddef.h

4
nptl/descr.h

@ -36,7 +36,9 @@
#include <tls-internal-struct.h>
#ifndef TCB_ALIGNMENT
# define TCB_ALIGNMENT sizeof (double)
# define TCB_ALIGNMENT 32
#elif TCB_ALIGNMENT < 32
# error TCB_ALIGNMENT must be at least 32
#endif

1
nptl/tst-tls3mod.c

@ -23,6 +23,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <pthreaddef.h>
#include <descr.h>
extern pthread_barrier_t b;

3
sysdeps/aarch64/nptl/pthreaddef.h

@ -28,8 +28,5 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/alpha/nptl/pthreaddef.h

@ -27,8 +27,5 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 4096
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/arc/nptl/pthreaddef.h

@ -28,8 +28,5 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 4
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/arm/nptl/pthreaddef.h

@ -28,9 +28,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame.

3
sysdeps/csky/nptl/pthreaddef.h

@ -28,8 +28,5 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 8
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/ia64/nptl/pthreaddef.h

@ -30,9 +30,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 16384
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __stack_pointer

3
sysdeps/m68k/nptl/pthreaddef.h

@ -27,9 +27,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/microblaze/nptl/pthreaddef.h

@ -31,8 +31,5 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/mips/nptl/pthreaddef.h

@ -27,9 +27,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/nios2/nptl/pthreaddef.h

@ -28,8 +28,5 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 4
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/powerpc/nptl/pthreaddef.h

@ -28,9 +28,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 4096
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/riscv/nptl/pthreaddef.h

@ -28,8 +28,5 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/s390/nptl/pthreaddef.h

@ -28,9 +28,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/sh/nptl/pthreaddef.h

@ -29,9 +29,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 8
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME __builtin_frame_address (0)

3
sysdeps/sparc/sparc32/pthreaddef.h

@ -27,9 +27,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 2048
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME (stack_pointer + (2 * 64))

4
sysdeps/sparc/sparc64/pthreaddef.h

@ -27,10 +27,6 @@
/* Minimal stack size after allocating thread descriptor and guard size. */
#define MINIMAL_REST_STACK 4096
/* Alignment requirement for TCB. */
#define TCB_ALIGNMENT 16
/* Location of current stack frame. */
#define CURRENT_STACK_FRAME (stack_pointer + (2 * 128))
register char *stack_pointer __asm__("%sp");

Loading…
Cancel
Save