From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH 2/2] kvm: powerpc: set cache coherency only for kernel managed pages Date: Wed, 24 Jul 2013 15:32:49 -0500 Message-ID: <1374697969.15592.67@snotra> References: <03EEFDFE-4603-44FC-8449-2450607F2864@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Transfer-Encoding: 8BIT Cc: Gleb Natapov , Bhushan Bharat-R65777 , =?UTF-8?b?4oCcdGllanVuLmNoZW7igJ0=?= , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org list" , Wood Scott-B07421 , Paolo Bonzini , To: Alexander Graf Return-path: In-Reply-To: <03EEFDFE-4603-44FC-8449-2450607F2864@suse.de> (from agraf@suse.de on Wed Jul 24 04:39:59 2013) Content-Disposition: inline Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/24/2013 04:39:59 AM, Alexander Graf wrote: > > On 24.07.2013, at 11:35, Gleb Natapov wrote: > > > On Wed, Jul 24, 2013 at 11:21:11AM +0200, Alexander Graf wrote: > >>> Are not we going to use page_is_ram() from > e500_shadow_mas2_attrib() as Scott commented? > >> > >> rWhy aren't we using page_is_ram() in kvm_is_mmio_pfn()? > >> > >> > > Because it is much slower and, IIRC, actually used to build pfn map > that allow > > us to check quickly for valid pfn. > > Then why should we use page_is_ram()? :) > > I really don't want the e500 code to diverge too much from what the > rest of the kvm code is doing. I don't understand "actually used to build pfn map...". What code is this? I don't see any calls to page_is_ram() in the KVM code, or in generic mm code. Is this a statement about what x86 does? On PPC page_is_ram() is only called (AFAICT) for determining what attributes to set on mmaps. We want to be sure that KVM always makes the same decision. While pfn_valid() seems like it should be equivalent, it's not obvious from the PPC code that it is. If pfn_valid() is better, why is that not used for mmap? Why are there two different names for the same thing? -Scott