Date: Thu, 4 May 2006 00:28:15 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96637 for review Message-ID: <200605040028.k440SFCc067967@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96637 Change 96637 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/05/04 00:27:19 some basic cleanup fix pmap_ipi to send shootdowns to all other cpus pre-zero pages allocated by pmap_bootstrap Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#42 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#42 (text+ko) ==== @@ -377,6 +377,7 @@ continue; pa = phys_avail[i]; phys_avail[i] += size; + pmap_scrub_pages(pa, size); return (pa); } panic("pmap_bootstrap_alloc"); @@ -824,6 +825,7 @@ pv_entry_count > pv_entry_high_water) return; + vm_page_lock_queues(); if (dst_pmap < src_pmap) { PMAP_LOCK(dst_pmap); @@ -842,6 +844,7 @@ if ((tte_data & VTD_MANAGED) != 0) { if (tte_hash_lookup_nolock(dst_pmap->pm_hash, addr) == 0) { m = PHYS_TO_VM_PAGE(TTE_GET_PA(tte_data)); + tte_hash_insert(dst_pmap->pm_hash, addr, tte_data & ~(VTD_W|VTD_REF)); dst_pmap->pm_stats.resident_count++; pmap_insert_entry(dst_pmap, addr, m); @@ -1012,18 +1015,20 @@ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); PMAP_LOCK(pmap); + + tte_data = VM_PAGE_TO_PHYS(m); /* * Enter on the PV list if part of our managed memory. Note that we * raise IPL while manipulating pv_table since pmap_enter can be * called at interrupt time. */ - if ((m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) == 0) + if ((m->flags & (PG_FICTITIOUS|PG_UNMANAGED)) == 0) { pmap_insert_entry(pmap, va, m); + tte_data |= VTD_MANAGED; + } pmap->pm_stats.resident_count++; - tte_data = VM_PAGE_TO_PHYS(m); - if ((prot & VM_PROT_EXECUTE) != 0) tte_data |= VTD_X; @@ -1032,9 +1037,6 @@ else tte_data |= TTE_MINFLAGS; - if (!(m->flags & (PG_FICTITIOUS|PG_UNMANAGED))) - tte_data |= VTD_MANAGED; - tte_hash_insert(pmap->pm_hash, va, tte_data | TTE_MINFLAGS); PMAP_UNLOCK(pmap); @@ -1194,11 +1196,14 @@ ackexpect |= (1 << i); #if 0 inext = ((i & ~0x3) + 4); + cpus = (cpus >> (inext - i)); + i = inext; #else inext = i++; + cpus = cpus >> 1; #endif - cpus = (cpus >> (inext - i)); - i = inext; + + } #else inext = i = cpus = 0; @@ -1265,7 +1270,6 @@ /* XXX */ invltlb(); - if ((((eva - sva) >> PAGE_SHIFT) < MAX_INVALIDATES)) { for (tva = sva; tva < eva; tva += PAGE_SIZE_8K) invlpg(tva, pmap->pm_context); @@ -1280,7 +1284,6 @@ else func = tl_invlctx; - pmap_ipi(pmap, (void *)func, pmap->pm_context, 0); if (pmap != kernel_pmap) pmap->pm_tlbactive = pmap->pm_active; @@ -1543,12 +1546,11 @@ uint64_t otte_data, tte_data; vm_page_t m; - if ((otte_data = tte_hash_lookup(pmap->pm_hash, tva)) == 0) + if ((tte_data = tte_hash_lookup(pmap->pm_hash, tva)) == 0) continue; - tte_data = otte_data; - tte_data &= ~(VTD_SW_W | VTD_W | VTD_REF); + otte_data = tte_hash_update(pmap->pm_hash, tva, tte_data); if (tte_data != otte_data) @@ -1556,7 +1558,7 @@ if (otte_data & VTD_MANAGED) { m = NULL; - + if (otte_data & VTD_REF) { m = PHYS_TO_VM_PAGE(TTE_GET_PA(otte_data)); vm_page_flag_set(m, PG_REFERENCED); @@ -1565,8 +1567,7 @@ m = PHYS_TO_VM_PAGE(TTE_GET_PA(otte_data)); vm_page_dirty(m); } - - } + } } sched_unpin();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605040028.k440SFCc067967>