From patchwork Wed Mar 17 06:23:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 12144893 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 AAB6BC433DB for ; Wed, 17 Mar 2021 06:25:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3D03764F6B for ; Wed, 17 Mar 2021 06:25:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D03764F6B 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 C62B86B0081; Wed, 17 Mar 2021 02:25:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C392D6B0082; Wed, 17 Mar 2021 02:25:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ADA318D0001; Wed, 17 Mar 2021 02:25:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0159.hostedemail.com [216.40.44.159]) by kanga.kvack.org (Postfix) with ESMTP id 94A866B0081 for ; Wed, 17 Mar 2021 02:25:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4E668815B for ; Wed, 17 Mar 2021 06:25:20 +0000 (UTC) X-FDA: 77928379200.21.A636F7F Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by imf26.hostedemail.com (Postfix) with ESMTP id E58AA40001DE for ; Wed, 17 Mar 2021 06:25:19 +0000 (UTC) Received: by mail-pj1-f52.google.com with SMTP id kr3-20020a17090b4903b02900c096fc01deso766539pjb.4 for ; Tue, 16 Mar 2021 23:25:19 -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=dj69ry3EYtQyAiX5oUHvY3dqq56j/eubUdI+6FA7GRk=; b=QXilW1y5Pw7owXm0BE0y5uqNYBU68jc9dy9LWT4Q4tnq+6acQ1CvSma676a1voPjVH /sChBOfCbIiES09oErIAYuIT1mjp1kTIdxSBNw+b4hbER9qN1QM3x3Dzuv4QutDlsxce zQmzk0jarXecDdnLDWz2Vpjng98h36IzQGxfzucAjGa5gpaRpWVQ6cKp+LBSwtVgMpN8 O9MSzlDfpIO4cGhMJQh0KgaT4bhTIpckhgdzgEh8eLjcmuzcSke0yvSo3Mscfpmm+dJ6 Sc34jJ+r9GUXSsCPtG6KuV7CoSuL2LOyFVnmqE4DgNTdNJ0QgVg3sv15OxNUPwyMqrRW rPSg== 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=dj69ry3EYtQyAiX5oUHvY3dqq56j/eubUdI+6FA7GRk=; b=hQ7GuSYYwc7fddKnRUhI1B32/ppn8/Bo1ZBVfXA/KLjYWmZS13Uo/aHjHvNbLqk0n2 emjSde3Gx8hWohihQC7usFIFGy03R5lcgrKLIyEYGmR2kwBMd/tiF+xQbPXmD2eBbguD immbm7qximQq5Muv1s3sj3FbnQucZgKIe6CoZbQPBDOou5+vsrbScR4cKGTI5Emrdpok re6tc+rVfMm/XtER1tPoHzLMekQ3fpzzyfKkTVdviqGLHNIogNdoAo59kD6nfzjyN/PQ McTUztckanBhgS2r7nQFhCYFf6Rt0bmc7DHlGtF3B2Z3p9Fl3D/HlkYP9YzfCtjbaj/I ztMg== X-Gm-Message-State: AOAM533HSrrKdv1W78YEvm1VBTdUVKzH7JMD7FnbaJ0lE5xYlqtBYQYq HeZJigqSOhz+J+uOfQafGFkrEg7wOgk= X-Google-Smtp-Source: ABdhPJzKKmiML9ahyhDjVcYprqOolbC+HJd06JEicV3PL6AmH054w47Hun27ybXyvgmde5bmGpvF4g== X-Received: by 2002:a17:90a:1b08:: with SMTP id q8mr2789442pjq.203.1615962318728; Tue, 16 Mar 2021 23:25:18 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 23:25:18 -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 , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: [PATCH v13 08/14] arm64: inline huge vmap supported functions Date: Wed, 17 Mar 2021 16:23:56 +1000 Message-Id: <20210317062402.533919-9-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-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: E58AA40001DE X-Stat-Signature: oxmwqg4i3zjjzw4sn4biqzjesihxkbop Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf26; identity=mailfrom; envelope-from=""; helo=mail-pj1-f52.google.com; client-ip=209.85.216.52 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615962319-458177 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: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Acked-by: Catalin Marinas Signed-off-by: Nicholas Piggin --- arch/arm64/include/asm/vmalloc.h | 23 ++++++++++++++++++++--- arch/arm64/mm/mmu.c | 26 -------------------------- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/arch/arm64/include/asm/vmalloc.h b/arch/arm64/include/asm/vmalloc.h index 597b40405319..fc9a12d6cc1a 100644 --- a/arch/arm64/include/asm/vmalloc.h +++ b/arch/arm64/include/asm/vmalloc.h @@ -4,9 +4,26 @@ #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) +{ + /* + * Only 4k granule supports level 1 block mappings. + * SW table walks can't handle removal of intermediate entries. + */ + return IS_ENABLED(CONFIG_ARM64_4K_PAGES) && + !IS_ENABLED(CONFIG_PTDUMP_DEBUGFS); +} + +static inline bool arch_vmap_pmd_supported(pgprot_t prot) +{ + /* See arch_vmap_pud_supported() */ + return !IS_ENABLED(CONFIG_PTDUMP_DEBUGFS); +} #endif #endif /* _ASM_ARM64_VMALLOC_H */ diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 639b9de61b1d..1fb0035b0777 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1316,27 +1316,6 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phys, int *size, pgprot_t prot) return dt_virt; } -bool arch_vmap_p4d_supported(pgprot_t prot) -{ - return false; -} - -bool arch_vmap_pud_supported(pgprot_t prot) -{ - /* - * Only 4k granule supports level 1 block mappings. - * SW table walks can't handle removal of intermediate entries. - */ - return IS_ENABLED(CONFIG_ARM64_4K_PAGES) && - !IS_ENABLED(CONFIG_PTDUMP_DEBUGFS); -} - -bool arch_vmap_pmd_supported(pgprot_t prot) -{ - /* See arch_vmap_pud_supported() */ - return !IS_ENABLED(CONFIG_PTDUMP_DEBUGFS); -} - int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot) { pud_t new_pud = pfn_pud(__phys_to_pfn(phys), mk_pud_sect_prot(prot)); @@ -1428,11 +1407,6 @@ int pud_free_pmd_page(pud_t *pudp, unsigned long addr) return 1; } -int p4d_free_pud_page(p4d_t *p4d, unsigned long addr) -{ - return 0; /* Don't attempt a block mapping */ -} - #ifdef CONFIG_MEMORY_HOTPLUG static void __remove_pgd_mapping(pgd_t *pgdir, unsigned long start, u64 size) {