[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0901271539090.3123@localhost.localdomain>
Date: Tue, 27 Jan 2009 15:43:29 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ingo Molnar <mingo@...e.hu>
cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Sam Ravnborg <sam@...nborg.org>,
Jaswinder Singh Rajput <jaswinderrajput@...il.com>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [mingo@...e.hu: [git pull] headers_check fixes]
On Wed, 28 Jan 2009, Ingo Molnar wrote:
>
> It would be much better if we exported _much_ less and reduced our
> cross-section to user-space. Also, the include/linux/Kbuild rules are all
> but transparent: it would also be nice if whatever we exported was be
> visible straight in the header itself, to make it obvious to people who
> modify/extend those files that those definitions are going to be exported
> to user-space.
>
> Some __user_export tag on structures perhaps? I have no good ideas here -
> #ifdefs are ugly and tags obscure the purity of the code.
I agree, and we probably could do so with some sparse extension (just make
the rule be that in order to make a __user pointer, the base type needs to
have been tagged with __user_visible). So we _could_ do something like
that, and have a sane checking model where sparse would warn if it sees a
user pointer of something that wasn't marked as being a user-visible type.
But I doubt it's really worth it. A lot of the usage cases for users end
up being about constants etc that we really can't check sanely and
automatically. And some historical user-space usage is literally just
about user space finding the kernel headers really helpful (ie using the
list.h headers for user-space lists, or the inline asms for atomic stuff
for threaded apps that don't rely on ptrace locking).
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists