From patchwork Thu Nov 29 15:57:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 1821761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 602A73FC5A for ; Thu, 29 Nov 2012 15:59:55 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Te6U6-0006FT-JG; Thu, 29 Nov 2012 15:57:06 +0000 Received: from mail-vc0-f177.google.com ([209.85.220.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Te6U2-0006Eh-I6 for linux-arm-kernel@lists.infradead.org; Thu, 29 Nov 2012 15:57:03 +0000 Received: by mail-vc0-f177.google.com with SMTP id f13so9286757vcb.36 for ; Thu, 29 Nov 2012 07:57:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=K2hliiX4B/O6GS97uKBOY/pB7iuhptCabDksTlClXus=; b=LFTRD4VH/YfnTlZd14Zbq/SelEqr6NcWfS2yVcX45FEH59m780AbX9nFBRLm9QCvYf w0wbust3VfewiuDimTP0lLnFRvVWD2MZVuJcfMtYi4efegVhLx7JKHljL7UbLXiieY3H OHZlONN6Ab5c1zpAtvjh+0KzjNhgPTeGhEg2AnWPqWMVma7Vt1n9umPEbMQq8UN48J2n eEKEsBdoO267mK873D4EtxP6u7MJvvI2FiC3tElKgsWpg5ZTxPSkHxE7ozCMstASZbnC lRr5+bOGI5F0ZnNdepra/FVynXXZ4hl+fsRMgPg0kdQ0YLDl6LLjsmz+QhDDTlna2LM2 Bamg== MIME-Version: 1.0 Received: by 10.220.221.203 with SMTP id id11mr31901206vcb.42.1354204620586; Thu, 29 Nov 2012 07:57:00 -0800 (PST) Received: by 10.58.33.198 with HTTP; Thu, 29 Nov 2012 07:57:00 -0800 (PST) X-Originating-IP: [72.80.83.148] In-Reply-To: <20121119141417.GT3205@mudshark.cambridge.arm.com> References: <20121110154203.2836.46686.stgit@chazy-air> <20121110154217.2836.41905.stgit@chazy-air> <20121119141417.GT3205@mudshark.cambridge.arm.com> Date: Thu, 29 Nov 2012 10:57:00 -0500 Message-ID: Subject: Re: [PATCH v4 01/14] ARM: Add page table and page defines needed by KVM From: Christoffer Dall To: Will Deacon X-Gm-Message-State: ALoCoQkpCMRiS/GEKQVh/OFvWwqkz0rBJlE0Tw4S3aM6N+SoivhQjYx709HoTyuT9Wm2RLWs+Rdz X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121129_105702_677019_54E99B79 X-CRM114-Status: GOOD ( 13.46 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Marcelo Tosatti , "linux-arm-kernel@lists.infradead.org" , "kvm@vger.kernel.org" , "kvmarm@lists.cs.columbia.edu" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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: >> KVM uses the stage-2 page tables and the Hyp page table format, >> so we define the fields and page protection flags needed by KVM. >> >> The nomenclature is this: >> - page_hyp: PL2 code/data mappings >> - page_hyp_device: PL2 device mappings (vgic access) >> - page_s2: Stage-2 code/data page mappings >> - page_s2_device: Stage-2 device mappings (vgic access) >> >> Reviewed-by: Marcelo Tosatti >> Christoffer Dall > > [...] > >> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c >> index 941dfb9..087d949 100644 >> --- a/arch/arm/mm/mmu.c >> +++ b/arch/arm/mm/mmu.c >> @@ -57,43 +57,61 @@ static unsigned int cachepolicy __initdata = CPOLICY_WRITEBACK; >> static unsigned int ecc_mask __initdata = 0; >> pgprot_t pgprot_user; >> pgprot_t pgprot_kernel; >> +pgprot_t pgprot_hyp_device; >> +pgprot_t pgprot_s2; >> +pgprot_t pgprot_s2_device; >> >> EXPORT_SYMBOL(pgprot_user); >> EXPORT_SYMBOL(pgprot_kernel); >> +EXPORT_SYMBOL(pgprot_hyp_device); >> +EXPORT_SYMBOL(pgprot_s2); >> +EXPORT_SYMBOL(pgprot_s2_device); > > Do we still need these? > the exports, nope. >> struct cachepolicy { >> const char policy[16]; >> unsigned int cr_mask; >> pmdval_t pmd; >> pteval_t pte; >> + pteval_t pte_s2; >> }; >> >> +#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. Here's the fix from above: -Christoffer diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 087d949..46ca62b 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -63,9 +63,6 @@ pgprot_t pgprot_s2_device; EXPORT_SYMBOL(pgprot_user); EXPORT_SYMBOL(pgprot_kernel); -EXPORT_SYMBOL(pgprot_hyp_device); -EXPORT_SYMBOL(pgprot_s2); -EXPORT_SYMBOL(pgprot_s2_device); struct cachepolicy { const char policy[16];