From patchwork Sat Nov 28 15:25:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11937565 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 9B3BDC63697 for ; Sat, 28 Nov 2020 15:26:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 17A5F24682 for ; Sat, 28 Nov 2020 15:26:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A3gGRu5d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 17A5F24682 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 B28E26B0072; Sat, 28 Nov 2020 10:26:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AD9916B0073; Sat, 28 Nov 2020 10:26:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9EF756B0074; Sat, 28 Nov 2020 10:26:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id 89C266B0072 for ; Sat, 28 Nov 2020 10:26:41 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4A3CC181AEF31 for ; Sat, 28 Nov 2020 15:26:41 +0000 (UTC) X-FDA: 77534204202.18.joke69_3317fa727391 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 20712100ED0FE for ; Sat, 28 Nov 2020 15:26:41 +0000 (UTC) X-HE-Tag: joke69_3317fa727391 X-Filterd-Recvd-Size: 5574 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Sat, 28 Nov 2020 15:26:40 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id q10so7065868pfn.0 for ; Sat, 28 Nov 2020 07:26:40 -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=A3gGRu5dqYV4wlZ1HSMJuyRU2KVVwSna1s3allWsCrZSZpCden2jSG3fkW0rG9vz/j OtwCPxKAT8km/uQ1MKkUTu+QQDOSRZz9Hzvlp84CtqVqt2QaW3W+BXA8nw8oS42FCk3D Azmf7mgnir2eebHu/lAGtKDiTTWUG2syQoNQrH+d1khykwyjooZsbc2r3TF2hSyHQIhm 3tDJdb7yepKfdD5AnW43ThT9SNKtq6CeOzsAebOHgQdq/JsCqQdfzhZHOEQjmjzL0m9l c+psqyyU7shRB1jTsu/aoB1FFHlHZ8Dg+vWnnloIJjBpih1pKn8m0l3vYMnDVyWGh9bl jWyA== 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=PZRMeh25hlwEpIQD1pl59+TrM+nJNytZnEN4R4keZCgNEh5BQHBjE+ZeWQafSE0Z0+ wmvQ4alPaEvb2nEyuiWWV/weMF029VAntGvXd9DVgiGgKdj+An286n0yyukpapPWPQGj 1dLYGkOgdrJ+pKwOibdiIHfI50eRf5TUzY8Jc3p7sQHyqNroRypCL0E6qHrBWCHLBO/g IOHl5gskDIF8MSUZx/l8wV/XwIyny6pFSYu5jQrMDoYrnrqIASO4YuuKTtdlSFZOu49l eA1LnfrtLa/kPnON59jzHSNVz4dKhfS+VqBfnKAQUbATIQ2pqYxdlS0vIjOFMgg3RqOI AQsQ== X-Gm-Message-State: AOAM530uUGzepCVra5q/ijhYaG66IjDHn15Dzn/xV1d3qxAQQc0QLR/z TXuLp2G4GOjxiryV/X5j3XJeHUmFClo= X-Google-Smtp-Source: ABdhPJyehobbdhtJfrsGlBn/msduPYZSxJp3aAhhQmtc5CYMrltqWkZrPiWvHMpKGy2rAjgf56PwLA== X-Received: by 2002:a17:90a:a781:: with SMTP id f1mr17051655pjq.50.1606577199740; Sat, 28 Nov 2020 07:26:39 -0800 (PST) Received: from bobo.ibm.com (193-116-103-132.tpgi.com.au. [193.116.103.132]) by smtp.gmail.com with ESMTPSA id d22sm15500173pjw.11.2020.11.28.07.26.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2020 07:26:39 -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 , Michael Ellerman Subject: [PATCH v8 06/12] powerpc: inline huge vmap supported functions Date: Sun, 29 Nov 2020 01:25:53 +1000 Message-Id: <20201128152559.999540-7-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201128152559.999540-1-npiggin@gmail.com> References: <20201128152559.999540-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; -}