From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6DA3C43381 for ; Fri, 15 Feb 2019 13:09:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACCDF218AC for ; Fri, 15 Feb 2019 13:09:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437021AbfBONJw (ORCPT ); Fri, 15 Feb 2019 08:09:52 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59452 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727524AbfBONJw (ORCPT ); Fri, 15 Feb 2019 08:09:52 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5EA9EA78; Fri, 15 Feb 2019 05:09:51 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3BE993F575; Fri, 15 Feb 2019 05:09:45 -0800 (PST) Date: Fri, 15 Feb 2019 13:09:42 +0000 From: Mark Rutland To: Khalid Aziz Cc: juergh@gmail.com, tycho@tycho.ws, jsteckli@amazon.de, ak@linux.intel.com, torvalds@linux-foundation.org, liran.alon@oracle.com, keescook@google.com, akpm@linux-foundation.org, mhocko@suse.com, catalin.marinas@arm.com, will.deacon@arm.com, jmorris@namei.org, konrad.wilk@oracle.com, Tycho Andersen , deepa.srinivasan@oracle.com, chris.hyser@oracle.com, tyhicks@canonical.com, dwmw@amazon.co.uk, andrew.cooper3@citrix.com, jcm@redhat.com, boris.ostrovsky@oracle.com, kanth.ghatraju@oracle.com, oao.m.martins@oracle.com, jmattson@google.com, pradeep.vincent@oracle.com, john.haxby@oracle.com, tglx@linutronix.de, kirill.shutemov@linux.intel.com, hch@lst.de, steven.sistare@oracle.com, labbott@redhat.com, luto@kernel.org, dave.hansen@intel.com, peterz@infradead.org, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v8 08/14] arm64/mm: disable section/contiguous mappings if XPFO is enabled Message-ID: <20190215130942.GD53520@lakrids.cambridge.arm.com> References: <0b9624b6c1fe5a31d73a6390e063d551bfebc321.1550088114.git.khalid.aziz@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b9624b6c1fe5a31d73a6390e063d551bfebc321.1550088114.git.khalid.aziz@oracle.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Feb 13, 2019 at 05:01:31PM -0700, Khalid Aziz wrote: > From: Tycho Andersen > > XPFO doesn't support section/contiguous mappings yet, so let's disable it > if XPFO is turned on. > > Thanks to Laura Abbot for the simplification from v5, and Mark Rutland for > pointing out we need NO_CONT_MAPPINGS too. > > CC: linux-arm-kernel@lists.infradead.org > Signed-off-by: Tycho Andersen > Reviewed-by: Khalid Aziz There should be no point in this series where it's possible to enable a broken XPFO. Either this patch should be merged into the rest of the arm64 bits, or it should be placed before the rest of the arm64 bits. That's a pre-requisite for merging, and it significantly reduces the burden on reviewers. In general, a patch series should bisect cleanly. Could you please restructure the series to that effect? Thanks, Mark. > --- > arch/arm64/mm/mmu.c | 2 +- > include/linux/xpfo.h | 4 ++++ > mm/xpfo.c | 6 ++++++ > 3 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > index d1d6601b385d..f4dd27073006 100644 > --- a/arch/arm64/mm/mmu.c > +++ b/arch/arm64/mm/mmu.c > @@ -451,7 +451,7 @@ static void __init map_mem(pgd_t *pgdp) > struct memblock_region *reg; > int flags = 0; > > - if (debug_pagealloc_enabled()) > + if (debug_pagealloc_enabled() || xpfo_enabled()) > flags = NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS; > > /* > diff --git a/include/linux/xpfo.h b/include/linux/xpfo.h > index 1ae05756344d..8b029918a958 100644 > --- a/include/linux/xpfo.h > +++ b/include/linux/xpfo.h > @@ -47,6 +47,8 @@ void xpfo_temp_map(const void *addr, size_t size, void **mapping, > void xpfo_temp_unmap(const void *addr, size_t size, void **mapping, > size_t mapping_len); > > +bool xpfo_enabled(void); > + > #else /* !CONFIG_XPFO */ > > static inline void xpfo_kmap(void *kaddr, struct page *page) { } > @@ -69,6 +71,8 @@ static inline void xpfo_temp_unmap(const void *addr, size_t size, > } > > > +static inline bool xpfo_enabled(void) { return false; } > + > #endif /* CONFIG_XPFO */ > > #endif /* _LINUX_XPFO_H */ > diff --git a/mm/xpfo.c b/mm/xpfo.c > index 92ca6d1baf06..150784ae0f08 100644 > --- a/mm/xpfo.c > +++ b/mm/xpfo.c > @@ -71,6 +71,12 @@ struct page_ext_operations page_xpfo_ops = { > .init = init_xpfo, > }; > > +bool __init xpfo_enabled(void) > +{ > + return !xpfo_disabled; > +} > +EXPORT_SYMBOL(xpfo_enabled); > + > static inline struct xpfo *lookup_xpfo(struct page *page) > { > struct page_ext *page_ext = lookup_page_ext(page); > -- > 2.17.1 >