From: Andy Lutomirski <luto@amacapital.net>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Rich Felker <dalias@libc.org>,
musl@lists.openwall.com, Szabolcs Nagy <nsz@port70.net>,
Kees Cook <keescook@chromium.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: Re: Thread pointer changes
Date: Fri, 27 Jun 2014 15:25:32 -0700 [thread overview]
Message-ID: <CALCETrUvPV0xmw1jCVdwJ8KW3HMW8JKoCRnHcUyuU-1ze=6X8A@mail.gmail.com> (raw)
In-Reply-To: <20140627221744.GU32514@n2100.arm.linux.org.uk>
On Fri, Jun 27, 2014 at 3:17 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Jun 27, 2014 at 05:55:41PM -0400, Rich Felker wrote:
>> I think you're assuming that libc is used only as a shared library and
>> that the user installs one appropriate for their kernel. This
>> precludes the use of static-linked binaries which are an extremely
>> important usage case for us, especially on ARM where, for example, we
>> want users to be able to make binaries that have a fully-working libc
>> but that can be run on Android, where neither musl nor any other
>> remotely-working libc is installed by default.
>>
>> Obviously some (many) users will opt to build libc with a particular
>> -march where all of the necessary instructions for TLS and atomics are
>> available without help from the kernel. However, if attempting to
>> build a baseline libc that works on any model results in one that
>> can't work on new hardware/kernel, that's a big problem, and exactly
>> the one which I'm trying to solve.
>
> As I've already said, that's a system integrator bug to have a kernel
> without a kuser page with userspace which requires it.
Shouldn't the goal be to reduce the number of new userspace programs
that require a kuser page on TLS-capable hardware? In 2012, I made an
effort to do exactly that on x86_64 wrt the vsyscall page, and, these
days, a system booted with vsyscall=none is likely to be fully
functional as long as vdso=0 isn't specified. Hopefully, in a couple
of years, even vdso=0 vsyscall=none will work with all freshly-built
binaries.
>
> I think you're are missing one obvious solution to this which you can do:
> you are passed the HWCAP fields in the ELF auxinfo. This will tell you
> if the CPU has TLS support or not. If it has TLS support, then you don't
> need to use the kuser helpers, and you know that it is a CPU which is ARM
> architecture v6k or later, and it has things like the CP15 barrier
> instructions. If you want to know that the CPU supports the DMB
> instruction rather than the CP15 barrier instruction, then you have to
> check the uname details, or read /proc/cpuinfo (but I'd rather you
> didn't.)
That sounds helpful. Would it make sense to try to convince all libc
providers (and Go!) to do this?
If DMB vs CP15 makes a big difference, then adding that to HWCAP might
be a good idea.
--Andy
next prev parent reply other threads:[~2014-06-27 22:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 7:28 Rich Felker
2014-06-11 14:55 ` Rich Felker
2014-06-27 19:27 ` Andy Lutomirski
2014-06-27 20:09 ` Russell King - ARM Linux
2014-06-27 21:09 ` Szabolcs Nagy
2014-06-27 21:30 ` Russell King - ARM Linux
2014-06-27 21:47 ` Andy Lutomirski
2014-06-27 21:58 ` Rich Felker
2014-06-27 21:55 ` Rich Felker
2014-06-27 22:17 ` Russell King - ARM Linux
2014-06-27 22:25 ` Andy Lutomirski [this message]
2014-06-27 22:54 ` Russell King - ARM Linux
2014-06-28 0:11 ` Rich Felker
2014-06-27 22:33 ` Rich Felker
2014-06-27 23:07 ` Russell King - ARM Linux
2014-06-27 23:17 ` Andy Lutomirski
2014-06-27 23:35 ` Russell King - ARM Linux
2014-06-27 23:40 ` Andy Lutomirski
2014-06-30 15:38 ` [musl] " Christopher Covington
2014-07-02 21:16 ` Rich Felker
2014-06-28 0:20 ` Rich Felker
2014-06-27 22:40 ` Szabolcs Nagy
2014-06-27 22:51 ` Andy Lutomirski
2014-06-27 23:12 ` Russell King - ARM Linux
2014-06-28 16:37 ` Szabolcs Nagy
2014-06-27 21:37 ` Rich Felker
2014-06-27 22:04 ` Russell King - ARM Linux
2014-06-27 22:26 ` Rich Felker
2014-06-27 23:03 ` Russell King - ARM Linux
2014-06-28 7:09 ` u-igbb
2014-06-27 23:20 ` Russell King - ARM Linux
2014-06-28 0:38 ` Rich Felker
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALCETrUvPV0xmw1jCVdwJ8KW3HMW8JKoCRnHcUyuU-1ze=6X8A@mail.gmail.com' \
--to=luto@amacapital.net \
--cc=dalias@libc.org \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux@arm.linux.org.uk \
--cc=musl@lists.openwall.com \
--cc=nsz@port70.net \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).