unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Rich Felker <dalias@libc.org>,
	libc-alpha <libc-alpha@sourceware.org>,
	linux-api <linux-api@vger.kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ben Maurer <bmaurer@fb.com>, Dave Watson <davejwatson@fb.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Paul <paulmck@linux.vnet.ibm.com>, Paul Turner <pjt@google.com>,
	Joseph Myers <joseph@codesourcery.com>
Subject: Re: [RFC PATCH glibc 4/8] glibc: Perform rseq(2) registration at C startup and thread creation (v15)
Date: Thu, 19 Mar 2020 14:09:14 -0400 (EDT)	[thread overview]
Message-ID: <1302331358.3965.1584641354569.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <87r1xo5o2s.fsf@mid.deneb.enyo.de>

----- On Mar 19, 2020, at 12:03 PM, Florian Weimer fw@deneb.enyo.de wrote:

> * Mathieu Desnoyers:
> 
>>> Can you use __has_include in <sys/rseq.h>, 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 <sys/rseq.h>, perhaps with a construct like this
> (untested):
> 
> #ifdef __has_include
> # if __has_include ("linux/rseq.h")
> #   define __GLIBC_HAVE_KERNEL_RSEQ
> # endif
> #else
> # include <linux/version.h>
> # if LINUX_VERSION_CODE >= KERNEL_VERSION (4, 18, 0)
> #   define __GLIBC_HAVE_KERNEL_RSEQ
> # endif
> #endif
> 
> #ifdef __GLIBC_HAVE_KERNEL_RSEQ
> # include <linux/rseq.h>
> #else
> 
> … (fallback goes here)
> #endif

OK will do.

> 
> We have an ongoing debate whether the fallback definition should use
> __u64 or uint64_t.

Then I'll keep including <linux/types.h> in the fallback and use
__u{32,64} for now. If this proves to be an issue we can change it later.
This is the minimal change from the uapi header.

> 
> You also need to add an assert that the compiler supports
> __attribute__ ((aligned)) because ignoring it produces an
> ABI-incompatible header.

Are you aware of some helper macro I should use to do this, or
is it done elsewhere in glibc ?

> The struct rseq/struct rseq_cs definitions
> are broken, they should not try to change the alignment.

AFAIU, this means we should ideally not have used __attribute__((aligned))
in the uapi headers in the first place. Why is it broken ? However, now
that it is in the wild, it's a bit late to change that.

> 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-(

Allright, thanks for the heads up! Stay safe!

Thanks,

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2020-03-19 18:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-19 14:41 [RFC PATCH glibc 0/8] Restartable Sequences enablement Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 1/8] Introduce <elf_machine_sym_no_match.h> Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 2/8] Implement __libc_early_init Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 3/8] nptl: Start new threads with all signals blocked [BZ #25098] Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 4/8] glibc: Perform rseq(2) registration at C startup and thread creation (v15) Mathieu Desnoyers via Libc-alpha
2020-03-19 14:53   ` Florian Weimer
2020-03-19 15:56     ` Mathieu Desnoyers via Libc-alpha
2020-03-19 16:03       ` Florian Weimer
2020-03-19 18:09         ` Mathieu Desnoyers via Libc-alpha [this message]
2020-03-19 18:16           ` Florian Weimer
2020-03-19 18:28             ` Mathieu Desnoyers via Libc-alpha
2020-03-19 18:34               ` Florian Weimer
2020-03-19 18:55                 ` Mathieu Desnoyers via Libc-alpha
2020-03-19 19:05                   ` Florian Weimer
2020-03-19 19:46                     ` Mathieu Desnoyers via Libc-alpha
2020-03-20 13:44                       ` Mathieu Desnoyers via Libc-alpha
2020-03-20 14:47                         ` Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 5/8] glibc: sched_getcpu(): use rseq cpu_id TLS on Linux (v6) Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 6/8] support record failure: allow use from constructor Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 7/8] support: implement xpthread key create/delete (v4) Mathieu Desnoyers via Libc-alpha
2020-03-19 14:41 ` [RFC PATCH glibc 8/8] rseq registration tests (v8) Mathieu Desnoyers via Libc-alpha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302331358.3965.1584641354569.JavaMail.zimbra@efficios.com \
    --to=libc-alpha@sourceware.org \
    --cc=bmaurer@fb.com \
    --cc=boqun.feng@gmail.com \
    --cc=dalias@libc.org \
    --cc=davejwatson@fb.com \
    --cc=fw@deneb.enyo.de \
    --cc=joseph@codesourcery.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).