From patchwork Tue Aug 25 14:57:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11735851 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 C2553722 for ; Tue, 25 Aug 2020 14:58:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8F28120782 for ; Tue, 25 Aug 2020 14:58:41 +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="b0AWgWGG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F28120782 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 8B4918E0013; Tue, 25 Aug 2020 10:58:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8673C8D0001; Tue, 25 Aug 2020 10:58:40 -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 7547D8E0013; Tue, 25 Aug 2020 10:58:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 5C1E58D0001 for ; Tue, 25 Aug 2020 10:58:40 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 1FD011EE6 for ; Tue, 25 Aug 2020 14:58:40 +0000 (UTC) X-FDA: 77189397600.19.smile31_330a6332705c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id CFD951AD1AD for ; Tue, 25 Aug 2020 14:58:39 +0000 (UTC) X-Spam-Summary: 1,0,0,7d9c17bbdd7c7f95,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:2693:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3872:4117:4321:4385:4605:5007:6261:6653:6742:7514:8603:9389:9413:9592:10004:11026:11232:11473:11657:11658:11914:12043:12291:12296:12297:12438:12517:12519:12555:12895:12986:13894:14096:14181:14394:14687:14721:21080:21444:21451:21627:21666:21990:30054,0,RBL:209.85.215.193:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yf7ciijdmoo1siw111dnon84iwuopbud8e1tz3yt5si4b97rah8q1f7hrophw.nx8nj4ma3jezddmt9odts4wcex146cwjg3175mpjk55yog6ksms9knka3wffocj.g-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:none,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: smile31_330a6332705c X-Filterd-Recvd-Size: 6131 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Aug 2020 14:58:39 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id o13so7013737pgf.0 for ; Tue, 25 Aug 2020 07:58:39 -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=M/5eWAbEDQgOkiF6H06FGKZHT/EDb26p/JCBso4Tchw=; b=b0AWgWGGUkjUbVDCI2TEdIDTZ4JsxKTUttA8MH4l5sDv3h/rE3ZTwojNnF/PYUM1Mc rChp7wjU4B40W63KYGDwvx8DMJuTlmJIWmiOvJ24kwFppMGbxEe7UsbE/BSgegHkfb3j LONhu22IlfERWDw8KCGGDDHT35FyWcfSU82h3i6KidDfX79nz7QiE46/WdC5uZ4brzxu 8hrUEomJ1vnvGYG6UeDro5fRriPjk19sdTPUR0iAB0Omt6kUP5pVWMF3b7oZncCSELwC CgmHBgVY75MA6GwJqdeihvCoBXpuhmVIXDzN41XcjOhbeUcHiyD7Ay2fGa3VscHvt8OI U6Ug== 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=M/5eWAbEDQgOkiF6H06FGKZHT/EDb26p/JCBso4Tchw=; b=YwG3GiQovOPdGzndxvYb299K9xqfgDF6qO+vL1YTVW7dHdrUAGtpJhc2vHmhiqvlVT E9jKkRcvSjDYNph7GoqyBkw02EQgAcBlAR/zy0ZWZHTEtFZYFnuFL4tnVp4p86xo6k83 Ij6nwxbMrz4iWM53ndFlmMyNy+DGzr0rbYqpRrxM3f30eT6egUOTNWj8siEAOXQT7Jv0 dpUDHAlpa+UVcICJykL6MhU98n5Vky1yVoN4tvyVueCoEV0FbXwFbH0apw/mPH+dKw46 kJ/dY/rKNkc/nccJvQ7up6HUXH4Yzx1JV3/IQ4izB3krF3juRm6POp7NR3vfYlMbc1KX 6lfg== X-Gm-Message-State: AOAM531mtDdE84QGIumxZmlSdBAH/FVBQ1gewAnk1PyW52dZihxjKg+T KD71gg1tk1FvwFbSUZxl9ZxHcFCwOvw= X-Google-Smtp-Source: ABdhPJyoYG5YDMJT67BmAM16vft0/MgmMdJ09oTXgsuH1MNyBThmKV5NRHMl8mSRkrVyoySYFmRl/A== X-Received: by 2002:aa7:9f92:: with SMTP id z18mr8222689pfr.260.1598367518404; Tue, 25 Aug 2020 07:58:38 -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 e29sm15755956pfj.92.2020.08.25.07.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 07:58:38 -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 , Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: [PATCH v7 07/12] arm64: inline huge vmap supported functions Date: Wed, 26 Aug 2020 00:57:48 +1000 Message-Id: <20200825145753.529284-8-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200825145753.529284-1-npiggin@gmail.com> References: <20200825145753.529284-1-npiggin@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: CFD951AD1AD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Signed-off-by: Nicholas Piggin Acked-by: Catalin Marinas --- Ack or objection if this goes via the -mm tree? 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) {