From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 3 14:56:07 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 02D0F1065672 for ; Tue, 3 Apr 2012 14:56:07 +0000 (UTC) (envelope-from marktinguely@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id CA2128FC15 for ; Tue, 3 Apr 2012 14:56:06 +0000 (UTC) Received: by pbcwz17 with SMTP id wz17so6042059pbc.13 for ; Tue, 03 Apr 2012 07:56:06 -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:content-transfer-encoding; bh=3THaVWHQlHCNquLc3FLcQ1O7SltIPIextJTamr0IGEk=; b=qnOh6kqOfJ1+ZD378yBPkzj855k+EOCcpINdCgkDUOhwu078at4OwlT7YPKCYFUI++ FIepGp3m0wRIHsKh5Q2PgwRp2x58YV1pimXrpzEGlzJcNJyb8aMy8wbgSm1JJlKUt/IT tB0p/KuMum1u0tuzr8RRSsQEekAVQe2RnFbnl06Dn4Z7PdxQsuqD13p1m2G20RSV3Nyv kxnbdIKcE9ZBAxrGDejXgiJDMoA1TtJ5SF9RI5KmKm7I2VZKIvE/8CpDvCl7MfID0tM/ St2Ya8fJPZ58bcqXpxBPIgaJdXURWGq/O1Vp3BDrLo54QXMJeO8Gyx747HdDF167dTqj b9sg== MIME-Version: 1.0 Received: by 10.68.200.137 with SMTP id js9mr8261439pbc.110.1333464966636; Tue, 03 Apr 2012 07:56:06 -0700 (PDT) Received: by 10.68.189.69 with HTTP; Tue, 3 Apr 2012 07:56:06 -0700 (PDT) In-Reply-To: References: Date: Tue, 3 Apr 2012 09:56:06 -0500 Message-ID: From: Mark Tinguely To: vasanth rao naik sabavat Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 14:56:07 -0000 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 wit= h > 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 = =A0* > 0xffffff033c6a0000 > > *I would also like to understand the importance of loc_PTmap, I believe t= he > pmap_remove_pages() is derving the page table page addresses from loc_PTm= ap? > (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.