PERFORCE change 97323 for review
Kip Macy
kmacy at FreeBSD.org
Wed May 17 06:14:57 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=97323
Change 97323 by kmacy at kmacy_storage:sun4v_rwbuf on 2006/05/17 06:14:09
add more rigorous error checking
Affected files ...
.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#29 edit
Differences ...
==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/tte_hash.c#29 (text+ko) ====
@@ -237,9 +237,8 @@
vm_page_free(m);
}
fh = th->th_fhtail = th->th_fhhead;
- fh->thf_head.fh_next = NULL;
- fh->thf_head.fh_count = 0;
- fh->thf_head.fh_free_head = 0;
+ pmap_scrub_pages(TLB_DIRECT_TO_PHYS((vm_offset_t)th->th_fhhead), PAGE_SIZE);
+
if (th->th_entries != 0)
panic("%d remaining entries", th->th_entries);
#ifndef DONT_SCRUB_ENTRIES
@@ -315,7 +314,11 @@
}
}
if (i == HASH_ENTRIES) {
- if (fields[(HASH_ENTRIES - 1)].of.flags & TH_COLLISION) {
+#ifdef DEBUG
+ if (fields[(HASH_ENTRIES - 1)].of.flags & TH_INVALID)
+ panic("invalid bit set");
+#endif
+ if (fields[(HASH_ENTRIES - 1)].of.flags == TH_COLLISION) {
fields = fields[(HASH_ENTRIES - 1)].of.next;
goto retry;
}
@@ -350,7 +353,11 @@
if (index != -1)
PCPU_SET(last_field, (u_long)&fields[index]);
else {
- if (fields[(HASH_ENTRIES - 1)].of.flags & TH_COLLISION) {
+#ifdef DEBUG
+ if (fields[(HASH_ENTRIES - 1)].of.flags & TH_INVALID)
+ panic("invalid bit set");
+#endif
+ if (fields[(HASH_ENTRIES - 1)].of.flags == TH_COLLISION) {
if (fields[(HASH_ENTRIES - 1)].of.next[0].tte.tag != 0) {
fields = fields[(HASH_ENTRIES - 1)].of.next;
goto retry;
More information about the p4-projects
mailing list