From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LMZT3-00036I-Ke for qemu-devel@nongnu.org; Mon, 12 Jan 2009 21:57:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LMZT2-000364-1R for qemu-devel@nongnu.org; Mon, 12 Jan 2009 21:57:25 -0500 Received: from [199.232.76.173] (port=38370 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LMZT1-000361-Ro for qemu-devel@nongnu.org; Mon, 12 Jan 2009 21:57:23 -0500 Received: from bart.se.axis.com ([195.60.68.10]:42981) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LMZT1-0000C2-Do for qemu-devel@nongnu.org; Mon, 12 Jan 2009 21:57:23 -0500 Received: from bart.se.axis.com (bart.se.axis.com [127.0.0.1]) by bart.se.axis.com (Postfix) with ESMTP id A7EBD64083 for ; Tue, 13 Jan 2009 03:57:22 +0100 (CET) Received: from axis.com (edgar.se.axis.com [10.93.151.1]) by bart.se.axis.com (Postfix) with ESMTP id 8B55964032 for ; Tue, 13 Jan 2009 03:57:22 +0100 (CET) Date: Tue, 13 Jan 2009 03:57:22 +0100 From: "Edgar E. Iglesias" Subject: Re: [Qemu-devel] sh: dcache flush breaks text region? Message-ID: <20090113025722.GC30935@edgar.se.axis.com> References: <4968DD28.3030709@juno.dti.ne.jp> <20090110195332.GD26952@edgar.se.axis.com> <49696E54.9030102@juno.dti.ne.jp> <20090111104259.GE26952@edgar.se.axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090111104259.GE26952@edgar.se.axis.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Shin-ichiro KAWASAKI , qemu-devel@nongnu.org, "linux-sh@vger.kernel.org" On Sun, Jan 11, 2009 at 11:42:59AM +0100, Edgar E. Iglesias wrote: > On Sun, Jan 11, 2009 at 12:58:12PM +0900, Shin-ichiro KAWASAKI wrote: > > > > Edgar E. Iglesias wrote: > >> Another solution might be for linux to use a ocpb followed by a ocpi insn > >> on the line. IIUC that should achieve the same results net results. > > I'm not sure about it. But I think we should not modify linux, > > I agree. > > The ocpb followed by the ocpi that I suggested won't work and I cant > think of anything better than what linux is already doing. I gave this some more thought and I think that there might be room for improvements in the cache-sh4 flushing loops anyway. The reason why the suggested ocbp+ocbi sequences didn't work was because I later noticed that the same loop was beeing used for unconditional line flushes aswell as for flushes for ranges where you actually know the virtual addresses you want to flush (complete page flushes seem to be treated differently). If you separate the two, the flushes for virtual ranges can be done with the ocbp+ocbi sequence. If I'm not misstaken, there are two main advantages: 1. You will flush and invalidate much fewer lines, only those that actually hit in the cache. This could turn out to be a pretty significant win. 2. You get rid of the atomic requirements. It means you can do all the ranged flushes with interrupts enabled all the time. Best regards