Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp820694ybg; Thu, 19 Mar 2020 09:19:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vslmN+cM6TAF76AEJdzgWHpg+AavSLEPWIEmPkMRrRn/LP1fNh+2xv54R0+Bfkp74DGMLVa X-Received: by 2002:aca:fc88:: with SMTP id a130mr2842538oii.89.1584634751752; Thu, 19 Mar 2020 09:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584634751; cv=none; d=google.com; s=arc-20160816; b=tDV3PRTh4rk+MFmCssu4KQFqd4UnMf6oVbP1HEEKGI7KHghmxBsc4+qo5Rek7HQUKO ZY47yNQwzPzSRjyo3+JbkRdMmVpqnhwuZqcgj612cYqSza4GClRmqWc3+6RgGqL0C8FX tOlpwOa4Cxe0jFva+CORmXd/V/D4vBoGaLSsgbOLlI6HnncfV0eDCkvuhTU7U8zGO5Go EH0PO9m8WTf+ou92pvF3LiMZ0NyZSf7dsTN5EIeFU4bJ7/WR5muhLrNYOe6RJmGkLbne SCT1RmmhToFGmZX4atqAamV+MdBgprpfqbg2yTrNpBYZUU4NXuO03GaEkv0XPubuDuQF zCIQ== 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 :message-id:in-reply-to:date:references:subject:cc:to:from; bh=81HrXvL5RetXWJQHYnVjckPyBamWrKlVYLpJhTYGGOs=; b=SsvYV5luHviOi4ni1uEexFSIvGUNGe0bTX9BKSLYePsb8wQn2f+wAkT8zZ/RBv+0c3 g+c9XCX68Xik+8jK3d/lyFOulvSTEmiFi2axzOz+xhcuAUB2yUayvUEgSxCyhvcqknYs M739jHyC3y6jAiWt8hfXIKRzXuU0m9NEJ7sQNtogxRaX4B+MNsbr21Mj7KB/Q6+UD0ua FrfTxiIHP+29KyQfLKDlyxJ4zOxCZCoypjLEzxnbjiNwq0YLCbWE2kA0GZMChIFyhA/v ed4IkV4Hvljspf6Z/8Q+hVG8g1az8TpXjZgpfmdKtUj1F4rMnf+vTEA0l+0hiCNepPZu c5TA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v126si1283914oia.106.2020.03.19.09.18.51; Thu, 19 Mar 2020 09:19:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728220AbgCSQRC convert rfc822-to-8bit (ORCPT + 99 others); Thu, 19 Mar 2020 12:17:02 -0400 Received: from albireo.enyo.de ([37.24.231.21]:49206 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728157AbgCSQRB (ORCPT ); Thu, 19 Mar 2020 12:17:01 -0400 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jExff-0006BE-FU; Thu, 19 Mar 2020 16:05:23 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jExdz-0000h9-3G; Thu, 19 Mar 2020 17:03:39 +0100 From: Florian Weimer To: Mathieu Desnoyers Cc: libc-alpha , carlos , Rich Felker , linux-api , Boqun Feng , Will Deacon , linux-kernel , Peter Zijlstra , Ben Maurer , Dave Watson , Thomas Gleixner , Paul , Paul Turner , Joseph Myers Subject: Re: [RFC PATCH glibc 4/8] glibc: Perform rseq(2) registration at C startup and thread creation (v15) References: <20200319144110.3733-1-mathieu.desnoyers@efficios.com> <20200319144110.3733-5-mathieu.desnoyers@efficios.com> <874kukpf9f.fsf@mid.deneb.enyo.de> <2147217200.3240.1584633395285.JavaMail.zimbra@efficios.com> Date: Thu, 19 Mar 2020 17:03:39 +0100 In-Reply-To: <2147217200.3240.1584633395285.JavaMail.zimbra@efficios.com> (Mathieu Desnoyers's message of "Thu, 19 Mar 2020 11:56:35 -0400 (EDT)") Message-ID: <87r1xo5o2s.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathieu Desnoyers: >> Can you use __has_include in , with a copy of the kernel >> definitions if the kernel header is not available? > > Sure. Should I pull a verbatim copy of uapi linux/rseq.h into glibc ? > If so, where should I put it ? Probably into , perhaps with a construct like this (untested): #ifdef __has_include # if __has_include ("linux/rseq.h") # define __GLIBC_HAVE_KERNEL_RSEQ # endif #else # include # if LINUX_VERSION_CODE >= KERNEL_VERSION (4, 18, 0) # define __GLIBC_HAVE_KERNEL_RSEQ # endif #endif #ifdef __GLIBC_HAVE_KERNEL_RSEQ # include #else … (fallback goes here) #endif We have an ongoing debate whether the fallback definition should use __u64 or uint64_t. You also need to add an assert that the compiler supports __attribute__ ((aligned)) because ignoring it produces an ABI-incompatible header. The struct rseq/struct rseq_cs definitions are broken, they should not try to change the alignment. PS: I have Internet connection trouble. Nobody should be worried if I drop off the net for a while. I understand this is quite a bad time for that. 8-(