From owner-freebsd-ia64@FreeBSD.ORG Fri May 30 10:30:32 2003 Return-Path: Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 736C037B401 for ; Fri, 30 May 2003 10:30:32 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E14643F75 for ; Fri, 30 May 2003 10:30:31 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h4UHUUwk078320; Fri, 30 May 2003 10:30:30 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h4UHUU4s000681; Fri, 30 May 2003 10:30:30 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h4UHUT7o000680; Fri, 30 May 2003 10:30:29 -0700 (PDT) Date: Fri, 30 May 2003 10:30:29 -0700 From: Marcel Moolenaar To: Alan Robinson Message-ID: <20030530173029.GB568@dhcp01.pn.xcllnt.net> References: <20030530132408.A3690@fujitsu-siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030530132408.A3690@fujitsu-siemens.com> User-Agent: Mutt/1.5.4i cc: freebsd-ia64@freebsd.org Subject: Re: /dev/kmem read return value is double requested value X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2003 17:30:32 -0000 On Fri, May 30, 2003 at 01:24:08PM +0200, Alan Robinson wrote: > > I was playing with a user-land program that read some data out > of the kernel memory and noticed that the read() return value was > twice what I was expecting. I think the error is in the mmrw() function > in file sys/ia64/ia64/mem.c, removing the following lines seems to > fix the problem. > > iov->iov_base = (char *)iov->iov_base + c; > iov->iov_len -= c; > uio->uio_offset += c; > uio->uio_resid -= c; > > I had a little look at some of the other sys/ARCH/ARCH/mem.c and some others > seem to contain the same code so I might be wrong, then again so might the > ARCHs. If you see behaviour that's not particular to ia64, it's probably better to post to arch@ or current@. More people hang out there, so there's a bigger chance you get replies. I don't think there's anything wrong with the lines you think we need to remove. > Note that the actual data transfered is OK, just the read() return value > and the /dev/kmem file offset are wrong after returning from the read(). It helps if you demonstrate the behaviour with some trivial test program that people can run too. > PS is this the reason there is no gdb ? No. There's currenty no gdb because it hasn't been ported yet. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net