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: 2034001 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 56A913FD56 for ; Thu, 24 Jan 2013 17:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753288Ab3AXRKF (ORCPT ); Thu, 24 Jan 2013 12:10:05 -0500 Received: from mail-ia0-f180.google.com ([209.85.210.180]:44562 "EHLO mail-ia0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778Ab3AXRKD (ORCPT ); Thu, 24 Jan 2013 12:10:03 -0500 X-Greylist: delayed 329 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Jan 2013 12:10:03 EST Received: by mail-ia0-f180.google.com with SMTP id f27so5038167iae.39 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=cDWmjJyZjUb/s2SP4rEQb0im64EA05xTpiVT3RR8+ZP9hW/usKURF0cwQGfFD320J7 /fHfpVTiCuwCrAH10HlY2x9H68T4N3P93ZRqYxVC5rSF8psOxCee73lLe/eVcrZb7I7H EPmBx6JPEb5eFuaH7S0yi6EKm7Q45412SFuwW/ECNUGAEoVmsyCOVwuzssXI2oLeNybe Pjjs2cnY5vqAOTMIBSoxMWUel1DP6MT8RERSO4aApN+/fvkHrSh8T2/Uekl4tjvDZneA CaoaVUAhocb0NAqpAUedsGUxNZWsox1jPQgR2GZgWNfd/yqYP0NL7EN+DrrDpx357FVI MjbQ== 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 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: ALoCoQkRrc66+A41Iol6shcETVlGByW7ARKlCGWbaockPMG5/WyB4SFKZFemVTj6KmBHMrGSWEAV Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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 -- 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/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; }