From owner-svn-src-projects@FreeBSD.ORG Sun Dec 8 11:13:38 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31BB74EF; Sun, 8 Dec 2013 11:13:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 041C41B5E; Sun, 8 Dec 2013 11:13:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8BDb2k031492; Sun, 8 Dec 2013 11:13:37 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8BDbub031491; Sun, 8 Dec 2013 11:13:37 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201312081113.rB8BDbub031491@svn.freebsd.org> From: "Cherry G. Mathew" Date: Sun, 8 Dec 2013 11:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r259098 - projects/amd64_xen_pv/sys/amd64/xen X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 11:13:38 -0000 Author: cherry Date: Sun Dec 8 11:13:37 2013 New Revision: 259098 URL: http://svnweb.freebsd.org/changeset/base/259098 Log: - We don't support Process Context Identifiers (PCID) (the x86 version of ASIDs) yet. - You've got to flush that TLB when you've got to flush that TLB (as soon as the new user pmap has been loaded). - Do not destroy the pmap lock when a pmap is destroyed. The zone .init()/.fini() lock handling is leaky. - Remove stray #include These changes now enable fork(2) to succeed, and both parent and child to make progress. Next stop, exec(2) Approved by: gibbs(implicit) Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c Modified: projects/amd64_xen_pv/sys/amd64/xen/pmap.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/pmap.c Sun Dec 8 11:03:29 2013 (r259097) +++ projects/amd64_xen_pv/sys/amd64/xen/pmap.c Sun Dec 8 11:13:37 2013 (r259098) @@ -761,6 +761,7 @@ pmap_pinit0(pmap_t pmap) PCPU_SET(curpmap, pmap); pmap_pv_pmap_init(pmap); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); + pmap->pm_pcid = -1; } int @@ -815,6 +816,7 @@ void pmap_xen_userload(pmap_t pmap) PT_SET_VA_MA((pml4_entry_t *)KPML4phys + i, pml4e, false); } PT_UPDATES_FLUSH(); + invltlb(); /* Tell xen about user pmap switch */ xen_pt_user_switch(pmap->pm_cr3); @@ -826,13 +828,18 @@ pmap_release(pmap_t pmap) KASSERT(pmap != kernel_pmap, ("%s: kernel pmap released", __func__)); + KASSERT(pmap->pm_stats.resident_count == 0, + ("pmap_release: pmap resident count %ld != 0", + pmap->pm_stats.resident_count)); + + KASSERT(vm_radix_is_empty(&pmap->pm_root), + ("pmap_release: pmap has reserved page table page(s)")); + xen_pgdir_unpin(pmap->pm_cr3); pmap_xen_setpages_rw((uintptr_t)pmap->pm_pml4, 1); bzero(pmap->pm_pml4, PAGE_SIZE); kmem_free(kernel_arena, (vm_offset_t)pmap->pm_pml4, PAGE_SIZE); - - PMAP_LOCK_DESTROY(pmap); } static pt_entry_t * @@ -1005,8 +1012,6 @@ pmap_qremove(vm_offset_t sva, int count) // XXX: TODO: pmap_invalidate_range(kernel_pmap, sva, va); } -#include - static void pmap_enter_locked(pmap_t pmap, vm_offset_t va, vm_prot_t access, vm_page_t m, vm_prot_t prot, boolean_t wired)