From owner-freebsd-mips@FreeBSD.ORG Thu Dec 2 14:59:47 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63457106564A for ; Thu, 2 Dec 2010 14:59:47 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og116.obsmtp.com (exprod7og116.obsmtp.com [64.18.2.219]) by mx1.freebsd.org (Postfix) with ESMTP id 2AF098FC0C for ; Thu, 2 Dec 2010 14:59:46 +0000 (UTC) Received: from source ([66.129.224.36]) (using TLSv1) by exprod7ob116.postini.com ([64.18.6.12]) with SMTP ID DSNKTPe0Yic8dcXucP8fLR1Rhcn1LCLSxVSY@postini.com; Thu, 02 Dec 2010 06:59:47 PST Received: from p-emfe02-wf.jnpr.net (172.28.145.25) by P-EMHUB02-HQ.jnpr.net (172.24.192.36) with Microsoft SMTP Server (TLS) id 8.2.254.0; Thu, 2 Dec 2010 06:47:12 -0800 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe02-wf.jnpr.net ([fe80::c126:c633:d2dc:8090%11]) with mapi; Thu, 2 Dec 2010 09:46:59 -0500 From: Andrew Duane To: Warner Losh , "freebsd-mips@freebsd.org" , Alan Cox Date: Thu, 2 Dec 2010 09:46:03 -0500 Thread-Topic: vm_page_startup() Thread-Index: AcuR2WCZsYI/qa6aRxiYFB6maH0F/wAVkR3g Message-ID: References: <4CF5E518.20508@rice.edu>,<4CF71F79.3020500@bsdimp.com> In-Reply-To: <4CF71F79.3020500@bsdimp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Subject: RE: vm_page_startup() X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2010 14:59:47 -0000 I much prefer the latter suggestion: making the code #ifdef'd on a feature,= and having each platform define (or not) the feature. I've seen what happe= ns when code in this space grows too many architecture ifdef's..... -- Andrew Duane Juniper Networks 978-589-0551 10 Technology Park Dr aduane@juniper.net Westford, MA 01886-3418 ________________________________________ From: owner-freebsd-mips@freebsd.org [owner-freebsd-mips@freebsd.org] On Be= half Of Warner Losh [imp@bsdimp.com] Sent: Wednesday, December 01, 2010 11:24 PM To: freebsd-mips@freebsd.org; Alan Cox Subject: Re: vm_page_startup() On 11/30/2010 23:03, Alan Cox wrote: > Given this bit of code in the MIPS pmap: > > vm_offset_t > pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) > { > vm_offset_t va, sva; > > if (MIPS_DIRECT_MAPPABLE(end)) > return (MIPS_PHYS_TO_DIRECT(start)); All mips architectures have at least a small direct map... > The following in vm_page_startup() can apply to MIPS (as well as amd64): > > #ifdef __amd64__ > /* > * pmap_map on amd64 comes out of the direct-map, not kvm like i386, > * so the pages must be tracked for a crashdump to include this data. > * This includes the vm_page_array and the early UMA bootstrap pages. > */ > for (pa =3D new_end; pa < phys_avail[biggestone + 1]; pa +=3D PAGE_SIZ= E) > dump_add_page(pa); > #endif > > Even if a particular MIPS-based machine didn't wind up using the > direct map for the pmap_map calls in vm_page_startup() there would be > no harm in having called dump_add_page(). On the other hand, if you > don't call dump_add_page() when the direct map is used, you're crash > dump will be missing some kernel data structures. So would you suggest having: #if defined(__mips__) || defined(__amd64__) or #if __VM_HAS_DIRECT_MAP and adding that define to pmap.h for mips and amd64? I'm leaning to the latter, since I don't like #ifdef arch in vm/* code on general principles, but you're the maintainer... Warner _______________________________________________ freebsd-mips@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-mips To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"