From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.efficios.com (mail.efficios.com [167.114.26.124]) by sourceware.org (Postfix) with ESMTPS id 66C16388B01D for ; Tue, 26 May 2020 15:22:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 66C16388B01D Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 2A2B32539DC; Tue, 26 May 2020 11:22:06 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id r5CHuBHdRu9w; Tue, 26 May 2020 11:22:05 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id CCA652539D9; Tue, 26 May 2020 11:22:05 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com CCA652539D9 X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 15NWPF5usT5q; Tue, 26 May 2020 11:22:05 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id BC77C253D8A; Tue, 26 May 2020 11:22:05 -0400 (EDT) Date: Tue, 26 May 2020 11:22:05 -0400 (EDT) From: Mathieu Desnoyers To: Florian Weimer Cc: libc-alpha , Rich Felker , linux-api , Boqun Feng , Will Deacon , linux-kernel , Peter Zijlstra , Ben Maurer , Dave Watson , Thomas Gleixner , Paul , Paul Turner , Joseph Myers Message-ID: <1940294182.34562.1590506525684.JavaMail.zimbra@efficios.com> In-Reply-To: <877dwypwuj.fsf@oldenburg2.str.redhat.com> References: <20200501021439.2456-1-mathieu.desnoyers@efficios.com> <87367ovy6k.fsf@oldenburg2.str.redhat.com> <108939265.33525.1590428184533.JavaMail.zimbra@efficios.com> <87lflerhqt.fsf@oldenburg2.str.redhat.com> <1701081361.34159.1590503556923.JavaMail.zimbra@efficios.com> <87ftbmpxqi.fsf@oldenburg2.str.redhat.com> <1931644690.34207.1590504804638.JavaMail.zimbra@efficios.com> <877dwypwuj.fsf@oldenburg2.str.redhat.com> Subject: Re: [PATCH glibc 1/3] glibc: Perform rseq registration at C startup and thread creation (v19) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3928 (ZimbraWebClient - FF76 (Linux)/8.8.15_GA_3928) Thread-Topic: glibc: Perform rseq registration at C startup and thread creation (v19) Thread-Index: fw53pKjM0pFKmGwjq/cBVSRtxzONcQ== X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 May 2020 15:22:07 -0000 ----- On May 26, 2020, at 10:57 AM, Florian Weimer fweimer@redhat.com wrote= : > * Mathieu Desnoyers: >=20 >>> Like the attribute, it needs to come right after the struct keyword, I >>> think. (Trailing attributes can be ambiguous, but not in this case.) >> >> Nope. _Alignas really _is_ special :-( >> >> struct _Alignas (16) blah { >> int a; >> }; >> >> p.c:1:8: error: expected =E2=80=98{=E2=80=99 before =E2=80=98_Alignas=E2= =80=99 >> struct _Alignas (16) blah { >=20 > Meh, yet another unnecessary C++ incompatibility. C does not support > empty structs, so I assume they didn't see the field requirement as a > burden. Indeed, it's weird. >=20 >> One last thing I'm planning to add in sys/rseq.h to cover acessing the >> rseq_cs pointers with both the UAPI headers and the glibc struct rseq >> declarations: >> >> /* The rseq_cs_ptr macro can be used to access the pointer to the curren= t >> rseq critical section descriptor. */ >> #ifdef __LP64__ >> # define rseq_cs_ptr(rseq) \ >> ((const struct rseq_cs *) (rseq)->rseq_cs.ptr) >> #else /* __LP64__ */ >> # define rseq_cs_ptr(rseq) \ >> ((const struct rseq_cs *) (rseq)->rseq_cs.ptr.ptr32) >> #endif /* __LP64__ */ >> >> Does it make sense ? >=20 > Written this way, it's an aliasing violation. I don't think it's very > useful. OK, I'll just remove it. Thanks, Mathieu --=20 Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com