From owner-freebsd-arch@FreeBSD.ORG Wed Jul 23 17:14:32 2008 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3FA5106566B; Wed, 23 Jul 2008 17:14:32 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout022.mac.com (asmtpout022.mac.com [17.148.16.97]) by mx1.freebsd.org (Postfix) with ESMTP id AA51F8FC13; Wed, 23 Jul 2008 17:14:32 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp022.mac.com (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTPSA id <0K4G002JQVT8LF90@asmtp022.mac.com>; Wed, 23 Jul 2008 09:15:09 -0700 (PDT) Sender: xcllnt@mac.com Message-id: <71C01B9B-1E42-4D65-A3D7-F1DA14123524@mac.com> From: Marcel Moolenaar To: Bruce Evans In-reply-to: <20080723032109.W18257@delplex.bde.org> Date: Wed, 23 Jul 2008 09:15:06 -0700 References: <34889018-8358-46AC-897E-32767FB84E14@mac.com> <200807211049.47579.jhb@freebsd.org> <20080721214104.GF76659@elvis.mu.org> <20080723025519.F18257@delplex.bde.org> <20080723032109.W18257@delplex.bde.org> X-Mailer: Apple Mail (2.928.1) Cc: Alfred Perlstein , freebsd-arch@FreeBSD.org Subject: Re: RFC: cross-libkvm/libthread_db/proc_service X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jul 2008 17:14:32 -0000 On Jul 22, 2008, at 10:27 AM, Bruce Evans wrote: > 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. Actually, the intend is more generic (or more limited, depending on how you look at it): the ability to cross-debug any (say ia64) kernel on any other (say powerpc) machine. The integral needs to be constant and equal in width across all platforms. This means that an uint<#>_t is the best option. The largest we support is 64-bit. We can already build a cross gdb from the source tree, but without threading support (libthread_db and proc_service limitation). We can't build a cross kgdb from the source tree because of libkvm. Both I'd like to be able to do. FYI, -- Marcel Moolenaar xcllnt@mac.com