From owner-freebsd-alpha Mon Mar 26 16:35:56 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.80]) by hub.freebsd.org (Postfix) with ESMTP id 97BD337B71D; Mon, 26 Mar 2001 16:35:51 -0800 (PST) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id F05516A90D; Tue, 27 Mar 2001 10:05:48 +0930 (CST) Date: Tue, 27 Mar 2001 10:05:48 +0930 From: Greg Lehey To: Mike Smith Cc: Poul-Henning Kamp , John Baldwin , leclercn@videotron.ca, freebsd-alpha@FreeBSD.org Subject: Re: dev_t size mismatch kernel / userland Message-ID: <20010327100548.D40349@wantadilla.lemis.com> References: <20010327093327.A40349@wantadilla.lemis.com> <200103270008.f2R08vE02662@mass.dis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200103270008.f2R08vE02662@mass.dis.org>; from msmith@freebsd.org on Mon, Mar 26, 2001 at 04:08:57PM -0800 Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.lemis.com/~grog X-PGP-Fingerprint: 6B 7B C3 8C 61 CD 54 AF 13 24 52 F8 6D A4 95 EF Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Monday, 26 March 2001 at 16:08:57 -0800, Mike Smith wrote: >>>> 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. > > Er, no, it's not a bug. dev_t is expected to be one thing in userland, > and quite another in the kernel; the assumption used to be that the two > were the same; now they are not. Would you care to explain? >> 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. > > You basically shoot your own argument dead here. Your unsubstantiated claim. > Don't export private data structures to userland. End of story. 8) No, categorical statements prove nothing. 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