Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753516AbbGXQPG (ORCPT ); Fri, 24 Jul 2015 12:15:06 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:19362 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbbGXQPE convert rfc822-to-8bit (ORCPT ); Fri, 24 Jul 2015 12:15:04 -0400 Date: Fri, 24 Jul 2015 17:15:00 +0100 From: Catalin Marinas To: "Jonathan (Zhixiong) Zhang" Cc: Will Deacon , "fu.wei@linaro.org" , "al.stone@linaro.org" , "bp @ alien8 . de Matt Fleming" , "rjw@rjwysocki.net" , "linux-kernel@vger.kernel.org" , "linaro-acpi@lists.linaro.org" Subject: Re: [PATCH V7 3/5] arm64: mm: add PROT_DEVICE_nGnRnE and PROT_NORMAL_WT Message-ID: <20150724161500.GV3550@e104818-lin.cambridge.arm.com> References: <1437515960-16812-1-git-send-email-zjzhang@codeaurora.org> <1437515960-16812-4-git-send-email-zjzhang@codeaurora.org> MIME-Version: 1.0 In-Reply-To: <1437515960-16812-4-git-send-email-zjzhang@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-OriginalArrivalTime: 24 Jul 2015 16:15:00.0455 (UTC) FILETIME=[E3FB8770:01D0C62B] X-MC-Unique: bmf485z3S2W7zKs0tUcebg-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2029 Lines: 53 On Tue, Jul 21, 2015 at 10:59:18PM +0100, Jonathan (Zhixiong) Zhang wrote: > From: "Jonathan (Zhixiong) Zhang" > > UEFI spec 2.5 section 2.3.6.1 defines that EFI_MEMORY_[UC|WC|WT|WB] are > possible EFI memory types for AArch64. Each of those EFI memory types > is mapped to a corresponding AArch64 memory type. So we need to define > PROT_DEVICE_nGnRnE and PROT_NORMWL_WT. > > MT_NORMAL_WT is defined, and its encoding is added to MAIR_EL1 when > initializing cpu. > > Change-Id: I20ac71ddf74c17e41769ecbb5f8c60eeefbb398a > Signed-off-by: Jonathan (Zhixiong) Zhang I'll let the EFI guys to comment on whether these are needed, what for (we could probably live just fine only with Device nGnRE and Normal NC). > #define PROT_SECT_DEVICE_nGnRE (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_DEVICE_nGnRE)) > diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S > index 838266f5b056..23e265d732f8 100644 > --- a/arch/arm64/mm/proc.S > +++ b/arch/arm64/mm/proc.S > @@ -294,7 +294,7 @@ ENTRY(__cpu_setup) > msr cpacr_el1, x0 // Enable FP/ASIMD > msr mdscr_el1, xzr // Reset mdscr_el1 > /* > - * Memory region attributes for LPAE: > + * Memory region attributes for LPAE and EFI: LPAE refers to the page table format, the comment probably inherited from arch/arm. EFI means a completely different thing, so please remove it. > * > * n = AttrIndx[2:0] > * n MAIR > @@ -303,12 +303,14 @@ ENTRY(__cpu_setup) > * DEVICE_GRE 010 00001100 > * NORMAL_NC 011 01000100 > * NORMAL 100 11111111 > + * NORMAL_WT 101 10111011 I don't think the write allocation hint makes much sense for WT memory (though it shouldn't cause issues either). Just use 10101010. -- Catalin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/