This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] PowerPC64: Add __private_ss field to TCB header
- From: Steven Munroe <munroesj at linux dot vnet dot ibm dot comcom>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>, Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 14 Nov 2013 13:51:01 -0600
- Subject: Re: [PATCH] PowerPC64: Add __private_ss field to TCB header
- Authentication-results: sourceware.org; auth=none
- References: <201311122119 dot rACLJ1Fc016035 at d06av02 dot portsmouth dot uk dot ibm dot com>
- Reply-to: munroe at us dot ibm dot com
On Tue, 2013-11-12 at 22:19 +0100, Ulrich Weigand wrote:
> the TCB header on Intel contains a field __private_ss that is used
> to efficiently implement the -fsplit-stack GCC feature.
> In order to prepare for a possible future implementation of that
> feature on powerpc64, we'd like to reserve a similar field in
> the TCB header as well. (It would be good if this went in with
> or before the ELFv2 patches to ensure that this field will be
> available always in the ELFv2 environment.)
> The field needs to be added at the front of tcbhead_t structure
> to avoid changing the ABI; see the recent discussion when adding
> the EBB fields.
> Tested on powerpc64-linux and powerpc64le-linux.
> OK for mainline?
I have to remind myself each time how this sould work ...
"The tp offset allows for efficient addressing of the TCB and up to
4K-16 of other thread library information."
/* The following assumes that TP (R2 or R13) points to the end of the
TCB + 0x7000 (per the ABI). This implies that TCB address is
TP - 0x7000. As we define TLS_DTV_AT_TP we can
assume that the pthread struct is allocated immediately ahead of the
TCB. This implies that the pthread_descr address is
TP - (TLS_PRE_TCB_SIZE + 0x7000). */
The key is that new fields are added above previous fields so to
maintain upward compatibility release to release.
Adhemerval is that correct?
> 2013-11-12 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
> * sysdeps/powerpc/tls.h (tcbhead_t): Add __private_ss field.
> Index: glibc/nptl/sysdeps/powerpc/tls.h
> --- glibc.orig/nptl/sysdeps/powerpc/tls.h
> +++ glibc/nptl/sysdeps/powerpc/tls.h
> @@ -61,6 +61,8 @@ typedef union dtv
> are private. */
> typedef struct
> + /* GCC split stack support. */
> + void *__private_ss;
> /* Reservation for the Event-Based Branching ABI. */
> uintptr_t ebb_handler;
> uintptr_t ebb_ctx_pointer;