From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752509AbaHSM0p (ORCPT ); Tue, 19 Aug 2014 08:26:45 -0400 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:62795 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750997AbaHSM0o (ORCPT ); Tue, 19 Aug 2014 08:26:44 -0400 Date: Tue, 19 Aug 2014 13:26:53 +0100 From: Will Deacon To: Kees Cook Cc: "linux-kernel@vger.kernel.org" , Rob Herring , Laura Abbott , Leif Lindholm , Stephen Boyd , "msalter@redhat.com" , Rabin Vincent , Liu hua , Nikolay Borisov , Nicolas Pitre , Tomasz Figa , Doug Anderson , Jason Wessel , Catalin Marinas , Russell King - ARM Linux , "linux-arm-kernel@lists.infradead.org" , "linux-doc@vger.kernel.org" Subject: Re: [PATCH v4 2/8] ARM: expand fixmap region to 3MB Message-ID: <20140819122653.GH23128@arm.com> References: <1407949593-16121-1-git-send-email-keescook@chromium.org> <1407949593-16121-3-git-send-email-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1407949593-16121-3-git-send-email-keescook@chromium.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kees, Rob, On Wed, Aug 13, 2014 at 06:06:27PM +0100, Kees Cook wrote: > From: Rob Herring > > With commit a05e54c103b0 ("ARM: 8031/2: change fixmap mapping region to > support 32 CPUs"), the fixmap region was expanded to 2MB, but it > precluded any other uses of the fixmap region. In order to support other > uses the fixmap region needs to be expanded beyond 2MB. Fortunately, the > adjacent 1MB range 0xffe00000-0xfff00000 is availabe. > > Remove fixmap_page_table ptr and lookup the page table via the virtual > address so that the fixmap region can span more that one pmd. The 2nd > pmd is already created since it is shared with the vector page. [...] > diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c > index 45aeaaca9052..81061987ac45 100644 > --- a/arch/arm/mm/highmem.c > +++ b/arch/arm/mm/highmem.c > @@ -18,19 +18,20 @@ > #include > #include "mm.h" > > -pte_t *fixmap_page_table; > - > static inline void set_fixmap_pte(int idx, pte_t pte) > { > unsigned long vaddr = __fix_to_virt(idx); > - set_pte_ext(fixmap_page_table + idx, pte, 0); > + pte_t *ptep = pte_offset_kernel(pmd_off_k(vaddr), vaddr); > + > + set_pte_ext(ptep, pte, 0); > local_flush_tlb_kernel_page(vaddr); > } Minor comment, but we can drop the ifx parameter here now, right? It looks a bit weird having a setter/getter pair of functions where the type signatures aren't the inverse. Will From mboxrd@z Thu Jan 1 00:00:00 1970 From: will.deacon@arm.com (Will Deacon) Date: Tue, 19 Aug 2014 13:26:53 +0100 Subject: [PATCH v4 2/8] ARM: expand fixmap region to 3MB In-Reply-To: <1407949593-16121-3-git-send-email-keescook@chromium.org> References: <1407949593-16121-1-git-send-email-keescook@chromium.org> <1407949593-16121-3-git-send-email-keescook@chromium.org> Message-ID: <20140819122653.GH23128@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Kees, Rob, On Wed, Aug 13, 2014 at 06:06:27PM +0100, Kees Cook wrote: > From: Rob Herring > > With commit a05e54c103b0 ("ARM: 8031/2: change fixmap mapping region to > support 32 CPUs"), the fixmap region was expanded to 2MB, but it > precluded any other uses of the fixmap region. In order to support other > uses the fixmap region needs to be expanded beyond 2MB. Fortunately, the > adjacent 1MB range 0xffe00000-0xfff00000 is availabe. > > Remove fixmap_page_table ptr and lookup the page table via the virtual > address so that the fixmap region can span more that one pmd. The 2nd > pmd is already created since it is shared with the vector page. [...] > diff --git a/arch/arm/mm/highmem.c b/arch/arm/mm/highmem.c > index 45aeaaca9052..81061987ac45 100644 > --- a/arch/arm/mm/highmem.c > +++ b/arch/arm/mm/highmem.c > @@ -18,19 +18,20 @@ > #include > #include "mm.h" > > -pte_t *fixmap_page_table; > - > static inline void set_fixmap_pte(int idx, pte_t pte) > { > unsigned long vaddr = __fix_to_virt(idx); > - set_pte_ext(fixmap_page_table + idx, pte, 0); > + pte_t *ptep = pte_offset_kernel(pmd_off_k(vaddr), vaddr); > + > + set_pte_ext(ptep, pte, 0); > local_flush_tlb_kernel_page(vaddr); > } Minor comment, but we can drop the ifx parameter here now, right? It looks a bit weird having a setter/getter pair of functions where the type signatures aren't the inverse. Will