From: Eric Piel <Eric.Piel@tremplin-utc.net>
To: Rob Landley <rob@landley.net>
Cc: Kyle Moffett <mrmacman_g4@mac.com>,
nix@esperi.org.uk, mmazur@kernel.pl,
linux-kernel@vger.kernel.org, llh-discuss@lists.pld-linux.org
Subject: Re: [RFC][PATCH 0/2] KABI example conversion and cleanup
Date: Mon, 27 Mar 2006 01:06:48 +0200 [thread overview]
Message-ID: <44271E88.6040101@tremplin-utc.net> (raw)
In-Reply-To: <200603261609.10992.rob@landley.net>
26.03.2006 23:09, Rob Landley wrote/a écrit:
> On Sunday 26 March 2006 9:31 am, Eric Piel wrote:
>> I completely agree with rules 1, 2 and 5. However, IMHO rule 4 should
>> just be the inverse of rule 5: The stuff in include/linux should always
>> be independent from KABI (and userspace of course). Simply because the
>> way we _implement_ things in the kernel has to be different from the
>> things that we _specify_ in the kernel ABI.
>
> You know all the stuff that's marked __user? It's all kernel ABI. Having it
> defined in two places invites version skew, and the kernel needs it too
> because the kernel is parsing the stuff sent in by userspace and filling it
> out to send back to userspace.
>
> Lots of syscalls and ioctls and such pass a structure back and forth from
> userspace to the kernel and back, right? Doing a stat() fills out a
> structure, doing an losetup fills out a structure, and so on.
>
> Userspace needs to know what's in this structure. It may be wrapped in a libc
> function that fills out a different structure from the kernel structure, but
> the data that goes back and forth between the program and the kernel has to
> be defined in a header somewhere so the libc knows what the kernel's sending
> and the kernel knows what the libc is sending. (And for those functions with
> no libc wrapper, the user program needs to know the structure directly,
> somehow.)
>
> Having a data-marshalling ABI structure defined in two places invites version
> skew. Userspace needs access to this (at least to build a libc), and the
> kernel needs access to this, because it's a _communication_mechanism_. You
> can't have a communication mechanism that's only defined at one end.
Well, that's half true. Indeed, in general, having two separate
definitions invites version skew. However, in this particular case, it's
slightly different: because the principle of the ABI is to be stable, or
more exactly _compatible_. This means that if one definition was right
at some point in the time, it should always still be true ten years
later. At worse, the ABI can be extended, but never changed. If the
specification (KABI) and the implementation (Linux) are not compatible
it means the kernel developers screwed up, not that the KABI maintainers
haven't updated in time.
Of course, next to the theory, there is the reality. Some part of the
ABI has already be changed (broken) in the past (like the alsa ABI,
IIRC). In such case the KABI maintainers will have to handle the changes
as promptly as possible, but the responsibility will be held by the
kernel developer who has opted for breakage.
The real problem of sharing the same headers between kernel and KABI is
that it will end up by having to re-implement the "#ifdef __KERNEL__"'s.
Have a look at Kyle's second patch "Generalize fd_set handling across
architectures". Some headers had a different version of the __FD_*()
macros depending on the compiler. That's something you may want to have
in the implementation but definitely not in the specification. In this
situation, Kyle handled it nicely by writing versions compatible with
any compiler. Good looking solution inside the kernel will not always be
an option. IMHO, if KABI and the kernel share the same headers, it's
just a matter of time before someone introduces an "#ifdef
__KERNEL__"-alike mechanism, exactly what we've been trying to remove.
Eric
next prev parent reply other threads:[~2006-03-26 23:07 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 15:19 [ANNOUNCE] linux-libc-headers dead Mariusz Mazur
2006-03-14 15:28 ` Ismail Donmez
2006-03-16 8:37 ` [llh-announce] " Nigel Kukard
2006-03-16 20:20 ` Jan Engelhardt
2006-03-16 20:42 ` Dan Kegel
2006-03-17 7:56 ` DervishD
2006-03-23 17:11 ` State of userland headers Mariusz Mazur
2006-03-23 23:04 ` Rob Landley
2006-03-26 13:12 ` Mariusz Mazur
2006-03-26 20:59 ` Rob Landley
2006-03-24 18:51 ` Kyle Moffett
2006-03-24 21:23 ` Rob Landley
[not found] ` <878xqzpl8g.fsf@hades.wkstn.nix>
2006-03-24 22:46 ` Kyle Moffett
2006-03-24 23:01 ` Randy.Dunlap
2006-03-25 6:48 ` Kyle Moffett
2006-03-28 20:17 ` Jim Gifford
2006-03-25 1:36 ` Jeff Dike
2006-03-25 6:33 ` Kyle Moffett
2006-03-25 16:03 ` Jeff Dike
2006-03-25 3:19 ` Rob Landley
2006-03-25 6:27 ` Kyle Moffett
2006-03-26 11:52 ` [RFC][PATCH 0/2] KABI example conversion and cleanup Kyle Moffett
2006-03-26 11:54 ` [RFC][PATCH 1/2] Create initial kernel ABI header infrastructure Kyle Moffett
2006-03-26 12:32 ` Arjan van de Ven
2006-03-26 12:50 ` Kyle Moffett
2006-03-26 12:59 ` Martin Mares
2006-03-26 13:14 ` Kyle Moffett
2006-03-26 15:38 ` Martin Mares
2006-03-26 16:16 ` Kyle Moffett
2006-03-26 14:39 ` Arjan van de Ven
2006-03-26 15:23 ` Kyle Moffett
2006-03-29 22:26 ` Pavel Machek
2006-04-02 0:22 ` Randy.Dunlap
2006-04-02 2:42 ` Kyle Moffett
2006-04-02 3:01 ` Arjan van de Ven
2006-04-02 5:53 ` Kyle Moffett
2006-04-02 13:09 ` Arjan van de Ven
2006-04-02 10:32 ` Pavel Machek
2006-04-02 11:16 ` Kyle Moffett
2006-03-26 20:05 ` Sam Ravnborg
2006-03-26 20:39 ` Kyle Moffett
2006-03-26 21:26 ` Sam Ravnborg
2006-03-27 0:27 ` Kyle Moffett
2006-03-26 11:55 ` [RFC][PATCH 2/2] Generalize fd_set handling across architectures Kyle Moffett
2006-03-26 12:06 ` [RFC][PATCH 0/2] KABI example conversion and cleanup Kyle Moffett
2006-03-26 13:43 ` Nix
2006-03-26 12:26 ` Arjan van de Ven
2006-03-26 12:30 ` Arjan van de Ven
2006-03-26 12:34 ` Kyle Moffett
2006-03-26 13:22 ` Giuseppe Bilotta
2006-03-26 13:29 ` Avi Kivity
2006-03-26 13:47 ` Kyle Moffett
2006-03-26 13:53 ` Giuseppe Bilotta
2006-03-26 14:30 ` Kyle Moffett
2006-03-26 14:45 ` Giuseppe Bilotta
2006-03-26 17:24 ` Avi Kivity
2006-03-26 17:29 ` Arjan van de Ven
2006-03-26 17:57 ` Avi Kivity
2006-03-26 18:32 ` Arjan van de Ven
2006-03-26 21:18 ` Rob Landley
2006-03-27 0:18 ` Kyle Moffett
2006-03-27 6:19 ` Avi Kivity
2006-03-27 19:48 ` Rob Landley
2006-03-28 20:04 ` Mariusz Mazur
2006-03-28 20:13 ` Kyle Moffett
2006-03-28 22:57 ` Rob Landley
2006-03-26 20:55 ` Rob Landley
2006-03-27 0:12 ` Kyle Moffett
2006-03-26 14:31 ` Eric Piel
2006-03-26 21:09 ` Rob Landley
2006-03-26 23:06 ` Eric Piel [this message]
2006-03-27 0:40 ` Kyle Moffett
2006-03-27 3:12 ` Jeff Dike
2006-03-28 14:20 ` Jan Engelhardt
2006-03-28 15:57 ` [OT] Non-GCC compilers used for linux userspace Kyle Moffett
2006-03-28 16:13 ` Eric Piel
2006-03-28 16:20 ` Kyle Moffett
2006-03-28 16:59 ` Jason L Tibbitts III
2006-03-28 17:13 ` Kyle Moffett
2006-03-28 17:28 ` Daniel Jacobowitz
2006-03-28 17:41 ` Kyle Moffett
2006-04-05 17:01 ` Bryan O'Sullivan
2006-03-28 17:08 ` Jan-Benedict Glaw
2006-03-28 17:56 ` Jesper Juhl
2006-03-28 21:47 ` Rob Landley
2006-03-29 21:23 ` Nix
2006-03-30 1:36 ` Rob Landley
2006-03-30 7:24 ` Nix
2006-03-30 20:26 ` Rob Landley
2006-03-30 22:02 ` Nix
2006-03-30 23:00 ` Harald Arnesen
2006-03-30 23:16 ` Rob Landley
2006-03-29 13:25 ` Mathieu Chouquet-Stringer
2006-03-28 18:44 ` Eric W. Biederman
2006-03-29 4:26 ` Peter Chubb
2006-03-30 15:15 ` Roger Heflin
2006-03-28 17:16 ` [RFC][PATCH 0/2] KABI example conversion and cleanup Ben Pfaff
2006-03-28 17:08 ` Catalin Marinas
2006-03-31 0:20 ` Arch-specific header inconsistency (asm-*/termios.h) Kyle Moffett
2006-04-02 17:58 ` [RFC][PATCH 0/2] KABI example conversion and cleanup Sam Ravnborg
2006-04-02 19:30 ` Kyle Moffett
2006-04-02 20:47 ` Arnd Bergmann
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=44271E88.6040101@tremplin-utc.net \
--to=eric.piel@tremplin-utc.net \
--cc=linux-kernel@vger.kernel.org \
--cc=llh-discuss@lists.pld-linux.org \
--cc=mmazur@kernel.pl \
--cc=mrmacman_g4@mac.com \
--cc=nix@esperi.org.uk \
--cc=rob@landley.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox