PERFORCE change 97594 for review
Kip Macy
kmacy at FreeBSD.org
Mon May 22 01:56:52 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=97594
Change 97594 by kmacy at 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
}
More information about the p4-projects
mailing list