linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: luto@amacapital.net (Andy Lutomirski)
To: linux-arm-kernel@lists.infradead.org
Subject: [musl] Re: Thread pointer changes
Date: Fri, 27 Jun 2014 14:47:38 -0700	[thread overview]
Message-ID: <CALCETrV5C2JosC_rtucQVg+U0bm8hFQFBTv3dz0it0a8iMCyrQ@mail.gmail.com> (raw)
In-Reply-To: <20140627213051.GS32514@n2100.arm.linux.org.uk>

On Fri, Jun 27, 2014 at 2:30 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Jun 27, 2014 at 11:09:31PM +0200, Szabolcs Nagy wrote:
>> i thought the helpers in the kernel can avoid certain memory
>> barriers that the userspace has to do on armv6 for atomics
>> (and those barriers are deprecated on armv7 so i thought the
>> kuser page was better for portable binaries)
>
> The helpers are provided so that libc can be independent of the CPU
> facilities in the machine.  The key word there is _libc_, not
> applications.
>
> So, a libc can be built to support the lowest architecture that
> someone deems to support, and it may make use of the kuser helpers.
> If it does, then you have a libc which requires that the kuser
> helpers are always provided by the kernel, and the KUSER_HELPERS
> option must never be disabled.  If it is disabled, then the libc
> will be useless against that kernel.
>
> However, a libc built against modern architectures should not be
> making use of the kuser helpers.  We found last year that the
> Ubuntu 12.04 glibc did still make use of one kuser helper, and
> as such Ubuntu 12.04 also needs KUSER_HELPERS to remain enabled.
>
> The last combination is that the libc is built for modern architectures
> without needing any kuser helpers at all.  In this case - and only this
> case - the kernel's KUSER_HELPERS option can be disabled should the
> system integrator want to increase security.
>
>> > Due to that, any ARMv5 or earlier CPU will always have the kuser helper
>> > page.  ARMv6 and later may or may not have the kuser helper page, but
>> > there you're really building for a different ABI anyway (VFP-based) and
>> > you also know that you have the thread registers.
>>
>> so is it expected that the libc makes no attempt to provide
>> portable binary interface for armv5 and armv6?
>
> The libc interface that applications make use should not have any
> dependence on whether KUSER_HELPERS is enabled or disabled, the
> presence of that page should be totally invisible to applications.

As of right now, an x86_64 libc can have good performance on any
recent kernel and will work correctly on any kernel.  From what you're
saying, it sounds impossible to implement such a thing on ARM without
fiddling with /proc.

--Andy

  reply	other threads:[~2014-06-27 21:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140610072835.GA8466@brightrain.aerifal.cx>
     [not found] ` <20140611145533.GT179@brightrain.aerifal.cx>
2014-06-27 19:27   ` Thread pointer changes Andy Lutomirski
2014-06-27 20:09     ` Russell King - ARM Linux
2014-06-27 21:09       ` [musl] " Szabolcs Nagy
2014-06-27 21:30         ` Russell King - ARM Linux
2014-06-27 21:47           ` Andy Lutomirski [this message]
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
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                         ` 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 at aetey.se
2014-06-27 23:20     ` Russell King - ARM Linux
2014-06-28  0:38       ` [musl] " 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=CALCETrV5C2JosC_rtucQVg+U0bm8hFQFBTv3dz0it0a8iMCyrQ@mail.gmail.com \
    --to=luto@amacapital.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 NNTP newsgroup(s).