From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 14 12:08:48 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 063A916A41C for ; Tue, 14 Jun 2005 12:08:48 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [195.245.194.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id D60ED43D1D for ; Tue, 14 Jun 2005 12:08:37 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) (authenticated bits=0) by comsys.ntu-kpi.kiev.ua (8.12.10/8.12.10) with ESMTP id j5ECEE5O040194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Jun 2005 15:14:16 +0300 (EEST) Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id B30E32A5; Tue, 14 Jun 2005 15:07:06 +0300 (EEST) Date: Tue, 14 Jun 2005 15:07:06 +0300 From: Andrey Simonenko To: Aziz Kezzou Message-ID: <20050614120706.GA539@pm514-9.comsys.ntu-kpi.kiev.ua> References: <37273927050614012154fdb80b@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <37273927050614012154fdb80b@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-Spam-Status: No, score=-4.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on comsys.ntu-kpi.kiev.ua X-Virus-Scanned: ClamAV 0.82/921/Wed Jun 8 11:51:44 2005 on comsys.ntu-kpi.kiev.ua X-Virus-Status: Clean Cc: freebsd-hackers Subject: Re: FreeBSD Memory Management questions ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2005 12:08:48 -0000 On Tue, Jun 14, 2005 at 04:21:41AM -0400, Aziz Kezzou wrote: > > 1 - Right now to access the memory address space of a user process > from kernel mode, I only have to set, on x86 systems, the register CR3 > to the right value. How can I do that on other architectures ? is > there an architecture-independant way of doing that ? Addition to the previous answer. It is also possible to temporally map several pages of user memory into the kernel address space. Check pmap_qenter(9) and see physio -> vmapbuf, for example, how to use it. Another method, it is possible to COW a single user page and then use it in the kernel, but with this method an user process will not see any modification in this page made by the kernel and vice versa. Check socow_setup -> vm_page_cowsetup, for example, how to use it.