From patchwork Fri Aug 21 15:12:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11729757 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DFF0E109B for ; Fri, 21 Aug 2020 15:15:05 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 B8868207C3 for ; Fri, 21 Aug 2020 15:15:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IKOPt6GZ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IqkomYLy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8868207C3 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Bz0Qd71Dufn2cCbTU+/yUGEM02Ff09UyBQgzPyKqAvg=; b=IKOPt6GZB6GTOH5mc11YDeAp5 MX7tRJunBMytO9IXDOVH4zcWfVaAVczgkK5319meaTtx0tzerDV2CJc6ATATTYO9ZSPJmr1Jo7gTn x6b9W2WQprSngsnI5pQn5AD5HGKeov/NhzQkrfqBCZqHFO508oJnlmsdwKb9z+hAMgYXU7hlCsVe/ WivbwbtnKQAvPweK6rWtlZ4lfXGNIuAk9zrmOJEZM8yg1ebAHFywr/4sfTURLmPT41MK8RjP6G5/D vOs1ouM8/g2Ci3y0MpRumkHS4hDnXz5Jvo2je9ipPuZTrKGzLd5sChzf7kWghogwuKwy99hTnp4R9 yTgkxksgA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k98jB-0001bI-Gj; Fri, 21 Aug 2020 15:13:13 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k98j8-0001aH-Sr for linux-arm-kernel@lists.infradead.org; Fri, 21 Aug 2020 15:13:11 +0000 Received: by mail-pf1-x442.google.com with SMTP id r11so1192735pfl.11 for ; Fri, 21 Aug 2020 08:13:10 -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=5XA+NVPhwbbllPG3xUWDGiDWcwCyUaHTGopG9dY3tOQ=; b=IqkomYLyWOWMOqPurIrzg99tZuO52VxFInUZTbikhVRxM4PXfxkwGHmlLO+XS0zZSk Pr7Jd2rs7vQ185N1QdUaYkoZ4efSqpJzxD94EJrzKx8kIqjycx8mvql3EtLZ04XD3PAv +mN7jYy17uEBwVMXBv+3QBaSIDwxz6zgeYjlPRuBkvdkuCiXh+vxSMcls6+ydgc6gluz WkRQ9CbCHTwvp0L5Wq+43+aFGNYPR0WtTbRIskVC8QnIMlAQeaDA6mbIgiGQ3bghONDn zxSAZVTZqpMLebzKsAXqaVzCJEbINtXsTKreC3UxJIdgVmZfEImtFPVyNKgk8QoG/nxi Cnvg== 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=5XA+NVPhwbbllPG3xUWDGiDWcwCyUaHTGopG9dY3tOQ=; b=Qjk9KALF0NTmN47iFkCHfTe45pd5FCYLar4vpzakBvC0+yit9BEk8Fxx/dbebs4n7o yznEVCyt19wG38lKOjJs2wC+kz+gH0bGJ2uZlMF2khDUwQichjt4knTX8MO94LTowup3 QCuH34RUfdRppBBE3UmpLjsqvFp0g/rR8B00fSpjc3NCUP/blvX7ojKa1kPyqEy9LCvc l3TRtxOATogRKHTA5IZQ9GWXdm+35m0enFdZvx0sJe3p/A/l9P6sle2qBPtG0phFniV5 EYTcqf914aw07qc/JniOmzOjdZxoGFzOIpRIG8PaBU3oEBR/KWRIcPnjSAoPo+BamMpZ zbpg== X-Gm-Message-State: AOAM532tMYz2IKfsdcfuxoolU2doIzm19sNW2CApJ7P+0HF8bKZuY3O6 nDkLuaiqJP3+1m8YZJ4fz50= X-Google-Smtp-Source: ABdhPJwMltqvuSSQ4qdpsDYl7lU9jXM0/s7ZBmlyh9r6bV9pBXP6Cdk0H0vc9dugPEDfhsI32WoXkg== X-Received: by 2002:a63:7505:: with SMTP id q5mr2561816pgc.312.1598022788965; Fri, 21 Aug 2020 08:13:08 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (61-68-212-105.tpgi.com.au. [61.68.212.105]) by smtp.gmail.com with ESMTPSA id s8sm3126985pfc.122.2020.08.21.08.13.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 08:13:08 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Subject: [PATCH v6 07/12] arm64: inline huge vmap supported functions Date: Sat, 22 Aug 2020 01:12:11 +1000 Message-Id: <20200821151216.1005117-8-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200821151216.1005117-1-npiggin@gmail.com> References: <20200821151216.1005117-1-npiggin@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200821_111310_944684_0A8F49B9 X-CRM114-Status: GOOD ( 15.11 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [npiggin[at]gmail.com] -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, Will Deacon , Catalin Marinas , linux-kernel@vger.kernel.org, Nicholas Piggin , Christoph Hellwig , Zefan Li , Christophe Leroy , Jonathan Cameron , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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 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 9df7e0058c78..07093e148957 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -1304,27 +1304,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)); @@ -1416,11 +1395,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) {