Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp988277imm; Wed, 19 Sep 2018 10:04:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYB6xDImVjd4ui/YN4CqKRqWtomhmcTCgk4a8E9hc9YBB/S6Ylm9opGkI+IpDyTdEvqdH6Z X-Received: by 2002:a63:6c04:: with SMTP id h4-v6mr20506366pgc.290.1537376674092; Wed, 19 Sep 2018 10:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537376674; cv=none; d=google.com; s=arc-20160816; b=MVZ1aItI1RqN0V6CHRRYpOmVPMdUNYkx05woj32KT3lIPRzhALh/Q++ILYXEMbFeKE jKKYtl5MQNbaG0nqpS+S9jnDDYJWtwT2K8pBHwE6VRhYONLzDSYTbbv3tIGzouxs9xdT ATlJonFFDRBAMANfmw4yQLTP8wxNxij8BY6wAnaYESNr/G0GtexiYsc1bsZDFvhRGvNb k5BmK0sJ+nu3tfUFoJuqSNwYzjjt0hGR69ae2gHvQDg5mASeygXgKQKpV/CXWkHQcx1W vcnzAwRDenJCAVJpZFVe7yaRm2sKa1yXEG2b7YzMVZs8jkZ/D02Z38My3KWGymyJ/a5k hNUg== 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=vPL2Q2AaGgRJFXwbevUjgDAkJjmRz+aOOpXAItzUHm0=; b=dpE1vHImyfBUrx7vh/YXAJxJHqJuftjn28Y90j9gDqxZCQNOmDzoVuTVD6gbQsBOcS HgeWGV92bj/rNk/zLDBdOCOtfauE98rwXn1rmdLCiiSPG632R3V8GbjwgWbjE3kEA6bx bQ3IPKK4MUTItZGvNKAyj+Tpj0A4NK5R+uA7NUj+pEm5j4lj6VFGqPVcn8ZwmYodY4ae DAh1no2CS6K6wKKTYwuMm5sQ4y36gA8+MFedyWUVJeLaFEFYnbQ4jMzWTRITzH0dv+RK MqBf5x/w8mcexbArnWFRx2Aj4nFdquge21tOIp2J0VUfmDqLLG1kcQ0fJBItvpS/5RIW PEZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=PUKembXv; 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 l67-v6si22588470pfi.179.2018.09.19.10.04.18; Wed, 19 Sep 2018 10:04:34 -0700 (PDT) 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=PUKembXv; 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 S1732381AbeISWcF (ORCPT + 99 others); Wed, 19 Sep 2018 18:32:05 -0400 Received: from mail.efficios.com ([167.114.142.138]:50434 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728096AbeISWcF (ORCPT ); Wed, 19 Sep 2018 18:32:05 -0400 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 94B2123FE12; Wed, 19 Sep 2018 12:53:15 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id FbZ5bGcgpbqu; Wed, 19 Sep 2018 12:53:14 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id C67EF23FE04; Wed, 19 Sep 2018 12:53:14 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com C67EF23FE04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1537375994; bh=vPL2Q2AaGgRJFXwbevUjgDAkJjmRz+aOOpXAItzUHm0=; h=Date:From:To:Message-ID:MIME-Version; b=PUKembXvkfGnvHSQsaatgRd5xsS41YEDOpyATAuqQ6Q6N+xJ9JwcUq9an7GMRDW0o bBc1Kx9eTG0DNL7fOv8qYydksO9UNbz+H8L3itV0pmg0NmKCHVd6hue//BUBasLxls ApapfzFMHHaTjfG5KmU92CCkg/PyeRkgxKxOcQeesTAcvtGjmjpK+3YDadGEP4pVTm d8zInY1X8O7/CPqHmIwBrZndSS3liYwnuHzL8ryklbAU+h02kEAoytsBsINssB3qCh AbGnlHP7YNPHuFPluZgipvU0AnUBLa98YKP+fTzCZLMnGBGxI8mc6daDjylSCQgGGC WFYSWgba/g67w== 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 FVzc21IrgR8a; Wed, 19 Sep 2018 12:53:14 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id AE78323FDF0; Wed, 19 Sep 2018 12:53:14 -0400 (EDT) Date: Wed, 19 Sep 2018 12:53:14 -0400 (EDT) From: Mathieu Desnoyers To: Joseph Myers Cc: carlos , Florian Weimer , Thomas Gleixner , Ben Maurer , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Will Deacon , Dave Watson , Paul Turner , libc-alpha , linux-kernel , linux-api Message-ID: <67473000.8399.1537375994645.JavaMail.zimbra@efficios.com> In-Reply-To: References: <20180919144438.1066-1-mathieu.desnoyers@efficios.com> Subject: Re: [RFC PATCH] glibc: Perform rseq(2) registration at nptl init and thread creation 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.9_GA_3019 (ZimbraWebClient - FF52 (Linux)/8.8.9_GA_3019) Thread-Topic: glibc: Perform rseq(2) registration at nptl init and thread creation Thread-Index: TeRSFIkNT2ONAgHrmTf/5ZlK/KK5rA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Sep 19, 2018, at 12:37 PM, Joseph Myers joseph@codesourcery.com wrote: > On Wed, 19 Sep 2018, Mathieu Desnoyers wrote: > >> Here is a rough prototype registering rseq(2) TLS for each thread >> (including main), and unregistering for each thread (excluding >> main). "rseq" stands for Restartable Sequences. > > A final patch would need to add documentation and tests and a NEWS entry > and fix various coding style issues. > >> diff --git a/nptl/Versions b/nptl/Versions >> index e7f691da7a..7316c2815d 100644 >> --- a/nptl/Versions >> +++ b/nptl/Versions >> @@ -275,6 +275,7 @@ libpthread { >> mtx_init; mtx_lock; mtx_timedlock; mtx_trylock; mtx_unlock; mtx_destroy; >> call_once; cnd_broadcast; cnd_destroy; cnd_init; cnd_signal; >> cnd_timedwait; cnd_wait; tss_create; tss_delete; tss_get; tss_set; >> + __rseq_abi; __rseq_refcount; > > That's the GLIBC_2.28 section, but 2.28 is already out. New symbols would > need to go in GLIBC_2.29 or later (and the ABI test baselines would all > need updating). Certainly. I'm just not sure where I need to poke to update the ABI version from 2.28 to 2.29 in my dev branch. > >> diff --git a/sysdeps/unix/sysv/linux/rseq.h b/sysdeps/unix/sysv/linux/rseq.h > > This looks like it's coming from the Linux kernel. Can't the relevant > uapi header just be used directly without copying into glibc (with due > care to ensure that glibc still builds if the kernel headers used for the > build are too old - you need such conditionals anyway if they don't define > the relevant syscall number)? This is indeed in the list of "things to consider" I've put in the patch commit message. If the usual practice is to build against uapi kernel headers outside of the glibc tree, I'm fine with that. Thanks, Mathieu > > -- > Joseph S. Myers > joseph@codesourcery.com -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com