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: 12144907 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.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,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=unavailable 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 0FF8EC433DB for ; Wed, 17 Mar 2021 06:27:20 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9105F64F6B for ; Wed, 17 Mar 2021 06:27:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9105F64F6B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UAm5M9oukrgE7FMtnApm8vqoYawCO3Xo2FiSvNvs4XE=; b=cLR6DBfmxZgD8grmbWyL5+iyA 03qxtkLW/hyQlBXuH6Plz4oLRW1UY55mSaPbCuvkAuStvsWeNMH6rKk/JpOoeA/LbL8oP8x+mjnZ/ wyLtyJz1JLysVhpbuIeKiA6ldJaXZafajQQ+CxpvjbCzzvELctR8JceXasgW5knw7LrXU+CgzXQzZ ka/YFQuZWJAYIH3jW8ejRYfTmcfjhKvcYDnm4tyLvqwz+r2W76oRQcmiB2LSjroScvCNK1hgFW/KC qpqvU6+RXGTEAhtsCQOA28WUkZRG7nPLi0ZCYNbrB055tXrSCYCFE0AczopPw3W03w8I0RtY2MAzg 8nuOHNJ3A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lMPcX-002YT0-5h; Wed, 17 Mar 2021 06:25:29 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lMPcN-002YRA-Qq for linux-arm-kernel@lists.infradead.org; Wed, 17 Mar 2021 06:25:21 +0000 Received: by mail-pl1-x62d.google.com with SMTP id q12so282811plr.1 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=U5YDVB0jPIQRqNn4NFuCQ2DsQYsjQcUQNELBCJijXWJWPe4z1v1rVMszPOBIhv2dsg hFGaQR3k9b/aL6hL6WPvNHGYzN5Iq8tRRZPO6ulOuDroygfuxgkAZHepaezDNtsypmWM kVTBoGtP3QzHIXBI0tCJXiRpsyp3fte0HeZ4TOBseauH9l8CDwIHI50yR29b2mRxB2eL DCRUfJU25PHZ0o2AV9hqD8hM/M1Kyag9MD7eqe/8cctaN5XvoWEegh3VmbTv0bAizVSE PAcBMReW4zEJ3JNG4iMbAWHPd/UQ+/ohEDFRFxYEjIhu/r69apTDbmmN+Ao8Moi0zeDT 1plg== X-Gm-Message-State: AOAM531s4eWxuTnpsB60gnrRR/zw5EQ4WdaAtI5FTxlQFFmXJpJqtHsK ALNWx4kpK3468CZgVbaFzKI= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210317_062520_014038_A56B39F8 X-CRM114-Status: GOOD ( 12.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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) {