public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Matheus Castanho <msc@linux.ibm.com>
Cc: libc-alpha@sourceware.org, Szabolcs Nagy <szabolcs.nagy@arm.com>
Subject: Re: [PATCH] Linux: Remove rseq support
Date: Thu, 16 Jul 2020 22:02:44 +0200	[thread overview]
Message-ID: <871rlbxm6z.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <2d4780bc-b565-8909-706d-9d2be669f065@linux.ibm.com> (Matheus Castanho's message of "Thu, 16 Jul 2020 15:01:53 -0300")

* Matheus Castanho:

> On 7/16/20 2:52 PM, Florian Weimer wrote:
>> * Matheus Castanho:
>> 
>>>> diff --git a/csu/libc-tls.c b/csu/libc-tls.c
>>>> index 3f1655f264..06e76bd395 100644
>>>> --- a/csu/libc-tls.c
>>>> +++ b/csu/libc-tls.c
>>>> @@ -112,12 +112,6 @@ __libc_setup_tls (void)
>>>>    size_t tcb_offset;
>>>>    const ElfW(Phdr) *phdr;
>>>>  
>>>> -  /* libc.so with rseq has TLS with 32-byte alignment.  Static dlopen
>>>> -     requires at least 32-byte alignment as well, otherwise loading
>>>> -     libc.so will always fail.  */
>>>> -  if (max_align < 32)
>>>> -    max_align = 32;
>>>> -
>>>>    struct link_map *main_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded;
>>>>  
>>>>    /* Look through the TLS segment if there is any.  */
>>>> diff --git a/elf/dl-tls.c b/elf/dl-tls.c
>>>> index 772e70d0f6..9a17427047 100644
>>>> --- a/elf/dl-tls.c
>>>> +++ b/elf/dl-tls.c
>>>> @@ -55,7 +55,7 @@
>>>>     but come on top when computing the number of namespaces.  */
>>>>  
>>>>  /* Size of initial-exec TLS in libc.so.  */
>>>> -#define LIBC_IE_TLS 192
>>>> +#define LIBC_IE_TLS 160
>>>
>>> ... this change?
>> 
>> It should work, given that we removed 32 bytes of TLS data with the
>> other changes.
>> 
>> Did you observe the failure on powerpc64le?
>
> Actually, on powerpc, powerpc64 and powerpc64le. The test is currently
> failing on all of them.

I'm not sure if the test is correct.

As far as I can see, the static TLS reserve not used up by optimizations
is just 512 bytes, but the static TLS sizes of the subsequent modules
are:

  elf/tst-tls-ie-mod4.so   1024 bytes
  elf/tst-tls-ie-mod5.so   128 bytes
  elf/tst-tls-ie-mod6.so   576 bytes

I think the implementation guarantees that this works only if the total
static TLS usage from dlopen is at most 512.

Since the test does not use multiple namespaces, it happened to pass
with the 96 or so extra bytes of TLS data we had before adjusting
LIBC_IE_TLS.

Thanks,
Florian


  reply	other threads:[~2020-07-16 20:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 15:11 Florian Weimer
2020-07-16 14:48 ` Mathieu Desnoyers
2020-07-16 14:53   ` Carlos O'Donell
2020-07-16 17:47 ` Matheus Castanho
2020-07-16 17:52   ` Florian Weimer
2020-07-16 18:01     ` Matheus Castanho
2020-07-16 20:02       ` Florian Weimer [this message]
2020-07-17  7:45         ` Szabolcs Nagy
2020-07-17  7:47           ` Florian Weimer
2020-07-17  8:03             ` Szabolcs Nagy
2020-07-17  8:26               ` Florian Weimer
2020-07-17  8:50                 ` Szabolcs Nagy
2020-07-17  8:59                   ` Szabolcs Nagy
2020-07-17  9:55                   ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rlbxm6z.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=msc@linux.ibm.com \
    --cc=szabolcs.nagy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).