From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH v4 01/14] ARM: Add page table and page defines needed by KVM Date: Fri, 30 Nov 2012 11:46:34 +0000 Message-ID: <20121130114634.GC26305@mudshark.cambridge.arm.com> References: <20121110154203.2836.46686.stgit@chazy-air> <20121110154217.2836.41905.stgit@chazy-air> <20121119141417.GT3205@mudshark.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "kvm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , Marcelo Tosatti To: Christoffer Dall Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:50550 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934Ab2K3LrD (ORCPT ); Fri, 30 Nov 2012 06:47:03 -0500 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Nov 29, 2012 at 03:57:00PM +0000, Christoffer Dall wrote: > On Mon, Nov 19, 2012 at 9:14 AM, Will Deacon wrote: > > On Sat, Nov 10, 2012 at 03:42:17PM +0000, Christoffer Dall wrote: > >> > >> +#ifdef CONFIG_ARM_LPAE > >> +#define s2_policy(policy) policy > >> +#else > >> +#define s2_policy(policy) 0 > >> +#endif > > > > Put the macro in pgtable-{2,3}level.h? > > > > I think that's weird, defining something far away from where it's used > will only make it harder to read, pgtable.h is not included in this > file, and there are other #ifdef CONFIG_ARM_LPAE in that file. Of course pgtable.h is included in this file -- we have direct references to L_PTE_MT_UNCACHED, for example, so by your logic we should inline all of that too! Yes, there are other CONFIG_ARM_LPAE checks in this file, but only where there's a piece of code that is not applicable one way or the other. For data definitions, it's really easy to fix in the headers so please do it there instead. Will