From patchwork Sat Dec 5 06:57:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11952955 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,URIBL_BLOCKED, 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 993C0C4361A for ; Sat, 5 Dec 2020 06:58:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3EAA222D2A for ; Sat, 5 Dec 2020 06:58:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EAA222D2A 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 CC2196B0071; Sat, 5 Dec 2020 01:58:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C73496B0072; Sat, 5 Dec 2020 01:58:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B89B16B0073; Sat, 5 Dec 2020 01:58:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 99E726B0071 for ; Sat, 5 Dec 2020 01:58:14 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 680A01EE6 for ; Sat, 5 Dec 2020 06:58:14 +0000 (UTC) X-FDA: 77558324508.22.oil67_0417ded273cb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id 4321418038E60 for ; Sat, 5 Dec 2020 06:58:14 +0000 (UTC) X-HE-Tag: oil67_0417ded273cb X-Filterd-Recvd-Size: 5605 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Sat, 5 Dec 2020 06:58:13 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id v3so4365305plz.13 for ; Fri, 04 Dec 2020 22:58:13 -0800 (PST) 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=HiUfAFVtYQfdJFI+mGar/loPm26LbyhdUt8nmYytWQQ=; b=DxmZPA3yAfjPLXLMP04XS6JXFdsWLGTS01CQhH8sB/zsK9XTcQVwrq4kbXx7YdojRK yGn64NeViNWYWiFixEYhcMj2muh0L0+uifTZxha4vibt+CbN5dDPstR/oH88Rdx2TXe1 DPmtfYXy/yZqSoldqCGJe1d5yEgHX5VJZUvx34k38zBxcsWESi3TXgbQCCzU5FCHtmfX uvPDEqFMF5e6fcGCiv+1x0NHOXC6ULqNghY5MidMVepomjFC29csup82rx8jeus4x4iP AlnMWPJveZxBzAUtYmMKBg+6/Zy8SqNYCYqCD2AW793yFHcIhGjC4ULukG3zt76F5D01 hmvg== 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=HiUfAFVtYQfdJFI+mGar/loPm26LbyhdUt8nmYytWQQ=; b=B7IeRDm+Vp2yXjVtdaGnO50AHyQ1lN8zdRHT9fEjgCAwfCpZ6o+1DOMVeRGFhUf7NP SBkgkc3uXPTv60oXvfkE6hdmjSNM9Iglv/n9rsJR+6vc1Emt1Q+8f+dnTkN/3tUkENSq F4/3lZg1lv+C8n+gV0+lDWQkrLygJfe12PBbGycET/ByLv8XnksaLCUkSlInDqbfkeOE VXq7I1kIWAxm2lYbGnEtSyqPeS4777k8XvRFcYK5KQx+igJ6y76pATxilmcK/4dMroez G8VlHZ/QlCTXaLNzhBjwmfbEFzPhQ6uftvDY1drride5K/D8WEBhnglA0pnV0QzW+T/F 6Mlg== X-Gm-Message-State: AOAM533in40kz884+GriNF0mellYNlSUy7hSOenXVkfoYCl//h1DSjsH 5c15kymRT+Fby4bVfJvnAvJ1uwp2MI7CcA== X-Google-Smtp-Source: ABdhPJyvHIRuemZhXud4eIE3YEqh2cLPgp8Qkm3Pre2khvi9AhP4Lk22USojlqZWMBSIeZDSMx7xxA== X-Received: by 2002:a17:90b:253:: with SMTP id fz19mr7455121pjb.195.1607151492973; Fri, 04 Dec 2020 22:58:12 -0800 (PST) Received: from bobo.ozlabs.ibm.com ([1.129.145.238]) by smtp.gmail.com with ESMTPSA id a14sm1110848pfl.141.2020.12.04.22.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 22:58:12 -0800 (PST) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron , Christoph Hellwig , Christophe Leroy , Rick Edgecombe , Michael Ellerman Subject: [PATCH v9 06/12] powerpc: inline huge vmap supported functions Date: Sat, 5 Dec 2020 16:57:19 +1000 Message-Id: <20201205065725.1286370-7-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205065725.1286370-1-npiggin@gmail.com> References: <20201205065725.1286370-1-npiggin@gmail.com> MIME-Version: 1.0 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 ab426fc0cd4b..de6b558dc187 100644 --- a/arch/powerpc/mm/book3s64/radix_pgtable.c +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c @@ -1121,22 +1121,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; @@ -1220,8 +1204,3 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) return 1; } - -bool arch_vmap_p4d_supported(pgprot_t prot) -{ - return false; -}