Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp624818ybt; Wed, 24 Jun 2020 07:24:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEiWzkntxEI9If0wvjhTxhkL2LeBjXWrZknVQZlVcVi/Bl6TAy4/XVW1Na+Yvot0U/j/+a X-Received: by 2002:a17:906:84a:: with SMTP id f10mr26655235ejd.102.1593008659007; Wed, 24 Jun 2020 07:24:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593008659; cv=none; d=google.com; s=arc-20160816; b=TRhivrjgZYzMsd60t+DujrbqofwVKf5soNOn/ZpR9CkdYbJZsfUfj4dy8Gsxov6kgr E9zD9ul/hMfG9JvdiR0Vb7j+2LHq1Y1PFYNepDdqbzwXS2F973DgN3r1V85veCfHvSxX a2KXuhvHBSYQBTVCplKf37qNHh9qLgCwa94sY1d1Ju6AnkeNBpq1MBuYBWdT3C00nU4p hKOTPUlkDvXDFn0UnQC0Uix0DtNTj+Frh9lkILetqx424UBMoo+WAwluFqG1yTY/iOnf /Oqt2/MJNw4Ps/vljChrXgJz0HNSsHl47eF2rcp6U0zvOBM4SyjuIEyYUqZWqmVo/NtN AZug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=92CRg7/XrXcME80ros9TCvbAqAcJmchKORDBQXOuZmQ=; b=GXYtF8l9mN9LH0Wm/sl4Ej1wKEdBOVuK1+ogygo5amUV8pgFkBzIUoBRYPNYAxnUdX O8ahUTvONojcxPV1i1naYAVYLGLK7r5MP4fiSSHTYhuSbVGRIujpy6y7UM1CydDssi5/ CKb9+goW7aszZh/lNfsqG7MN8ekvDR1GWroKBys8ZjLDLjG89NQsAqBjPeQWo6eCNEp4 55ni07G57SdDwgiRaU5Mgp6oIWBdA2hR/ddsYJVroLAx5I+6zpKvjhWlV8EATc+bRfdE 0mxPu+92LUtgzPyqPl74EErf6ymQ/lzUGBA5g/wxpNDczjrXDWJba6TF9EYRIimwYqp9 Y0tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GYDBcLLL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si12956750edq.86.2020.06.24.07.23.55; Wed, 24 Jun 2020 07:24:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GYDBcLLL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391217AbgFXOVE (ORCPT + 99 others); Wed, 24 Jun 2020 10:21:04 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58300 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388115AbgFXOVC (ORCPT ); Wed, 24 Jun 2020 10:21:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593008461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=92CRg7/XrXcME80ros9TCvbAqAcJmchKORDBQXOuZmQ=; b=GYDBcLLL+K+nrip+m7mbKwA55dN2YopmXeUtjMP42b0L/9acxG2Kpm0Sp28RNLH13b67cK nRLCSu5U6OU1cHOgIUGQSBp63YI162sJHkBYyE7zeRReW7cS9FPRoIW0rsdt5eYwx4pCeW lBeZQL+Pg5IlH8CY3+vTKEU4jEerWdk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-Bb8cjwniOn2RRxk4fH1gAg-1; Wed, 24 Jun 2020 10:20:58 -0400 X-MC-Unique: Bb8cjwniOn2RRxk4fH1gAg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 36C558064AE; Wed, 24 Jun 2020 14:20:55 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-113-18.ams2.redhat.com [10.36.113.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F73019D7D; Wed, 24 Jun 2020 14:20:49 +0000 (UTC) From: Florian Weimer To: Mathieu Desnoyers Cc: Carlos O'Donell , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , Rich Felker , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH 1/3] glibc: Perform rseq registration at C startup and thread creation (v21) References: <20200622180803.1449-1-mathieu.desnoyers@efficios.com> <20200622180803.1449-2-mathieu.desnoyers@efficios.com> Date: Wed, 24 Jun 2020 16:20:47 +0200 In-Reply-To: <20200622180803.1449-2-mathieu.desnoyers@efficios.com> (Mathieu Desnoyers's message of "Mon, 22 Jun 2020 14:08:01 -0400") Message-ID: <87d05obl4w.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathieu Desnoyers: > diff --git a/manual/threads.texi b/manual/threads.texi > index bb7a42c655..d5069d5581 100644 > --- a/manual/threads.texi > +++ b/manual/threads.texi > +@deftypevar {struct rseq} __rseq_abi > +@standards{Linux, sys/rseq.h} > +@Theglibc{} implements a @code{__rseq_abi} TLS symbol to interact with > +the Restartable Sequences system call. The layout of this structure is > +defined by the @file{sys/rseq.h} header. Registration of each thread's > +@code{__rseq_abi} is performed by @theglibc{} at library initialization > +and thread creation. The manual for the rseq system call can be found > +at @uref{https://git.kernel.org/pub/scm/libs/librseq/librseq.git/tree/do= c/man/rseq.2}. Should be =E2=80=9Ccreation. The=E2=80=9D (two spaces after a sentence-end= ing period). > diff --git a/sysdeps/unix/sysv/linux/sys/rseq.h b/sysdeps/unix/sysv/linux= /sys/rseq.h > new file mode 100644 > index 0000000000..5e118c1781 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/sys/rseq.h > +#ifdef __cplusplus > +# if __cplusplus >=3D 201103L > +# define __rseq_static_assert(expr, diagnostic) static_assert (expr, di= agnostic) > +# define __rseq_alignof(type) alignof (type) > +# define __rseq_tls_storage_class thread_local > +# endif > +#elif (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) >=3D 201112L > +# define __rseq_static_assert(expr, diagnostic) _Static_assert (expr, d= iagnostic) > +# define __rseq_alignof(type) _Alignof (type) > +# define __rseq_tls_storage_class _Thread_local > +#endif > + > +#ifndef __rseq_static_assert > +/* Try to use _Static_assert macro from sys/cdefs.h. */ > +# ifdef _Static_assert > +# define __rseq_static_assert(expr, diagnostic) _Static_assert (expr, d= iagnostic) > +# else > +# define __rseq_static_assert(expr, diagnostic) /* Nothing. */ > +# endif > +#endif > + > +/* Rely on GNU extensions for older standards and tls model. */ > +#ifdef __GNUC__ > +# ifndef __rseq_alignof > +# define __rseq_alignof(x) __alignof__ (x) > +# endif > +# define __rseq_tls_model_ie __attribute__ ((__tls_model__ ("initial-exe= c"))) > +#else > +/* Specifying the TLS model on the declaration is optional. */ > +# define __rseq_tls_model_ie /* Nothing. */ > +#endif I'm still worried that __rseq_static_assert and __rseq_alignof will show up in the UAPI with textually different definitions. (This does not apply to __rseq_tls_model_ie.) Is my worry unfounded? Thanks, Florian