From patchwork Fri Aug 21 15:12:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11729749 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 E7E29138C for ; Fri, 21 Aug 2020 15:14:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AAF9A2076E for ; Fri, 21 Aug 2020 15:14:06 +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="Dxuzt8Gq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAF9A2076E 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 E11EB8D0048; Fri, 21 Aug 2020 11:14:05 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DE8F88D0022; Fri, 21 Aug 2020 11:14:05 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB1BF8D0048; Fri, 21 Aug 2020 11:14:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0243.hostedemail.com [216.40.44.243]) by kanga.kvack.org (Postfix) with ESMTP id B10C88D0022 for ; Fri, 21 Aug 2020 11:14:05 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6C126362A for ; Fri, 21 Aug 2020 15:14:05 +0000 (UTC) X-FDA: 77174921250.17.gate05_3b112f02703a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 63C7218022CE3 for ; Fri, 21 Aug 2020 15:13:05 +0000 (UTC) X-Spam-Summary: 1,0,0,b0f5839786e28925,d41d8cd98f00b204,npiggin@gmail.com,,RULES_HIT:41:69:355:379:541:800:960:966:968:973:988:989:1260:1311:1314:1345:1359:1431:1437:1515:1535:1542:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:3138:3139:3140:3141:3142:3353:3865:3867:3868:3870:3872:4321:4385:4605:5007:6119:6261:6653:7514:9413:9592:10004:11026:11473:11657:11658:11914:12043:12297:12438:12517:12519:12555:12895:12986:13894:14096:14181:14394:14687:14721:21080:21444:21451:21627:21666:21990:30054,0,RBL:209.85.214.196:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yrsawyhw9hy9ffihc1m3etetf3yopy57epfzhd5zrawg36q1u1gyyp7b4iatg.gu4xc9pjbpgu9mw9rpsajt5xhh7k65xytk44nno5jxy3esmxrdmeon54oecgztg.o-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: gate05_3b112f02703a X-Filterd-Recvd-Size: 5488 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 15:13:04 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id y6so996368plk.10 for ; Fri, 21 Aug 2020 08:13:04 -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=mshGO+fS8Fvu8aEJg35ArnuOW0kj8WJXDS3j67fcQcE=; b=Dxuzt8Gq7VFN+A3EE1DxMPxeR9USeuD5Ig74qLhRJfNfR1CmVPxrcgV8gPhNHj2A8P quPQ5BBpTYZyqfVksB15bO0M5UDQGUg2/RLxDTyK+Jo40A3mOU5yASraaNxMTRw9S0OZ JN/wNNkHe44ywg52mENRYGVDjuigU4bPuvrNsGcn/ef5dP1I5n/TKYfxM9lVuHicwz6s Zw/5/ic/iqoZQf//idHiVEb0OpRo1LT4zDCNXeQ+gcZ8ESpEwAwKL9N6H+yqcJSx8YM0 URv+AuGrWbPWMx5M1EKzJeHJmDN2ARnD48B0zdNvmgnYzHz2Jn8n6nsRPZQUsqV4Q4nK axrQ== 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=mshGO+fS8Fvu8aEJg35ArnuOW0kj8WJXDS3j67fcQcE=; b=B799DFxf/AM3Wp2SgHejm2cKsmvxpWd37TbjjwGHPtx8FiGBA/dM1VspKEc3xoCqnj fvRaX1YqQ5y7uGisUOIUNv5fPbG15sWFrMcOuOmsQShkbgTR7kX8rOb3YBdrRW/a0O3O gs3PLTjIa9FumYvYh8x7GFMAQOAQiYrFMM5nIaOvScpROUh75us3WHCxLepD9UxBSLBa HJDUiK+eQvOcsqShwf2oU/g2jyHhad0PM1SZHXOcfhHkRO0D4CBeGoejH1wBsVvlbhcd 2lZmS0Vx2PE4yBEcs0EtqclrXcBVWqC+w9xcLU9Ly7Ztr5xdkKxCq2ZSVqTUUlz2LBGZ o0IQ== X-Gm-Message-State: AOAM532LUcxQnHwIJtmwlI4vu9jOaiSH7hdATioqtrejTQDPEcGvx3Ea g/aM6yJhKAj3pVBDQvjeVMo6UlrMUuA= X-Google-Smtp-Source: ABdhPJyI4dN8FzkV0FOxrBa1THMuB+8nPxJGWft+AXElncM0Z7aiq7OcjvvT8WAe06i2OCzHEasr8Q== X-Received: by 2002:a17:90a:cb0b:: with SMTP id z11mr2882310pjt.77.1598022783284; Fri, 21 Aug 2020 08:13:03 -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.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 08:13:02 -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, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron , Christoph Hellwig , Christophe Leroy Subject: [PATCH v6 06/12] powerpc: inline huge vmap supported functions Date: Sat, 22 Aug 2020 01:12:10 +1000 Message-Id: <20200821151216.1005117-7-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-Rspamd-Queue-Id: 63C7218022CE3 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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 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 eca83a50bf2e..27f5837cf145 100644 --- a/arch/powerpc/mm/book3s64/radix_pgtable.c +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c @@ -1134,22 +1134,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; @@ -1233,8 +1217,3 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) return 1; } - -bool arch_vmap_p4d_supported(pgprot_t prot) -{ - return false; -}