From owner-freebsd-ia64 Wed Jan 22 14:23:23 2003 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 16B4437B401 for ; Wed, 22 Jan 2003 14:23:22 -0800 (PST) Received: from hermes.sc.intel.com (fmr03.intel.com [143.183.121.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7549443ED8 for ; Wed, 22 Jan 2003 14:23:21 -0800 (PST) (envelope-from adsharma@unix-os.sc.intel.com) Received: from talaria.sc.intel.com (talaria.sc.intel.com [10.3.253.5]) by hermes.sc.intel.com (8.11.6/8.11.6/d: outer.mc,v 1.51 2002/09/23 20:43:23 dmccart Exp $) with ESMTP id h0MML9j23870; Wed, 22 Jan 2003 22:21:09 GMT Received: from unix-os.sc.intel.com (unix-os.sc.intel.com [143.183.96.244]) by talaria.sc.intel.com (8.11.6/8.11.6/d: inner.mc,v 1.28 2003/01/13 19:44:39 dmccart Exp $) with ESMTP id h0MMJKJ22104; Wed, 22 Jan 2003 22:19:20 GMT Received: (from adsharma@localhost) by unix-os.sc.intel.com (8.11.6/8.11.2) id h0MMN9s15497; Wed, 22 Jan 2003 14:23:09 -0800 Date: Wed, 22 Jan 2003 14:23:09 -0800 From: Arun Sharma To: Doug Rabson Cc: freebsd-ia64@FreeBSD.ORG Subject: Re: cat /proc/pid/map == panic Message-ID: <20030122142309.A15191@unix-os.sc.intel.com> References: <200301220302.h0M323r01126@unix-os.sc.intel.com> <200301221021.29297.dfr@nlsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200301221021.29297.dfr@nlsystems.com>; from dfr@nlsystems.com on Wed, Jan 22, 2003 at 10:21:29AM +0000 Sender: owner-freebsd-ia64@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, Jan 22, 2003 at 10:21:29AM +0000, Doug Rabson wrote: > On Wednesday 22 January 2003 3:02 am, Arun Sharma wrote: > > cat /proc/pid/map results in a page not present fault. The attached > > patch fixed it for me. > > This is going to find the wrong pte, I think. Without the > pmap_install(pmap), your pmap_find_vhpt will look in the current > process instead of the target. That's right. An updated patch is attached. > Does it work if you just add the check > for pmap==0 to the old code, i.e. still use pmap_install and tpa to get > the mapping? I haven't tried it, but I think in my case pmap was almost certainly non-zero (the process in question is sshd). Further, cr.iip was pointing to the tpa instruction when the page not present fault happened. The problem with ia64_tpa is that it will result in faults. The code in procfs is trying to count the number of resident pages - so you may not want to fault more pages in. A further optimization of this patch may be to just load one region register instead of loading all of them. -Arun --- src/sys/ia64/ia64/pmap.c- Tue Jan 21 17:46:59 2003 +++ src/sys/ia64/ia64/pmap.c Wed Jan 22 11:37:30 2003 @@ -1164,13 +1164,20 @@ register pmap_t pmap; vm_offset_t va; { + struct ia64_lpte *pte; pmap_t oldpmap; - vm_offset_t pa; + + if (!pmap) + return 0; oldpmap = pmap_install(pmap); - pa = ia64_tpa(va); + pte = pmap_find_vhpt(va); pmap_install(oldpmap); - return pa; + + if (!pte) + return 0; + + return pmap_pte_pa(pte); } /*************************************************** To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ia64" in the body of the message