From owner-svn-src-head@FreeBSD.ORG Sat May 7 17:23:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 810A7106566B; Sat, 7 May 2011 17:23:13 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 722AF8FC08; Sat, 7 May 2011 17:23:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p47HNDi0008036; Sat, 7 May 2011 17:23:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p47HNDpR008034; Sat, 7 May 2011 17:23:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201105071723.p47HNDpR008034@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 7 May 2011 17:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221606 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 17:23:13 -0000 Author: marcel Date: Sat May 7 17:23:13 2011 New Revision: 221606 URL: http://svn.freebsd.org/changeset/base/221606 Log: In pmap_kextract(), return the physical address for PBVM virtual addresses as well (incl. the PBVM page table). Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sat May 7 16:32:59 2011 (r221605) +++ head/sys/ia64/ia64/pmap.c Sat May 7 17:23:13 2011 (r221606) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -1206,6 +1207,8 @@ vm_paddr_t pmap_kextract(vm_offset_t va) { struct ia64_lpte *pte; + uint64_t *pbvm_pgtbl; + u_int idx; KASSERT(va >= VM_MAXUSER_ADDRESS, ("Must be kernel VA")); @@ -1222,6 +1225,25 @@ pmap_kextract(vm_offset_t va) return (pmap_present(pte) ? pmap_ppn(pte)|(va&PAGE_MASK) : 0); } + /* PBVM page table. */ + if (va >= IA64_PBVM_PGTBL + bootinfo->bi_pbvm_pgtblsz); + return (0); + if (va >= IA64_PBVM_PGTBL) + return (va - IA64_PBVM_PGTBL) + bootinfo->bi_pbvm_pgtbl; + + /* PBVM. */ + if (va >= IA64_PBVM_BASE) { + pbvm_pgtbl = (void *)IA64_PBVM_PGTBL; + idx = (va - IA64_PBVM_BASE) >> IA64_PBVM_PAGE_SHIFT; + if (idx >= (bootinfo->bi_pbvm_pgtblsz >> 3)) + return (0); + if ((pbvm_pgtbl[idx] & PTE_PRESENT) == 0) + return (0); + return ((pbvm_pgtbl[idx] & PTE_PPN_MASK) + + (va & IA64_PBVM_PAGE_MASK)); + } + + printf("XXX: %s: va=%#lx\n", __func__, va); return (0); }