Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jan 2003 14:23:09 -0800
From:      Arun Sharma <adsharma@unix-os.sc.intel.com>
To:        Doug Rabson <dfr@nlsystems.com>
Cc:        freebsd-ia64@FreeBSD.ORG
Subject:   Re: cat /proc/pid/map == panic
Message-ID:  <20030122142309.A15191@unix-os.sc.intel.com>
In-Reply-To: <200301221021.29297.dfr@nlsystems.com>; from dfr@nlsystems.com on Wed, Jan 22, 2003 at 10:21:29AM %2B0000
References:  <200301220302.h0M323r01126@unix-os.sc.intel.com> <200301221021.29297.dfr@nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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