[PATCH] libitm/x86: Correct offsets of __private_tm and pointer_guard
H.J. Lu
hjl.tools@gmail.com
Tue Jun 12 11:12:00 GMT 2018
On Tue, Jun 12, 2018 at 1:23 AM, Torvald Riegel <triegel@redhat.com> wrote:
> On Wed, 2018-05-30 at 07:54 -0700, H.J. Lu 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?
>
> The patch itself looks okay to me, but the commit message is pretty
> cryptic. I can't ack for release branches.
>
I checked in the patch with the updated commit message:
https://gcc.gnu.org/ml/gcc-cvs/2018-06/msg00446.html
Jakub, is this OK for release branches.
Thanks.
--
H.J.
More information about the Gcc-patches
mailing list