From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH 2/2 v2] kvm: powerpc: set cache coherency only for kernel managed pages Date: Thu, 18 Jul 2013 12:39:16 -0500 Message-ID: <1374169156.5357.8@snotra> References: <1374167862.5357.6@snotra> <7B6715E8-E136-4B05-862D-3D3F58D45760@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Transfer-Encoding: 8BIT Cc: Bharat Bhushan , , , Bharat Bhushan To: Alexander Graf Return-path: In-Reply-To: <7B6715E8-E136-4B05-862D-3D3F58D45760@suse.de> (from agraf@suse.de on Thu Jul 18 12:32:18 2013) Content-Disposition: inline Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 07/18/2013 12:32:18 PM, Alexander Graf wrote: > > On 18.07.2013, at 19:17, Scott Wood wrote: > > > On 07/18/2013 08:19:03 AM, Bharat Bhushan wrote: > > Likewise, we want to make sure this matches the host entry. > Unfortunately, this is a bit of a mess already. 64-bit booke appears > to always set MAS2_M for TLB0 mappings. The initial KERNELBASE > mapping on boot uses M_IF_SMP, and the settlbcam() that (IIRC) > replaces it uses _PAGE_COHERENT. 32-bit always uses _PAGE_COHERENT, > except that initial KERNELBASE mapping. _PAGE_COHERENT appears to be > set based on CONFIG_SMP || CONFIG_PPC_STD_MMU (the latter config > clears _PAGE_COHERENT in the non-CPU_FTR_NEED_COHERENT case). > > > > As for what we actually want to happen, there are cases when we > want M to be set for non-SMP. One such case is AMP, where CPUs may > be sharing memory even if the Linux instance only runs on one CPU > (this is not hypothetical, BTW). It's also possible that we > encounter a hardware bug that requires MAS2_M, similar to what some > of our non-booke chips require. > > How about we always set M then for RAM? M is like I in that bad things happen if you mix them. So we really want to match exactly what the rest of the kernel is doing. Plus, the performance penalty on some single-core chips can be pretty bad. -Scott