[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87r1xo5o2s.fsf@mid.deneb.enyo.de>
Date: Thu, 19 Mar 2020 17:03:39 +0100
From: Florian Weimer <fw@...eb.enyo.de>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: libc-alpha <libc-alpha@...rceware.org>, carlos <carlos@...hat.com>,
Rich Felker <dalias@...c.org>,
linux-api <linux-api@...r.kernel.org>,
Boqun Feng <boqun.feng@...il.com>,
Will Deacon <will.deacon@....com>,
linux-kernel <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ben Maurer <bmaurer@...com>, Dave Watson <davejwatson@...com>,
Thomas Gleixner <tglx@...utronix.de>,
Paul <paulmck@...ux.vnet.ibm.com>, Paul Turner <pjt@...gle.com>,
Joseph Myers <joseph@...esourcery.com>
Subject: Re: [RFC PATCH glibc 4/8] glibc: Perform rseq(2) registration at C startup and thread creation (v15)
* 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
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-(
Powered by blists - more mailing lists