Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753561AbcCMBDD (ORCPT ); Sat, 12 Mar 2016 20:03:03 -0500 Received: from mail-ob0-f177.google.com ([209.85.214.177]:35967 "EHLO mail-ob0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753672AbcCMBCx (ORCPT ); Sat, 12 Mar 2016 20:02:53 -0500 MIME-Version: 1.0 In-Reply-To: <1457735807.6393.206.camel@hpe.com> References: <20160304094424.GA16228@gmail.com> <1457115514.15454.216.camel@hpe.com> <20160305114012.GA7259@gmail.com> <1457370228.15454.311.camel@hpe.com> <1457735807.6393.206.camel@hpe.com> From: Andy Lutomirski Date: Sat, 12 Mar 2016 17:02:33 -0800 Message-ID: Subject: Re: Overlapping ioremap() calls, set_memory_*() semantics To: Toshi Kani Cc: Ingo Molnar , "Luis R. Rodriguez" , Toshi Kani , Paul McKenney , Dave Airlie , Benjamin Herrenschmidt , "linux-kernel@vger.kernel.org" , linux-arch , X86 ML , Daniel Vetter , Thomas Gleixner , "H. Peter Anvin" , Peter Zijlstra , Borislav Petkov , Linus Torvalds , Andrew Morton , Andy Lutomirski , Brian Gerst Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1617 Lines: 32 On Fri, Mar 11, 2016 at 2:36 PM, Toshi Kani wrote: > On Thu, 2016-03-10 at 22:47 -0800, Andy Lutomirski wrote: >> On Mon, Mar 7, 2016 at 9:03 AM, Toshi Kani wrote: >> > Let me try to summarize... >> > >> > The original issue Luis brought up was that drivers written to work >> > with MTRR may create a single ioremap range covering multiple cache >> > attributes since MTRR can overwrite cache attribute of a certain >> > range. Converting such drivers with PAT-based ioremap interfaces, i.e. >> > ioremap_wc() and ioremap_nocache(), requires a separate ioremap map for >> > each cache attribute, which can be challenging as it may result in >> > overlapping ioremap ranges (in his term) with different cache >> > attributes. >> > >> > So, Luis asked about 'sematics of overlapping ioremap()' calls. Hence, >> > I responded that aliasing mapping itself is supported, but alias with >> > different cache attribute is not. We have checks in place to detect >> > such condition. Overlapping ioremap calls with a different cache >> > attribute either fails or gets redirected to the existing cache >> > attribute on x86. >> >> A little off-topic, but someone reminded me recently: most recent CPUs >> have self-snoop. It's poorly documented, but on self-snooping CPUs, I >> think that a lot of the aliasing issues go away. We may be able to >> optimize the code quite a bit on these CPUs. > > Interesting. I wonder how much we can rely on this feature. Yes, by > looking at Intel SDM, it is indeed poorly documented. :-( Any Intel people want to give us a hint? --Andy