From patchwork Tue Feb 2 11:05:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 12061371 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 D5030C433DB for ; Tue, 2 Feb 2021 11:06:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 833C164DC3 for ; Tue, 2 Feb 2021 11:06:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 833C164DC3 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 1D9D46B0080; Tue, 2 Feb 2021 06:06:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 162F16B0082; Tue, 2 Feb 2021 06:06:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 060F06B0080; Tue, 2 Feb 2021 06:06:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id DE81F6B0080 for ; Tue, 2 Feb 2021 06:06:14 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A78EE3630 for ; Tue, 2 Feb 2021 11:06:14 +0000 (UTC) X-FDA: 77773048668.18.steam50_09079ee275ca Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 84D4D100EDBF6 for ; Tue, 2 Feb 2021 11:06:14 +0000 (UTC) X-HE-Tag: steam50_09079ee275ca X-Filterd-Recvd-Size: 6247 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 2 Feb 2021 11:06:14 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id 8so6934156plc.10 for ; Tue, 02 Feb 2021 03:06: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=0fqvAYwIAe6qA/JSpZVbQ06eMe+7hHIC7Sc9a7+Vq/o=; b=Ew7anYoUzsCcdkDZLXFJNPgKKFbi6sCOtcJGX2pvEQMezt2zeIjGg+R2rV97DUM9hR PaqMXOPH+r238OPk5ITQ0RPjyR6yL/6GAeAPQE5ISBl79MjPMS7hIe+xd53kfA3Pu7DW W4ge10bzA38Cg1fkC+JWZJP89h4jkP2ufsRvldjaPm2oDbDk7iAXpYwR6+vzdbg1F7tj d68X9e+cqe/l4dO/MOF9CmiaYZXiVfVoCQIRFpiv2Bn+8GvwL6pdUvXmAIYV+QNGD4/u vpJ8crKLT3pkNG2Iqh0qA6eOwXCDHKjBvMCpkE1so5sXtQ9kjC2WTZ2q6BU/Rvo6Kqo5 TSQA== 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=0fqvAYwIAe6qA/JSpZVbQ06eMe+7hHIC7Sc9a7+Vq/o=; b=Xd1TkUCI0iE5o4C9N2I6g1iiGmFjoP/LL5YsfM6BeAFH0siY0C0JYZN9fWgQMXy2H8 QxJ78yIPRHZrR2f4fdQMTXxUxc7nAuMHVTpJPtbXSQWKHVloTkwirzJXx06IIOLLLRSV 4b0gtf8bKNbgQKLwVhKpPCCP+KOmPPecYYm225EMYLSQTRSyQFBcdSGlYLfWGUeM6CjB ZmtcbFy7NSi5/Y7VXQMBhQ/QM7xOPVck/kBBz9shVO1GhnDrtuOaLSPGv0xactbt570D 7387f7DtBUZeuK9HTsSmc0xEHc0LAMMZwzuDv4CkANGnxUixThglFc/di4iUCnayMJNv RLtA== X-Gm-Message-State: AOAM5302zqCzCsF3K9OzQp6ApR9WBO1eKYMyKoaKOmboBgUx8tWKV0Pk Y3/H6YP/gDarY8wG2j15ANk8nVWRJR0= X-Google-Smtp-Source: ABdhPJwEywoaUK5j84T1+nbm5zee6fxaujESGdsYB3RA5gho5MzJxB+eCjX6lQcCnsBJZGxQQVpuKw== X-Received: by 2002:a17:902:684c:b029:e1:902a:7d67 with SMTP id f12-20020a170902684cb02900e1902a7d67mr1120466pln.22.1612263972865; Tue, 02 Feb 2021 03:06:12 -0800 (PST) Received: from bobo.ozlabs.ibm.com (60-242-11-44.static.tpgi.com.au. [60.242.11.44]) by smtp.gmail.com with ESMTPSA id g19sm3188979pfk.113.2021.02.02.03.06.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 03:06: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, Jonathan Cameron , Christoph Hellwig , Christophe Leroy , Rick Edgecombe , Ding Tianhong , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: [PATCH v12 08/14] arm64: inline huge vmap supported functions Date: Tue, 2 Feb 2021 21:05:09 +1000 Message-Id: <20210202110515.3575274-9-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210202110515.3575274-1-npiggin@gmail.com> References: <20210202110515.3575274-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: 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 1613d290cbd1..ab9ba7c36dae 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1313,27 +1313,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)); @@ -1425,11 +1404,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) {