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: 1821741 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 03B193FC5A for ; Thu, 29 Nov 2012 15:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754127Ab2K2P5D (ORCPT ); Thu, 29 Nov 2012 10:57:03 -0500 Received: from mail-vb0-f46.google.com ([209.85.212.46]:55714 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753941Ab2K2P5B (ORCPT ); Thu, 29 Nov 2012 10:57:01 -0500 Received: by mail-vb0-f46.google.com with SMTP id ff1so9382368vbb.19 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=pYUSe1Xa/5+6Cxp4A8/sUJKbXtJv/sD6YtsogQoN8QqlHz6OKWm68dGZgnwgpZypVA 47kTKjL58UndaJAXESmyB+ZBjsixirKul12l6q55KcGVfYk+sN3XO7Dr6pMlQ/ZiMCjF 5dFWLWlVYB7BATIpGZCzet5ZHkiXwkgxsb+88r7BQ5Q+ZyEiK5bx1p67s+BHNnnsH+kF jtuEybanlNGIIUVJbgkKrVO7dG/V7q1+iJs8NMiO8w6uV5T+yyQGWcuhcZLM5CYbDuoJ 5+PQF5J0sZrhpGUakbiN+Tv+lhj/fw0caQ5SD0XbAY3CHYPUU4I1CZIac5WkmVv820Dx v9mw== 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 Cc: "kvm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , Marcelo Tosatti X-Gm-Message-State: ALoCoQmnehF+k7SJpkjkvMjlQoK8XYMjBvpbcH5pLWDKpw4hIqIww5L80q5knNJfOX/N2H6lZVAQ Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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 --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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];