Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2001 09:33:27 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Mike Smith <msmith@freebsd.org>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, John Baldwin <jhb@FreeBSD.org>, leclercn@videotron.ca, freebsd-alpha@FreeBSD.org
Subject:   Re: dev_t size mismatch kernel / userland
Message-ID:  <20010327093327.A40349@wantadilla.lemis.com>
In-Reply-To: <200103262100.f2QL0WE01189@mass.dis.org>; from msmith@freebsd.org on Mon, Mar 26, 2001 at 01:00:32PM -0800
References:  <66685.985635091@critter> <200103262100.f2QL0WE01189@mass.dis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 26 March 2001 at 13:00:32 -0800, Mike Smith wrote:
>>> This will probably make Poul's head spin, but one idea might be to have a
>>> kdev_t type. :-P  In the kernel kdev_t == dev_t, and in userland, kdev_t is a
>>> void *.  This would work in this case I think because you never use the dev_t's
>>> while in userland.  I do like exporting trimmed down structures, however.
>>> Please don't export mutexes while you are at it. :-P
>>
>> Guys,
>>
>> I'm new to this subject, so please fill me in: just what in the
>> (kernel) dev_t do you want to export to userland ?
>
> Nothing.  Greg just leaks a dev_t in a structure exchanged between
> userland and the kernel, and this bit because dev_t is a different
> size between the two on the Alpha; the right fix is simply to not
> abuse this structure like this.

You're missing a number of things here.  If a dev_t is defined in
userland, it should be the same size as in the kernel.  The current
situation is obviously a bug.  It's certainly open to discussion
whether the dev_t definition in userland gets removed or fixed.

The other issue is that exporting expurgated versions of kernel
structures is expensive.  We've been exporting the unexpurgated
versions for years elsewhere, for example--see the proc size mismatch
messages from ps(1).  That got fixed, not because it was "unclean",
but because it was a bloody nuisance.  Yes, it's "clean" not to export
mutexes and dev_ts and friends, but it requires a fair amount of code
to do it, and it requires two structures which need to be kept in
sync.  Exporting them doesn't do any harm that I can see.  I don't
think that it's self-evident that you need to go to this much trouble.

Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010327093327.A40349>