Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 May 2006 06:14:37 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 97323 for review
Message-ID:  <200605170614.k4H6Eb44052909@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=97323

Change 97323 by kmacy@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605170614.k4H6Eb44052909>