From owner-p4-projects@FreeBSD.ORG Mon May 22 01:56:51 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A72BD16A5E2; Mon, 22 May 2006 01:56:51 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9344216A5D9 for ; Mon, 22 May 2006 01:56:50 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FED643D48 for ; Mon, 22 May 2006 01:56:45 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4M1u5B7077886 for ; Mon, 22 May 2006 01:56:05 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4M1u5ll077883 for perforce@freebsd.org; Mon, 22 May 2006 01:56:05 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 22 May 2006 01:56:05 GMT Message-Id: <200605220156.k4M1u5ll077883@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 97594 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 May 2006 01:56:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=97594 Change 97594 by kmacy@kmacy_storage:sun4v_work on 2006/05/22 01:55:51 implement pmap_is_modified fix possible precedence error in sanity check disable assertion that the hash tables are emptied at reset as we may be inserting unmanaged pages Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#53 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte.c#10 edit .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#36 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#53 (text+ko) ==== @@ -179,7 +179,7 @@ #ifdef PMAP_DEBUG #define KDPRINTF if (pmap_debug) printf #define DPRINTF \ - if ((PCPU_GET(curpmap)->pm_context != 0) && (PCPU_GET(cpumask) & PCPU_GET(curpmap)->pm_active) == 0) \ + if ((PCPU_GET(curpmap)->pm_context != 0) && ((PCPU_GET(cpumask) & PCPU_GET(curpmap)->pm_active)) == 0) \ panic("cpumask(0x%x) & active (0x%x) == 0 pid == %d\n", \ PCPU_GET(cpumask), PCPU_GET(curpmap)->pm_active, curthread->td_proc->p_pid); \ if (pmap_debug) printf @@ -1318,8 +1318,6 @@ boolean_t pmap_is_modified(vm_page_t m) { - UNIMPLEMENTED; - /* Not properly handled yet */ return tte_get_phys_bit(m, VTD_W); } @@ -1763,16 +1761,12 @@ panic("bad tte"); } } - /* - * We cannot remove wired pages from a - * process' mapping at this time - */ - if (tte_data & VTD_WIRED) { - npv = TAILQ_NEXT(pv, pv_plist); - continue; - } + if (tte_data & VTD_WIRED) + pmap->pm_stats.wired_count--; + m = PHYS_TO_VM_PAGE(TTE_GET_PA(tte_data)); + pmap->pm_stats.resident_count--; if (tte_data & VTD_W) { ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte.c#10 (text+ko) ==== @@ -94,8 +94,27 @@ boolean_t tte_get_phys_bit(vm_page_t m, uint64_t flags) { - UNIMPLEMENTED; - return (FALSE); + + pv_entry_t pv; + pmap_t pmap; + boolean_t rv; + + rv = FALSE; + if (m->flags & PG_FICTITIOUS) + return (rv); + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { + tte_t otte_data; + + pmap = pv->pv_pmap; + otte_data = tte_hash_lookup(pmap->pm_hash, pv->pv_va); + rv = ((otte_data & flags) != 0); + if (rv) + break; + } + + return (rv); } void ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#36 (text+ko) ==== @@ -237,10 +237,11 @@ fh = th->th_fhtail = th->th_fhhead; pmap_scrub_pages(TLB_DIRECT_TO_PHYS((vm_offset_t)th->th_fhhead), PAGE_SIZE); +#ifdef UNMANAGED_PAGES_ARE_TRACKED if (th->th_entries != 0) panic("%d remaining entries", th->th_entries); -#ifdef SCRUB_ON_RESET - pmap_scrub_pages(TLB_DIRECT_TO_PHYS((vm_offset_t)th->th_hashtable), th->th_size*PAGE_SIZE); +#else + pmap_scrub_pages(TLB_DIRECT_TO_PHYS((vm_offset_t)th->th_hashtable), th->th_size*PAGE_SIZE); #endif }