From owner-freebsd-arch@FreeBSD.ORG Sat Jul 19 18:42:47 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3148106566B for ; Sat, 19 Jul 2008 18:42:47 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout011.mac.com (asmtpout011.mac.com [17.148.16.86]) by mx1.freebsd.org (Postfix) with ESMTP id 880DD8FC15 for ; Sat, 19 Jul 2008 18:42:47 +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 [192.168.1.102] (209-128-86-226.BAYAREA.NET [209.128.86.226]) by asmtp011.mac.com (Sun Java(tm) System Messaging Server 6.3-6.03 (built Mar 14 2008; 32bit)) with ESMTPSA id <0K49004QONZ8D170@asmtp011.mac.com> for arch@freebsd.org; Sat, 19 Jul 2008 11:42:47 -0700 (PDT) Sender: xcllnt@mac.com Message-id: <6EA6C2B0-EF45-4A65-A455-65700BA6B024@mac.com> From: Marcel Moolenaar To: Kostik Belousov In-reply-to: <20080719183725.GM17123@deviant.kiev.zoral.com.ua> Date: Sat, 19 Jul 2008 11:42:44 -0700 References: <34889018-8358-46AC-897E-32767FB84E14@mac.com> <20080719183725.GM17123@deviant.kiev.zoral.com.ua> X-Mailer: Apple Mail (2.928.1) Cc: FreeBSD Arch 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: Sat, 19 Jul 2008 18:42:47 -0000 On Jul 19, 2008, at 11:37 AM, Kostik Belousov wrote: > On Sat, Jul 19, 2008 at 10:59:29AM -0700, Marcel Moolenaar wrote: >> All, >> >> We have a couple of interfaces/APIs that can't be used cross- >> platform. >> >> Take for example libkvm. On a 32-bit platform, we can't typically use >> libkvm on a 64-kernel, because the libkvm interface uses u_long for >> the target address, which on 32-bit platforms is 32 bits wide. >> >> Likewise, libthread_db and proc_service are designed for native use >> only and need API tweaks to work in a cross-environment. Both use >> psaddr_t to represent a target address, which is defined as a void* >> in . >> >> I'd like to change those interfaces/APIs to allow them to be used in >> a cross-platform debugging environment. Basically, this means that a >> target address will have to be defined as a uint64_t. Other datatypes >> may also need to be retyped. >> >> For libkvm in particular I don't want to redefine struct kinfo_proc, >> struct nlist, etc. While it could be useful in a hybrid 32/64-bit >> environment, the effect of such changes have too high a chance to >> trickle down various other components/interfaces. Thus, for libkvm >> the focus is on kvm_read() and kvm_write(). >> >> Suggested plan of attack: >> o add kvm_xread() and kvm_xwrite() to the libkvm API to minimize >> the overall impact. The new functions operate on a 64-bit target >> address (psaddr_t). >> o change psaddr_t from a void* to a 64-bit integral (sys/procfs.h) >> This affects proc_service and libthread_db. And consequently our >> threading support in GDB. >> >> Comments/thoughts? > > I do not object to the idea, but thing to consider is the backward > compatibility. In other words, how much harder would it be to run, > e.g., an RELENG_7 jail on the current kernel after the change ? The impact on the kernel is exactly nil. psaddr_t is not used by the kernel or its interfaces. It's only used for debug related functionality. FYI, -- Marcel Moolenaar xcllnt@mac.com