mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rich Felker <dalias@libc.org>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Mikael Pettersson <mikpelinux@gmail.com>,
	Andy Lutomirski <luto@amacapital.net>, Russ Cox <rsc@golang.org>,
	linux-api@vger.kernel.org, Ian Taylor <iant@golang.org>,
	linux-kernel@vger.kernel.org, X86 ML <x86@kernel.org>
Subject: Re: [RFC 0/2] __vdso_findsym
Date: Sun, 15 Jun 2014 21:06:07 -0400	[thread overview]
Message-ID: <20140616010606.GS179@brightrain.aerifal.cx> (raw)
In-Reply-To: <539DD26B.3060709@zytor.com>

On Sun, Jun 15, 2014 at 10:05:47AM -0700, H. Peter Anvin wrote:
> On 06/15/2014 07:35 AM, Rich Felker wrote:
> > 
> > Arguably, it was a mistake for the kernel to expose a virtual ELF to
> > begin with, and it should just have exposed a "lookup function by
> > name" operation to begin with. Yes this can be done in userspace, but
> > I see it more as a matter of "fixing a broken API design".
> > 
> 
> What the fsck are you smoking?  There is immense value in providing a
> stable and very well-defined data structure,

I believe the widespread consensus is that there's more value in
providing a well-defined interface and keeping your data structures
opaque. Even if it's useful for the data structure to be there for the
debugger's sake (debuggers have to know about binary formats, etc.)
that's not an excuse for components of the system which have nothing
to do with ELF to have to know about it.

> which also happens to be
> what dynamic linkers already want to consume.  Providing a helper for
> crippled libc applications has potential value.  Shaving a few hundred
> bytes off static applications is a very weak argument, simply because it
> is such a small fraction of the enormous cost of a static application,

No, it's not. It could very easily be 5% of the binary size for plenty
of utilities that are useful to make static. Anyway it's not that a
single ~450 byte function is such a cost for static binaries in
itself; it's that if one is not vigilant against this kind of creep,
it ends up not being one ~450 byte function but quickly 5, 10, 20,
etc. of them, and eventually you get to the point (see: glibc) where
static linking is useless.

> and static applications are problematic in a number of other ways,
> especially the lack of ability to fix bugs.

This is a standard fallacy I won't address here because it's
off-topic.

> Treating the kernel as an ersatz dynamic library for "static"
> applications is kind of silly -- after all, why not provide an entire
> libc in the vdso?  I have actually seen people advocate for doing that.

I consider that a very bad idea. What I think vdso should provide is
just fast versions of syscalls that can be performed without entering
kernelspace, but for which it's impossible to write such an
implementation in userspace because it (a) has to interact with
kernel-provided data structures that should not be public APIs, and
(b) requires hardware-specific versions of the function. However, I
think there's a value in providing access to these syscall
replacements in an easy-to-use manner that doesn't require that
components which have nothing to do with ELF (i.e. the time functions)
be aware of ELF data structures. And this is why I support the
proposal.

Rich

      parent reply	other threads:[~2014-06-16  1:07 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 18:16 Andy Lutomirski
2014-06-14 18:16 ` [RFC 1/2] uapi: Add some missing dynamic table-related definitions to elf.h Andy Lutomirski
2014-06-14 18:16 ` [RFC 2/2] [NOT READY] x86/vdso: Add __vdso_findsym Andy Lutomirski
2014-06-14 21:30 ` [RFC 0/2] __vdso_findsym Rich Felker
2014-06-14 22:38   ` Andy Lutomirski
2014-06-14 23:36     ` H. Peter Anvin
2014-06-15  3:59       ` H. Peter Anvin
2014-06-15  6:49         ` Andy Lutomirski
2014-06-15 14:25 ` Mikael Pettersson
2014-06-15 14:35   ` Rich Felker
2014-06-15 15:47     ` Andy Lutomirski
2014-06-15 17:05     ` H. Peter Anvin
2014-06-15 17:40       ` Andy Lutomirski
2014-06-15 17:57         ` H. Peter Anvin
2014-06-15 18:20           ` Andy Lutomirski
2014-06-15 18:39             ` H. Peter Anvin
2014-06-15 18:54               ` Andy Lutomirski
2014-06-15 19:14                 ` H. Peter Anvin
2014-06-15 19:22                   ` Ian Lance Taylor
2014-06-15 19:31                     ` H. Peter Anvin
2014-06-15 19:50                       ` Ian Lance Taylor
2014-06-15 19:56                         ` H. Peter Anvin
2014-06-15 20:53                           ` Andy Lutomirski
2014-06-15 21:13                             ` H. Peter Anvin
2014-06-16  0:55                   ` Rich Felker
2014-06-16  2:36             ` Andi Kleen
2014-06-16  3:49               ` Rich Felker
2014-06-16 14:08               ` Ian Lance Taylor
2014-06-16 14:38                 ` Andi Kleen
2014-06-16 14:58                   ` Rich Felker
2014-06-16 15:31                   ` Ian Lance Taylor
2014-06-16 15:42                     ` Rich Felker
2014-06-20 15:55                       ` Andy Lutomirski
2014-06-20 16:07                         ` Rich Felker
2014-06-16 14:56                 ` Rich Felker
2014-06-15 18:20         ` H. Peter Anvin
2014-06-15 18:22           ` Andy Lutomirski
2014-06-16  6:39             ` Rich Felker
2014-06-16  1:06       ` Rich Felker [this message]

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=20140616010606.GS179@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=hpa@zytor.com \
    --cc=iant@golang.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mikpelinux@gmail.com \
    --cc=rsc@golang.org \
    --cc=x86@kernel.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

all inboxes | Powered by JetHome®