From patchwork Wed Mar 17 06:23:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 12144891 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 38431C433DB for ; Wed, 17 Mar 2021 06:25:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D0D2164F8C for ; Wed, 17 Mar 2021 06:25:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0D2164F8C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 670246B007E; Wed, 17 Mar 2021 02:25:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 646946B0080; Wed, 17 Mar 2021 02:25:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E8386B0081; Wed, 17 Mar 2021 02:25:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id 303CD6B007E for ; Wed, 17 Mar 2021 02:25:14 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E80838249980 for ; Wed, 17 Mar 2021 06:25:13 +0000 (UTC) X-FDA: 77928378906.03.FFDBA34 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf07.hostedemail.com (Postfix) with ESMTP id 77916A0009E3 for ; Wed, 17 Mar 2021 06:25:13 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id e2so269417pld.9 for ; Tue, 16 Mar 2021 23:25:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6FRU9caWwWjvnrqszVqRsss5Upxnc33B3OfV8qLPoO8=; b=acOv1nNHq0DKxAmKf1vBi80AyxUYmYRKTh2Ey93TwUyRdkZCqWMNbWoGWU+5MekJGP bkdrfYR8csV+POZ7R2VaahbTBabix8QECkD93CNRXZRKrtJaqACa02+ligl4FVBcRJYf RjRL9pmF/JxgFVriXcGsY0lFBXYliNoOMi+qWVw74A0UwwlZXrE3SMGwlLdKOhtGwxyH 9lj/12FT4SHFaQn2nzfmOjdPxQPBiXUpk87Lrk7+lEBO/a2gWXWdccsTtyOdbLyQHQyx BvmaRP5WJYWW86mzlLmFL8NBGAmVMxsp5jpPJPAvUskm1r4Xns9NfRLajx7uwAQSirTg 9ZpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6FRU9caWwWjvnrqszVqRsss5Upxnc33B3OfV8qLPoO8=; b=WupZWUpBBdfrVOGek2lDGmSxlFioOmVK3qTudn/a5VvqNYImMv9qHkf95r0LAhqpcE j2m5Zj6x+hwWBsZpPMSc+EfXXeDb6cfHZUoujBtNDgn47AkSWU7IB6Lrjwe54AhlOjjB YHXrBcwE7bQHGCz7HVZOdYkNRIT3Jw9vGe6P2OhlEiYuvjRndqhISiDetLk4OdbAbx1b svJ00Ubh9mftRMpBqeB35Zl5UBLgiTFYgebi/oYV+cJiaVRl3gktCTXiilA5SULdHAAe XG9P0v6NX4KqXLEScwClfwGmLPMY0Id7W4NJzHIsjC3QzX08qzP4X374FxFffckGlDAF So/w== X-Gm-Message-State: AOAM532HtpLswTzC4mog4MNQy9FrlsxSrd5J1YVDEDHWxHtxzSnUkP7A JlFhOTP/ylAh9xj+0fNCfPZdxQLoTKY= X-Google-Smtp-Source: ABdhPJwdKgWAmNPrq81aNVKAYJ1WAYd7AWSS4jrdMlA13JJ+pQXBcMpUBMbODVrBwNM0aQs0yHN98w== X-Received: by 2002:a17:90b:686:: with SMTP id m6mr2855807pjz.26.1615962312311; Tue, 16 Mar 2021 23:25:12 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (58-6-239-121.tpgi.com.au. [58.6.239.121]) by smtp.gmail.com with ESMTPSA id s19sm17959620pfh.168.2021.03.16.23.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 23:25:11 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Jonathan Cameron , Christoph Hellwig , Christophe Leroy , Rick Edgecombe , Ding Tianhong , linuxppc-dev@lists.ozlabs.org, Michael Ellerman Subject: [PATCH v13 07/14] powerpc: inline huge vmap supported functions Date: Wed, 17 Mar 2021 16:23:55 +1000 Message-Id: <20210317062402.533919-8-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210317062402.533919-1-npiggin@gmail.com> References: <20210317062402.533919-1-npiggin@gmail.com> MIME-Version: 1.0 X-Stat-Signature: kzfbt3kwkki3m66i1gu1mhykewtxrpb8 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 77916A0009E3 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=mail-pl1-f171.google.com; client-ip=209.85.214.171 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615962313-17141 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: This allows unsupported levels to be constant folded away, and so p4d_free_pud_page can be removed because it's no longer linked to. Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/vmalloc.h | 19 ++++++++++++++++--- arch/powerpc/mm/book3s64/radix_pgtable.c | 21 --------------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/arch/powerpc/include/asm/vmalloc.h b/arch/powerpc/include/asm/vmalloc.h index 105abb73f075..3f0c153befb0 100644 --- a/arch/powerpc/include/asm/vmalloc.h +++ b/arch/powerpc/include/asm/vmalloc.h @@ -1,12 +1,25 @@ #ifndef _ASM_POWERPC_VMALLOC_H #define _ASM_POWERPC_VMALLOC_H +#include #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); +static inline bool arch_vmap_p4d_supported(pgprot_t prot) +{ + return false; +} + +static inline bool arch_vmap_pud_supported(pgprot_t prot) +{ + /* HPT does not cope with large pages in the vmalloc area */ + return radix_enabled(); +} + +static inline bool arch_vmap_pmd_supported(pgprot_t prot) +{ + return radix_enabled(); +} #endif #endif /* _ASM_POWERPC_VMALLOC_H */ diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c index 743807fc210f..8da62afccee5 100644 --- a/arch/powerpc/mm/book3s64/radix_pgtable.c +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c @@ -1082,22 +1082,6 @@ void radix__ptep_modify_prot_commit(struct vm_area_struct *vma, set_pte_at(mm, addr, ptep, pte); } -bool arch_vmap_pud_supported(pgprot_t prot) -{ - /* HPT does not cope with large pages in the vmalloc area */ - return radix_enabled(); -} - -bool arch_vmap_pmd_supported(pgprot_t prot) -{ - return radix_enabled(); -} - -int p4d_free_pud_page(p4d_t *p4d, unsigned long addr) -{ - return 0; -} - int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot) { pte_t *ptep = (pte_t *)pud; @@ -1181,8 +1165,3 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) return 1; } - -bool arch_vmap_p4d_supported(pgprot_t prot) -{ - return false; -}