This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PING^2: [PATCH] libitm/x86: Correct offsets of __private_tm and pointer_guard
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jeffrey Law <law at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, Torvald Riegel <triegel at redhat dot com>
- Date: Mon, 11 Jun 2018 05:41:31 -0700
- Subject: PING^2: [PATCH] libitm/x86: Correct offsets of __private_tm and pointer_guard
On Mon, Jun 4, 2018 at 6:10 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Wed, May 30, 2018 at 7:54 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>> In glibc, sysdeps/i386/nptl/tls.h has
>>
>> typedef struct
>> {
>> void *tcb; /* Pointer to the TCB. Not necessarily the
>> thread descriptor used by libpthread. */
>> dtv_t *dtv;
>> void *self; /* Pointer to the thread descriptor. */
>> int multiple_threads;
>> uintptr_t sysinfo;
>> uintptr_t stack_guard;
>> uintptr_t pointer_guard;
>> int gscope_flag;
>> int __glibc_reserved1;
>> /* Reservation of some values for the TM ABI. */
>> void *__private_tm[4];
>> /* GCC split stack support. */
>> void *__private_ss;
>> } tcbhead_t;
>>
>> and sysdeps/x86_64/nptl/tls.h has
>>
>> typedef struct
>> {
>> void *tcb; /* Pointer to the TCB. Not necessarily the
>> thread descriptor used by libpthread. */
>> dtv_t *dtv;
>> void *self; /* Pointer to the thread descriptor. */
>> int multiple_threads;
>> int gscope_flag;
>> uintptr_t sysinfo;
>> uintptr_t stack_guard;
>> uintptr_t pointer_guard;
>> unsigned long int vgetcpu_cache[2];
>> int __glibc_reserved1;
>> int __glibc_unused1;
>> /* Reservation of some values for the TM ABI. */
>> void *__private_tm[4];
>> /* GCC split stack support. */
>> void *__private_ss;
>> long int __glibc_reserved2;
>> /* Must be kept even if it is no longer used by glibc since programs,
>> like AddressSanitizer, depend on the size of tcbhead_t. */
>> __128bits __glibc_unused2[8][4] __attribute__ ((aligned (32)));
>>
>> void *__padding[8];
>> } tcbhead_t;
>>
>> The offsets of __private_tm are
>>
>> i386: 36 bytes
>> x32: 48 bytes
>> x86_64: 80 bytes
>>
>> and the offsets of pointer_guard are:
>>
>> i386: 24 bytes
>> x32: 28 bytes
>> x86_64: 48 bytes
>>
>> Update SEG_READ and SEG_WRITE to use the offset of __private_tm as base
>> and correct the offset of pointer_guard for x32.
>>
>> Tested on i686, x86-64 and x32. OK for trunk and release branches?
>>
>
> Any comments, objections?
>
> BTW, this patch doesn't change ABI of libitm.
>
PING:
https://gcc.gnu.org/ml/gcc-patches/2018-05/msg01733.html
--
H.J.