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: 2033871 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 45F0C3FDBC for ; Thu, 24 Jan 2013 16:36:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751749Ab3AXQgL (ORCPT ); Thu, 24 Jan 2013 11:36:11 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:45154 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751110Ab3AXQgK (ORCPT ); Thu, 24 Jan 2013 11:36:10 -0500 Received: by mail-ob0-f172.google.com with SMTP id ta17so4804118obb.17 for ; Thu, 24 Jan 2013 08:36:09 -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=Lrr5aBW79MLRG3TCEToTt1FhPqmPmGvMiccsTBGyuNkc2Z7KinO+53ud7DnijLgDTJ psXjzyQ6/MsjpAW2wMj/uET8/4qb3vYu/UtIK1K5JO0Wb5rcoxmZNx66/oAW74p2cz1X d45ysF/4HhvxoyPQ4t4AwYwnviepNjaLnEjmKJFHMIWe0pADndsFZ7ns+4PeBGXBW4RO 4Gsv+lI+B10jBEWV4VBeMOV9xjLfxJUCrjfzU5M4r2iWJ4esFeZVb6tdNOR577lnEema R7nmdclwzxwzNlFjfQxIHuVQuQTXCOrPtK544HzXNNreA92yqUnqpCuJIe2apVqsAKC3 cpEw== 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 Cc: "kvm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , Marc Zyngier , Marcelo Tosatti , Will Deacon X-Gm-Message-State: ALoCoQkO8ugd4RqpuAGbOGuIGqEKFXshuok2SJW0Goux31WsBx9Gy7ixAQ1DDdoJS4IqwznvKV84 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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? --- 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/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; }