From patchwork Thu Jan 24 17:10:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 2034011 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id EC45EDF264 for ; Thu, 24 Jan 2013 17:12:53 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TyQJU-0007Da-Bs; Thu, 24 Jan 2013 17:10:08 +0000 Received: from ia-in-x0229.1e100.net ([2607:f8b0:4001:c02::229] helo=mail-ia0-x229.google.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TyQJQ-0007Bl-V3 for linux-arm-kernel@lists.infradead.org; Thu, 24 Jan 2013 17:10:05 +0000 Received: by mail-ia0-f169.google.com with SMTP id j5so5231022iaf.0 for ; Thu, 24 Jan 2013 09:10:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=iCYDhsPHQnhD51AfZ84MhpLwxxSe0f0SFiBtCvicBUQ=; b=Ux2h1zrCYyOVNVyxZH6nsHYTDKlaSK7DKjHhnKdwJSWOrGKMawqlTgn5QE8yli1sMA EdsQtOBKTuJNplbIowhbpBz7pW1OyRKgAGb6F6s89AV3fP3nasLG6+M9DFz3a7Zv2v/A 3ggx5NWBFBAm7hi0f7doykrVZOkeUKzLEZoG8tXyTej+c2wu3wkyW5EBuLvK0mRKRDRb 3s0mZYk4qHawjOSDLWvthZ8wb83LYLM4UsoylWcFqiwU/emIWgXId8PBEyaxvPW+GoZ+ PB3LmTTNuzDE2u62LdQYGXYZ2MLRffVerBeauygmIJHFpEgPT+S1xRS8OZFkjZ2p9daJ KKkA== MIME-Version: 1.0 X-Received: by 10.42.93.147 with SMTP id x19mr1595873icm.42.1359047402532; Thu, 24 Jan 2013 09:10:02 -0800 (PST) Received: by 10.64.37.70 with HTTP; Thu, 24 Jan 2013 09:10:02 -0800 (PST) X-Originating-IP: [72.80.83.148] In-Reply-To: <20130124170520.GG18233@arm.com> References: <20130116175716.29147.15348.stgit@ubuntu> <20130116175734.29147.19552.stgit@ubuntu> <20130124143224.GC18233@arm.com> <20130124170520.GG18233@arm.com> Date: Thu, 24 Jan 2013 12:10:02 -0500 Message-ID: Subject: Re: [PATCH v6 02/15] ARM: Section based HYP idmap From: Christoffer Dall To: Catalin Marinas X-Gm-Message-State: ALoCoQlLqEPgyOC6ElbbMic7r8ggpF3xgV9vxEt7fUut8OstRDCSvnI1MN/5JyKsuro1exIvk/RG X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130124_121005_037707_FECC5D12 X-CRM114-Status: GOOD ( 18.19 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "kvm@vger.kernel.org" , Marc Zyngier , Marcelo Tosatti , Will Deacon , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" 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 Thu, Jan 24, 2013 at 12:05 PM, Catalin Marinas wrote: > On Thu, Jan 24, 2013 at 04:36:09PM +0000, Christoffer Dall wrote: >> On Thu, Jan 24, 2013 at 9:32 AM, Catalin Marinas >> wrote: >> > On Wed, Jan 16, 2013 at 05:57:34PM +0000, Christoffer Dall wrote: >> >> --- a/arch/arm/mm/idmap.c >> >> +++ b/arch/arm/mm/idmap.c >> >> @@ -1,4 +1,6 @@ >> >> +#include >> > >> > Minor thing - do you need to include linux/module.h here? >> > >> >> there was once a time when kvm/arm could be compiled as a module; my >> best guess is that it's a leftover from that. >> >> >> + identity_mapping_add(hyp_pgd, __hyp_idmap_text_start, >> >> + __hyp_idmap_text_end, PMD_SECT_AP1); >> > >> > It would be more consistent if you define PMD_SECT_HYP or something like >> > that. I think you have a L_PTE_HYP bit as well. >> > >> Is this along the lines of what you had in mind? >> >> diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h >> b/arch/arm/include/asm/pgtable-3level-hwdef.h >> index 18f5cef..432fa12 100644 >> --- a/arch/arm/include/asm/pgtable-3level-hwdef.h >> +++ b/arch/arm/include/asm/pgtable-3level-hwdef.h >> @@ -50,6 +50,7 @@ >> #define PMD_SECT_AP_READ (_AT(pmdval_t, 0)) >> #define PMD_SECT_AP1 (_AT(pmdval_t, 1) << 6) >> #define PMD_SECT_TEX(x) (_AT(pmdval_t, 0)) >> +#define PMD_SECT_HYP PMD_SECT_AP1 >> >> /* >> * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). >> diff --git a/arch/arm/include/asm/pgtable-3level.h >> b/arch/arm/include/asm/pgtable-3level.h >> index 6ef8afd..a7e6532 100644 >> --- a/arch/arm/include/asm/pgtable-3level.h >> +++ b/arch/arm/include/asm/pgtable-3level.h >> @@ -116,6 +116,7 @@ >> /* >> * Hyp-mode PL2 PTE definitions for LPAE. >> */ >> +#define PMD_HYP PMD_SECT_AP1 > > Yes, but only one definition in is probably enough (PMD_SECT_HYP?). > yeah, that one was not supposed to be included in my git add command, whoops: --- Thanks, I'll queue these and send them after the other patch series has been merged. -Christoffer diff --git a/arch/arm/include/asm/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h index 18f5cef..432fa12 100644 --- a/arch/arm/include/asm/pgtable-3level-hwdef.h +++ b/arch/arm/include/asm/pgtable-3level-hwdef.h @@ -50,6 +50,7 @@ #define PMD_SECT_AP_READ (_AT(pmdval_t, 0)) #define PMD_SECT_AP1 (_AT(pmdval_t, 1) << 6) #define PMD_SECT_TEX(x) (_AT(pmdval_t, 0)) +#define PMD_SECT_HYP PMD_SECT_AP1 /* * AttrIndx[2:0] encoding (mapping attributes defined in the MAIR* registers). diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c index 2dffc01..bf1ee20 100644 --- a/arch/arm/mm/idmap.c +++ b/arch/arm/mm/idmap.c @@ -1,4 +1,3 @@ -#include #include #include @@ -97,7 +96,7 @@ static int __init init_static_idmap_hyp(void) pr_info("Setting up static HYP identity map for 0x%p - 0x%p\n", __hyp_idmap_text_start, __hyp_idmap_text_end); identity_mapping_add(hyp_pgd, __hyp_idmap_text_start, - __hyp_idmap_text_end, PMD_SECT_AP1); + __hyp_idmap_text_end, PMD_SECT_HYP); return 0; }