From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 3 15:18:12 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A52941065673 for ; Tue, 3 Apr 2012 15:18:12 +0000 (UTC) (envelope-from vasanth.raonaik@gmail.com) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 30B6F8FC1D for ; Tue, 3 Apr 2012 15:18:12 +0000 (UTC) Received: by wgbds11 with SMTP id ds11so3429749wgb.1 for ; Tue, 03 Apr 2012 08:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RlN0GLUORubIpIqDTySV5dSP7eoPIWPQXtQpnDKZ5q8=; b=Yy/jFlznyQFg8Rue4kD0mReYLo9OANGCBkl5n9mAZeyB1Cr+5LiJyqPbJuiT02QsJM iyKMmIvgbmUQmR6zWKRan3R8Xxqyvv9cs4N9bKgsvzCe5bXVx11j6GE6FjWRAKEhohSR pTzXYyKH0buPPm8xGUQPWzdTl/O4iDiPjIWYfAZySEOa4tL6dh11NLAw/lyc4fpv0fBs 8QFOj4dkZJuOfLhD/cJlUXt1sFXyfjhcCQ8sDcD3I8ZY8SB8yceTK4NTxAZBGpiWqq8U +mQ541ro0vW7ZZJ1KukZlLWNnvvedzx4U0QwSxg+7w2cEZUI+XRQAHD7n15p7WmqdKD2 TQlQ== MIME-Version: 1.0 Received: by 10.180.102.102 with SMTP id fn6mr7267184wib.10.1333466290958; Tue, 03 Apr 2012 08:18:10 -0700 (PDT) Received: by 10.180.98.161 with HTTP; Tue, 3 Apr 2012 08:18:10 -0700 (PDT) In-Reply-To: References: Date: Tue, 3 Apr 2012 11:18:10 -0400 Message-ID: From: vasanth rao naik sabavat To: Mark Tinguely Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: question about amd64 pagetable page allocation. 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, 03 Apr 2012 15:18:12 -0000 Hello Mark, Thank you for replying, Could you please point me to any document which illustrates the implementation of recursive page tables in FreeBSD for amd64. Also, I just found that with the following patch from Alon, the usage of vtopte() is removed in pmap_remove_pages(). Why was this removed? http://lists.freebsd.org/pipermail/svn-src-all/2009-March/006006.html Thanks, Vasanth On Tue, Apr 3, 2012 at 10:56 AM, Mark Tinguely wrote: > On Tue, Apr 3, 2012 at 8:33 AM, vasanth rao naik sabavat > wrote: > > Hi, > > > > I am trying to understand the page table page allocation for a process in > > FBSD6.1. I see that the page table pages are allocated by > vm_page_alloc(). > > I believe the virtual address for this allocated page can be derived by > > PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)), however when I compare this address > with > > the virtual address accessed in pmap_remove_pages() they are not the > same. > > > > The virtual address of a *PTE in pmap_remove_pages() is something like > > *0xffff800000643200 > > * > > However, the virtual address of the page allocated by vm_page_alloc() is > * > > 0xffffff033c6a0000 > > > > *I would also like to understand the importance of loc_PTmap, I believe > the > > pmap_remove_pages() is derving the page table page addresses from > loc_PTmap? > > (kgdb) p loc_PTmap > > Cannot access memory at address 0xffff800000000000 > > > > How do we relate the loc_PTmap to the page table pages allocated by > > vm_page_alloc() in _pmap_allocpte(). > > > > Thanks, > > Vasanth > > > > The answer to your questions will be more obvious when you get an > understanding of the Recursive Page Tables. > > --Mark Tinguely. >