Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2008 03:27:19 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Alfred Perlstein <alfred@FreeBSD.org>, Marcel Moolenaar <xcllnt@mac.com>, freebsd-arch@FreeBSD.org
Subject:   Re: RFC: cross-libkvm/libthread_db/proc_service
Message-ID:  <20080723032109.W18257@delplex.bde.org>
In-Reply-To: <20080723025519.F18257@delplex.bde.org>
References:  <34889018-8358-46AC-897E-32767FB84E14@mac.com> <200807211049.47579.jhb@freebsd.org> <Pine.GSO.4.64.0807211659450.2608@sea.ntplx.net> <20080721214104.GF76659@elvis.mu.org> <20080723025519.F18257@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 23 Jul 2008, Bruce Evans wrote:

> On Mon, 21 Jul 2008, Alfred Perlstein wrote:
>
>> Isn't it a bit strange to export 64bit pointers to 32 bit userspace?
>
> Only for pointers in kernel objects, and I think the proposed change
> doesn't touch that.
>
> kvm_read() doesn't use pointers for kernel addresses.  It uses unsigned
> longs.  But even uintmax_t is not enough in general, since the application
> uintmax_t might be too small to represent a kernel pointer.  The type
> used shouldn't be fixed-width, but typedefed in an MD way like vm_offset_t.
> vm_offset_t gives the correct integral type to use for (mapped) kernel
> addresses and related compat_fewer_bit[s] type[s] are needed in userland.
> It would probably be too hard to support the general case which requires
> the compat types to be arrays or structs.

Bah, I forgot the original mail which already says to use an integral
type named psaddr_t, and that, unfortunately, this seems to need being
64 bits even on pure 32-bit systems in case you want to run an (not
quite pure) 32-bit application in compat32 mode on 64-bit system without
recompiling.  If psaddr_t is 32-bits on i386 but 64-bits on amd64, then
pure 32-bit i386 applications won't run in compat32 mode on amd64, though
(not quite pure) 32-bit applications compiled on amd64 will.  I don't like
putting 64-bit knowledge in 32-bit applications but I often compile on
i386 and run on amd64.

Bruce



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