From owner-cvs-src@FreeBSD.ORG Sat Nov 19 05:06:32 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D79CE16A41F; Sat, 19 Nov 2005 05:06:32 +0000 (GMT) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5DC343D46; Sat, 19 Nov 2005 05:06:32 +0000 (GMT) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jAJ56WXt072540; Sat, 19 Nov 2005 05:06:32 GMT (envelope-from alc@repoman.freebsd.org) Received: (from alc@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jAJ56WD5072539; Sat, 19 Nov 2005 05:06:32 GMT (envelope-from alc) Message-Id: <200511190506.jAJ56WD5072539@repoman.freebsd.org> From: Alan Cox Date: Sat, 19 Nov 2005 05:06:32 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_6 Cc: Subject: cvs commit: src/sys/amd64/amd64 pmap.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2005 05:06:33 -0000 alc 2005-11-19 05:06:32 UTC FreeBSD src repository Modified files: (Branch: RELENG_6) sys/amd64/amd64 pmap.c Log: MFC revision 1.517 When support for 2MB/4MB pages was added in revision 1.148 an error was made in pmap_protect(): The pmap's resident count should not be reduced unless mappings are removed. The errant change to the pmap's resident count could result in a later pmap_remove() failing to remove any mappings if the errant change has set the pmap's resident count to zero. MFC revision 1.518 Decouple the unrefing of a page table page from the removal of a pv entry. In other words, change pmap_remove_entry() such that it no longer unrefs the page table page. Now, it only removes the pv entry. MFC revision 1.519 Eliminate unneeded diagnostic code. MFC revision 1.520 Eliminate unneeded diagnostic code. Eliminate an unused #include. (Kernel stack allocation and deallocation long ago migrated to the machine-independent code.) MFC revision 1.521 Simplify the page table page reference counting by pmap_enter()'s change of mapping case. Eliminate a stale comment from pmap_enter(). MFC revision 1.522 Correct a performance bug in revision 1.462. The effect of the bug is to execute the outer loop in procedures such as pmap_protect() many more times than necessary. MFC revision 1.523 Introduce pmap_pml4e_to_pdpe() and pmap_pdpe_to_pde() and use them to avoid recomputation of the pml4e and pdpe in pmap_copy(), pmap_protect(), and pmap_remove(). MFC revision 1.524 Change pmap_extract() and pmap_extract_and_hold() to use PG_FRAME rather than ~PDRMASK to extract the physical address of a superpage from a PDE. The use of ~PDRMASK is problematic if the PDE has PG_NX set. Specifically, the PG_NX bit will be included in the physical address if ~PDRMASK is used. MFC revision 1.525 Pass the PDE from pmap_remove() to pmap_remove_page() so that the latter procedure doesn't have to recompute it. MFC revision 1.526 Remedy the following three problems: 1. The amd64 pmap, unlike the i386 pmap, maintains a reference count for each page directory (PD) page. However, in the transformation of the i386 pmap into the amd64 pmap, operations, such as pmap_copy() and pmap_object_init_pt(), that create 2MB "superpage" mappings by setting the PG_PS bit in a PD entry were not modified to adjust the underlying PD page's reference count. Consequently, superpage mappings could disappear prematurely. 2. pmap_object_init_pt() could crash or corrupt memory if either the virtual address range being mapped crosses a 1GB boundary in the virtual address space or nothing is mapped in the 1GB area. 3. When pmap_allocpte() destroys a 2MB "superpage" mapping it does not reduce the pmap's resident count accordingly. It should. (This bug is inherited from i386.) MFC revision 1.528 Eliminate unnecessary TLB invalidations by pmap_enter(). Specifically, eliminate TLB invalidations when permissions are relaxed, such as when a read-only mapping is changed to a read/write mapping. Additionally, eliminate TLB invalidations when bits that are ignored by the hardware, such as PG_W ("wired mapping"), are changed. Revision Changes Path 1.516.2.3 +166 -117 src/sys/amd64/amd64/pmap.c