Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp659066ybl; Tue, 7 Jan 2020 12:45:34 -0800 (PST) X-Google-Smtp-Source: APXvYqx6BZKQnNVFedR7S5/iVBZI0p4m2BdL90wRjGp+6NawIwFIP0QvNCXwTHuxf07kUAKPRE5p X-Received: by 2002:aca:5487:: with SMTP id i129mr215182oib.167.1578429933943; Tue, 07 Jan 2020 12:45:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578429933; cv=none; d=google.com; s=arc-20160816; b=AcK1U2xsPa0IYYNZ2ihgwI9MVzdWXTyHWB/EjkIWchYHbmLTacQrLCSm8wOLC5pGhG 4r0J8x32UqAiz1hoWuo0FfFXFr1WHy4cvG7xn0wqlaLCb4EKAL3E07BWxOO9StmTGWBr OX7Mq0Nndibu8Ej1bBbaFgs+IbyhHnXcg6m7iWqWHfDzJmTtMKaJjvtGTKpfVcudxQ7J TZchf5yeXiksrnAL3+YJO6O0aWlwGGzVW9rGf2cypgJ0H8TaQzC3EYEA2OAyFaHH39Ka plS8D6f4NhPVRHzAuVFswwewkKmPB75OcMKO+WMmhWNvVQE0M61QqTErCOAWxWNaFzPc EJtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=a7PhLxRLqwPOptIFbATUjStQXS7bfiLqgNZX9c8LwXs=; b=JtMRP80CqOr1Qo+59FQIhcu6zLJLihc/LKU0VkLsn6DiGRED7QQ4ac5chWFWZCtOYi n75U9VET1y5l02efacoQi3WTquqQTh9VFaxH8bGpGCyKt3AYu6V+cDIyURhUIfZQl1aN OOsIG8FFKCrF8OElIRASEsU0fhycEgvV+jGxTdB4dvDPXsn+ddUhdN+dz5W7BhiQQOaL qrE1owe8iBY309ZzUTVLp+068EKY2fsyq61jpa6VMlZ5xw4p4aGHKdCtHvOgOMgahzi9 mHSNSUHx5jHmWUnC5KfuOlPQFzmIJvPcK84zqqn8cLIYg7+31XjrNgl76m4g6/xAE8KP 6ZcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=ZKTM2S5i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z22si492487otq.94.2020.01.07.12.45.14; Tue, 07 Jan 2020 12:45:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=ZKTM2S5i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgAGUoD (ORCPT + 99 others); Tue, 7 Jan 2020 15:44:03 -0500 Received: from mail.efficios.com ([167.114.142.138]:42154 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726142AbgAGUoC (ORCPT ); Tue, 7 Jan 2020 15:44:02 -0500 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 2E119695809; Tue, 7 Jan 2020 15:44:01 -0500 (EST) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id fexXKIeQGx-B; Tue, 7 Jan 2020 15:44:00 -0500 (EST) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id B5CC9695804; Tue, 7 Jan 2020 15:44:00 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com B5CC9695804 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1578429840; bh=a7PhLxRLqwPOptIFbATUjStQXS7bfiLqgNZX9c8LwXs=; h=Date:From:To:Message-ID:MIME-Version; b=ZKTM2S5itDu6Awve+O/mF1Z1DX5vlX2ILroe6oGF/dB6a5uk77biDynUJCbg6DwKw CcG9GRdAJUbcjRJxAZKIn1w4voCXUki4k9prXYFNO7xBzlWj0DjkgeKNVfLeMFgqsr MEXM27U+M6YgEKGvnyTsKrRS6f5Owl95uKOkmXLnioDJl4/VxFJqEi+brVtOJMNZdA S8wqlt1Brlo5Sic/hy1ZdLrh0mcLN+u+JC5PnWX0VhmDJwkPXfKvHp1oxr4es6KZFc 2f9+s0YbRXUa0tF+ZQtdeut9RLk2EK8e6NYmAiq/XqrKYVHRBWxICRsgcyJX8C0gCs F87vrxZxFjXaA== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id 9XfQYqq71AKO; Tue, 7 Jan 2020 15:44:00 -0500 (EST) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id 9A43A6957F9; Tue, 7 Jan 2020 15:44:00 -0500 (EST) Date: Tue, 7 Jan 2020 15:44:00 -0500 (EST) From: Mathieu Desnoyers To: Florian Weimer Cc: carlos , Joseph Myers , Szabolcs Nagy , libc-alpha , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , Rich Felker , linux-kernel , linux-api Message-ID: <1968185366.4418.1578429840460.JavaMail.zimbra@efficios.com> In-Reply-To: <871rsbv4io.fsf@oldenburg2.str.redhat.com> References: <20200106155713.397-1-mathieu.desnoyers@efficios.com> <20200106155713.397-10-mathieu.desnoyers@efficios.com> <871rsbv4io.fsf@oldenburg2.str.redhat.com> Subject: Re: [RFC PATCH glibc 09/13] glibc: Perform rseq(2) registration at C startup and thread creation (v13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.15_GA_3894 (ZimbraWebClient - FF71 (Linux)/8.8.15_GA_3890) Thread-Topic: glibc: Perform rseq(2) registration at C startup and thread creation (v13) Thread-Index: 64OzZkIvDax4zK6QCleAiCxTyBhzYA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Jan 7, 2020, at 7:23 AM, Florian Weimer fweimer@redhat.com wrote: > * Mathieu Desnoyers: > >> Register rseq(2) TLS for each thread (including main), and unregister >> for each thread (excluding main). "rseq" stands for Restartable >> Sequences. >> >> See the rseq(2) man page proposed here: >> https://lkml.org/lkml/2018/9/19/647 >> >> This patch is based on glibc-2.30. The rseq(2) system call was merged >> into Linux 4.18. > > This patch needs to be updated for some be/le abilist splits. > Big-endian ABI lists for arm, microblaze, sh, appear to be missing. done. > This is something that can be checked with build-many-glibcs.py. OK. > >> diff --git a/manual/threads.texi b/manual/threads.texi >> index 0858ef8f92..059f781120 100644 >> --- a/manual/threads.texi >> +++ b/manual/threads.texi >> @@ -881,3 +881,20 @@ Behaves like @code{pthread_timedjoin_np} except that the >> absolute time in >> @c pthread_spin_unlock >> @c pthread_testcancel >> @c pthread_yield >> + >> +@node Restartable Sequences >> +@section Restartable Sequences >> +@cindex rseq >> + >> +This section describes the @glibcadj{} Restartable Sequences integration. >> + >> +The @glibcadj{} implements a __rseq_abi TLS symbol to interact with the > @Theglibc{} @code{__rseq_abi} > > >> +Restartable Sequences system call (Linux-specific). The layout of this >> +structure is defined by the Linux kernel rseq.h UAPI. Registration of each >> +thread's __rseq_abi is performed by @glibcadj{} at libc initialization and > @theglibc{} > @code{__rseq_abi} >> +pthread creation. > >> +Each supported architecture provide a RSEQ_SIG signature in sys/rseq.h. That > @code{RSEQ_SIG} @file{sys/rseq.h} > >> +signature is expected to be present in the code before each Restartable >> +Sequences abort handler. Failure to provide the expected signature may >> +terminate the process with a Segmentation fault. > > > Two spaces at the end of setences, please. All above done. > > The manual should use @deftypevar to create an index entry etc. for > __rseq_abi. See argp_program_version for an example of how to do this. OK. I've added __rseq_abi as a variable and RSEQ_SIG as a macro. > > I think current policy is to have documentation for at least the minimum > functionality in the manual. I understand that it makes it a lot of > work to write patches which add system call wrappers. Makes sense. Thanks! Mathieu > > Thanks, > Florian -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com