From patchwork Thu Jan 24 16:36:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 2033911 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 1F3493FDBC for ; Thu, 24 Jan 2013 16:38:37 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TyPmf-0004dI-JR; Thu, 24 Jan 2013 16:36:13 +0000 Received: from mail-ia0-x236.google.com ([2607:f8b0:4001:c02::236]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TyPmc-0004cQ-Dt for linux-arm-kernel@lists.infradead.org; Thu, 24 Jan 2013 16:36:10 +0000 Received: by mail-ia0-f182.google.com with SMTP id w33so5026583iag.41 for ; Thu, 24 Jan 2013 08:36:10 -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=oO1E4xl2mjMENb/G3cnrZrJUVhsJmVhPiyae9yWCxRo=; b=FSdNw5/+k/FyWzy13Q8HhUWBjPoRITM4LNJP9gfhzfiQUCwaIOSMSRP48eg0WorNnO NuMSJoH9vV3wso1j94Cce7sZMYN4nEWzCi5nMFyn4h2/57s9Vx3MVodQ8888/FxNSooj iIJeEa6y658xap5GFauho53CphSoAYOCcIpMHtE9HO/K2xYLrhMOii4E4+tOrcjNclFu rkdlMxyGABTS76YrmNfpvrrW61yDgCFd/r2o9ChUF2SpzcmYuHhg9dkCTwB2d/lijbFO +t4kMB5EUnQFtnUd4pGMWiqHSrQ7H7YDDkjdtvTXFfiqkfImNDcGcwWK0sv+PQHiRcL2 5DIw== MIME-Version: 1.0 X-Received: by 10.50.135.8 with SMTP id po8mr1757487igb.23.1359045369774; Thu, 24 Jan 2013 08:36:09 -0800 (PST) Received: by 10.64.37.70 with HTTP; Thu, 24 Jan 2013 08:36:09 -0800 (PST) X-Originating-IP: [72.80.83.148] In-Reply-To: <20130124143224.GC18233@arm.com> References: <20130116175716.29147.15348.stgit@ubuntu> <20130116175734.29147.19552.stgit@ubuntu> <20130124143224.GC18233@arm.com> Date: Thu, 24 Jan 2013 11:36:09 -0500 Message-ID: Subject: Re: [PATCH v6 02/15] ARM: Section based HYP idmap From: Christoffer Dall To: Catalin Marinas X-Gm-Message-State: ALoCoQkM26ANFxRU4SG0fps+PQCnpeWwRgZWzwsx+YgHO5gzQ6pJFb4azIE4fx+xacytZW2hl4Ji X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130124_113610_499618_83A6BB0E X-CRM114-Status: GOOD ( 14.73 ) 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 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 #define L_PTE_HYP L_PTE_USER #ifndef __ASSEMBLY__ 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; }