From owner-p4-projects@FreeBSD.ORG Wed May 17 06:14:57 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 6E2B116A40D; Wed, 17 May 2006 06:14:57 +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 4913F16A406 for ; Wed, 17 May 2006 06:14:57 +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 14C9943D49 for ; Wed, 17 May 2006 06:14:57 +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 k4H6EcSo052912 for ; Wed, 17 May 2006 06:14:38 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4H6Eb44052909 for perforce@freebsd.org; Wed, 17 May 2006 06:14:37 GMT (envelope-from kmacy@freebsd.org) Date: Wed, 17 May 2006 06:14:37 GMT Message-Id: <200605170614.k4H6Eb44052909@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 97323 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: Wed, 17 May 2006 06:14:57 -0000 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;