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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no 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 DD1EBC433DF for ; Fri, 21 Aug 2020 20:14:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9EE06207DE for ; Fri, 21 Aug 2020 20:14:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jsm0Siwj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EE06207DE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 16BFD8D007D; Fri, 21 Aug 2020 16:14:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 11EF68D0002; Fri, 21 Aug 2020 16:14:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0317D8D007D; Fri, 21 Aug 2020 16:14:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0025.hostedemail.com [216.40.44.25]) by kanga.kvack.org (Postfix) with ESMTP id E2CB98D0002 for ; Fri, 21 Aug 2020 16:14:24 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9EDBA824559C for ; Fri, 21 Aug 2020 20:14:24 +0000 (UTC) X-FDA: 77175678048.13.prose79_22001022703c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 725FD18063C69 for ; Fri, 21 Aug 2020 20:14:24 +0000 (UTC) X-HE-Tag: prose79_22001022703c X-Filterd-Recvd-Size: 3294 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 20:14:24 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AEE02207CD; Fri, 21 Aug 2020 20:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598040863; bh=GIZSv+n11Fktxzw4XltsqI4m6vkx8INTDFrt/8602bc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Jsm0SiwjyjLdaC9x30KSU052qwlMNfDxNbp/v2GTQ314YIOfB5mn0PNyo3a5HyfAT 4sANyMs+iVHal+mEKYqfPdgxvyiLDgv11V+6Lbb/SF/R9PYsMREn8gTcrgWQaSROWb u9xVLheHbRwcaiQ0OLEd29483GS1ksAQUXUfNqp0= Date: Fri, 21 Aug 2020 13:14:22 -0700 From: Andrew Morton To: Nicholas Piggin Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron , Christoph Hellwig , Christophe Leroy , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Subject: Re: [PATCH v6 05/12] mm: HUGE_VMAP arch support cleanup Message-Id: <20200821131422.110abb1a0c0b6a9d378b0e48@linux-foundation.org> In-Reply-To: <20200821151216.1005117-6-npiggin@gmail.com> References: <20200821151216.1005117-1-npiggin@gmail.com> <20200821151216.1005117-6-npiggin@gmail.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 725FD18063C69 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Sat, 22 Aug 2020 01:12:09 +1000 Nicholas Piggin wrote: > This changes the awkward approach where architectures provide init > functions to determine which levels they can provide large mappings for, > to one where the arch is queried for each call. > > This removes code and indirection, and allows constant-folding of dead > code for unsupported levels. > > This also adds a prot argument to the arch query. This is unused > currently but could help with some architectures (e.g., some powerpc > processors can't map uncacheable memory with large pages). > > --- a/arch/arm64/include/asm/vmalloc.h > +++ b/arch/arm64/include/asm/vmalloc.h > @@ -1,4 +1,12 @@ > #ifndef _ASM_ARM64_VMALLOC_H > #define _ASM_ARM64_VMALLOC_H > > +#include > + > +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP > +bool arch_vmap_p4d_supported(pgprot_t prot); > +bool arch_vmap_pud_supported(pgprot_t prot); > +bool arch_vmap_pmd_supported(pgprot_t prot); > +#endif Moving these out of generic code and into multiple arch headers is unfortunate. Can we leave them in include/linux/somewhere? And remove the ifdefs, if so inclined - they just move the build error from link-time to compile-time, and such an error shouldn't occur!