From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751255AbcCAC1n (ORCPT ); Mon, 29 Feb 2016 21:27:43 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:60352 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbcCAC1m (ORCPT ); Mon, 29 Feb 2016 21:27:42 -0500 Date: Tue, 1 Mar 2016 02:27:39 +0000 From: Paul Burton To: Florian Fainelli CC: , Ralf Baechle , "James Hogan" , Joshua Kinard , "Paul Gortmaker" , , "Maciej W. Rozycki" , Markos Chandras , "Kirill A. Shutemov" Subject: Re: [PATCH 1/2] MIPS: Add barriers between dcache & icache flushes Message-ID: <20160301022738.GB12741@NP-P-BURTON> References: <1456164585-26910-1-git-send-email-paul.burton@imgtec.com> <56CBA181.8070606@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <56CBA181.8070606@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [10.100.200.88] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 22, 2016 at 04:02:09PM -0800, Florian Fainelli wrote: > On 22/02/16 10:09, Paul Burton wrote: > > Index-based cache operations may be arbitrarily reordered by out of > > order CPUs. Thus code which writes back the dcache & then invalidates > > the icache using indexed cache ops must include a barrier between > > operating on the 2 caches in order to prevent the scenario in which: > > > > - icache invalidation occurs. > > > > - icache fetch occurs, due to speculation. > > > > - dcache writeback occurs. > > > > If the above were allowed to happen then the icache would contain stale > > data. Forcing the dcache writeback to complete before the icache > > invalidation avoids this. > > Is that also true for CPUs with have cpu_has_ic_fills_dc? Hi Florian, Good question. I imagine not, but probably need to think some more & ask some questions. Thanks, Paul