From owner-freebsd-mips@FreeBSD.ORG Fri Jul 31 00:51:52 2009 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2FA2106566B for ; Fri, 31 Jul 2009 00:51:52 +0000 (UTC) (envelope-from neelnatu@yahoo.com) Received: from web34402.mail.mud.yahoo.com (web34402.mail.mud.yahoo.com [66.163.178.151]) by mx1.freebsd.org (Postfix) with SMTP id A3B9C8FC1E for ; Fri, 31 Jul 2009 00:51:52 +0000 (UTC) (envelope-from neelnatu@yahoo.com) Received: (qmail 15275 invoked by uid 60001); 31 Jul 2009 00:51:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1249001512; bh=zTJ9ZyifEWZcWdDdJvTLHS+ismpNUh6MuMyWlTnsTfY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=o+h28PDoy+zbPKmplubnwRy4/QetoF+rdQwc1kemw8EVU3ie8woPkswGVhyn0Fje5ABhHJQenejAjLrGsSqeCpWnQcqFztwIDWAkPbEaVdC+hvd1/THFyVAvMCuCHMguiKjfBSsXMTmrt8XWbpLyHjKQrp1TAizGoEvmjqcv5sI= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=ahNM8Y0tIl5xxxJLq+790tMBLL4NuBu3RJn6Ni0s0uc2vUHE7BNoinQfYUhze/7l0Hf7O2ej4I7eX8TbAWJYl65XTiMqeLQbxYrPbROePh2YkkwK0AcYFXPMAbcXQxpvkAvuGYSl6culHPiKyFJj0ERStXFSnhr8xVrmxll0axQ=; Message-ID: <153254.15259.qm@web34402.mail.mud.yahoo.com> X-YMail-OSG: jICHvsoVM1nxALgBtm6gtGmNG_PyEeTpF7Ka0UfwWg3USMTUV0QpE5OvvLFa9WNFGeZioLsTpmvCR.7RZPHFsu9ai5Zk3kF_kyQut9yfImllm9tekEPdWTYDYQGQZQ0Kfq5inn_2WUIm4rM3IOt35XQwPds5yXdeRP.Ceik_vTU2dMNUGUW1iKJBV7q4617c4KhlgKT5kyXP.dNdGCcskerFQg3t5vL9Bpmyx6a00ZRaNhwo2zJxA0DP8fKycea5LeyB4U1YDqWSbNoP6G5Fzj__wLcv.o.p_.o1Vp5XXPYjFued12eEXGRbYG2SWo244QhFiA-- Received: from [198.95.226.228] by web34402.mail.mud.yahoo.com via HTTP; Thu, 30 Jul 2009 17:51:51 PDT X-Mailer: YahooMailClassic/6.0.19 YahooMailWebService/0.7.289.15 Date: Thu, 30 Jul 2009 17:51:51 -0700 (PDT) From: Neelkanth Natu To: freebsd-mips@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Diffs to fix L1 cache flush problems X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2009 00:51:53 -0000 Hi, This is a simple change that fixes problems invalidating L1 data/instruction caches. The problem is that the type of the variable that holds the size of the instruction/data caches is uint8_t. Clearly this is going to overflow. On the Sibyte with 32KB cache size the uint8_t was causing it to be truncated to 0. This in turn makes the cache flush routines turn into no-ops. I ran into this when testing kernel loadable modules and have verified that this change fixes the problem. best Neel ==== //depot/user/neelnatu/freebsd_sibyte/src/sys/mips/include/cpuinfo.h#2 (text) - //depot/user/neelnatu/freebsd_sibyte/src/sys/mips/include/cpuinfo.h#3 (text) ==== content @@ -57,11 +57,11 @@ u_int16_t tlb_nentries; u_int8_t icache_virtual; struct { - u_int8_t ic_size; + unsigned int ic_size; u_int8_t ic_linesize; u_int8_t ic_nways; u_int16_t ic_nsets; - u_int8_t dc_size; + unsigned int dc_size; u_int8_t dc_linesize; u_int8_t dc_nways; u_int16_t dc_nsets;