From owner-freebsd-mips@FreeBSD.ORG Mon Apr 28 18:12:34 2008 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 5D7D2106564A for ; Mon, 28 Apr 2008 18:12:34 +0000 (UTC) (envelope-from flata@magnesium.net) Received: from toxic.magnesium.net (toxic.magnesium.net [207.154.84.15]) by mx1.freebsd.org (Postfix) with ESMTP id 4F95B8FC13 for ; Mon, 28 Apr 2008 18:12:34 +0000 (UTC) (envelope-from flata@magnesium.net) Received: by toxic.magnesium.net (Postfix, from userid 1212) id 19D16DA8C9; Mon, 28 Apr 2008 10:51:35 -0700 (PDT) Date: Mon, 28 Apr 2008 07:51:35 -1000 From: Juli Mallett To: Andrew Duane Message-ID: <20080428175135.GA11972@toxic.magnesium.net> References: <2da2ec620804222103r7e90af37j2d36b0f0bc049abb@mail.gmail.com> <20080426.232158.1683324026.imp@bsdimp.com> <0FCFCF6165E968449991746EB91D614D142EFA@antipi.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0FCFCF6165E968449991746EB91D614D142EFA@antipi.jnpr.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-mips@freebsd.org Subject: Re: minor fix for tlb manipulations 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: Mon, 28 Apr 2008 18:12:34 -0000 Nobody's affected by this for the simple matter that you just plain don't index into the TLBLO entries, you index into the TLBs. Each TLB entry consists of many things, including pair of TLBLO entries. I don't think anybody out there counts the number of TLBLO entries, they count the number of pairs since everything else in the TLB isn't paired. Maybe somebody has had this problem when they were first going from MIPS-I support to MIPS-III, and they were used to unpaired TLB entries and they decided they would multiply the (hard-coded) figure by two for any TLB operations. But the problems and complexities that would lead to would be quite marked, and I don't even want to think about how that person would approach the result of tlbp. * Andrew Duane [ 2008-04-28 ] [ RE: minor fix for tlb manipulations ] > > Our version of the MIPS code does in fact use the number of pairs, not number of entries, so we are not affected by this issue. I'm not sure how the "virgin" FreeBSD code works, though, we've modified this section somewhat. > > -----Original Message----- > From: owner-freebsd-mips@freebsd.org on behalf of M. Warner Losh > Sent: Sun 4/27/2008 1:21 AM > To: nao@tom-yam.or.jp > Cc: freebsd-mips@freebsd.org > Subject: Re: minor fix for tlb manipulations > > In message: <2da2ec620804222103r7e90af37j2d36b0f0bc049abb@mail.gmail.com> > "Naoki Hamada" writes: > : I found a slight problem in tlb.S which tries to manipulate > : no-existing tlbs. The argument of Mips_TLBFlush() and mips_TBIAP() is > : the number of tlbs to deal with, but both functions process the same > : number of tlb pairs, so twice the number of actual tlbs. > > I believe that the argument is the number of pairs to invalidate, at > least in the case of Mips_TLBFlush. The number passed in is the > MMUSize field from CO_Config1, which indicates the number of pairs > that exist in the tlb. True, each iteration of the loop invalidates a > pair of TLB entires, I think that the code is correct as it is. The > MMUSize field returns the number of pairs, so I don't think any > biasing is needed. > > The current Mips_TLBFlush function matches the InitTLB function given > in the MIPS32 Architecture for Programmers, Volume III. > > : TLBWI entry of "MIPS32 Architecture For Programmers Volume II: The > : MIPS32 Instruction Set" states that "The operation is UNDEFINED if the > : contents of the Index register are greater than or equal to the number > : of TLB entries in the processor." It seems to do no harm to my system, > : but your mileage may vary. > > Correct. However, the count is the number of pairs, not the total > number. > > Have I missed something in my reading the code and the mips32 specs? > > Warner > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" --