From patchwork Tue Aug 25 14:57:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11735853 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 D880B722 for ; Tue, 25 Aug 2020 14:58:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A4696207D3 for ; Tue, 25 Aug 2020 14:58:47 +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="ld0qeCxb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A4696207D3 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 AAFC48E0016; Tue, 25 Aug 2020 10:58:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A60C08D0001; Tue, 25 Aug 2020 10:58:46 -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 9509D8E0016; Tue, 25 Aug 2020 10:58:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 7F93A8D0001 for ; Tue, 25 Aug 2020 10:58:46 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3F2D11EE6 for ; Tue, 25 Aug 2020 14:58:46 +0000 (UTC) X-FDA: 77189397852.23.badge34_23042832705c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id C062237606 for ; Tue, 25 Aug 2020 14:58:45 +0000 (UTC) X-Spam-Summary: 1,0,0,e05b6db9824eb6d2,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:1543:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2895:2901:3138:3139:3140:3141:3142:3167:3354:3865:3867:3868:3870:3872:3874:4117:4385:4605:5007:6119:6261:6630:6653:6742:7514:7875:7903:9413:9592:10004:11026:11232:11473:11657:11658:11914:12043:12297:12438:12517:12519:12555:12895:13846:13894:14096:14181:14394:14687:14721:21080:21433:21444:21451:21627:21666:21990:30054:30070,0,RBL:209.85.210.195:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yrxy4x63xe8bjrshjueugnrzqpmycrgtpyz7af8mhexb7rpta9amkdwhqfeqd.rads6qqbbsakmwbwcjrq1jxpaj7utsrkdyrbs7parsd1kjgs87pwkoued3trgi1.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:none,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: badge34_23042832705c X-Filterd-Recvd-Size: 6450 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Aug 2020 14:58:45 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id m8so7566376pfh.3 for ; Tue, 25 Aug 2020 07:58:45 -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=aQ1WXKhj5a18kdRmgSAyN5y+pR2QoRFll6u3oKCjOTs=; b=ld0qeCxbyfv+pIE1p9tMPi79FDatikVJ43DF5LbwBuNhVgpCDbF06GfECbrvsMP/rn j+9XBpaxT9i2UKZttKNrNGhxQ5lYz9qbzrdVtFq8EPll0QUhyKnG3TBNWuP5AAMgT0Z0 hcSRJXoE92dTPWqLbPVZu6V1RBvpNfMIMizISs/hwRqKOZ/uRUpmu2owYRuxktcPqJeo oL0zn6YvRj8eQU3/ys+70jRTBX7wIDQgr1OMzdCEnfXProl815qfC1bH2BGFW0+n/qNl zzVaksNuuUNfvcQDGz15exv/e/ZOcP4e+A5tRdVOtJd2sJUjt833+lmaWXG0LE3k5jWt aUVw== 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=aQ1WXKhj5a18kdRmgSAyN5y+pR2QoRFll6u3oKCjOTs=; b=mjibtbDockj7F0hFB6/RbNVztMUbgPYuizFV+/hUfkialuL5QJK3UcgMVVSLHhWxk7 1vHiIBHk1OqZLMU0ewpf5OEp1u/vJQqG33qt9q+X1FOoDOEsd2rx+iRw411VCDw/XkEB 87JwMAGQ5usw7UAkBgugTnLunecpLp6tF+w9+EBlBlJdlx5zt6bdiEwBEuribDMEH4/Z 9mfVYw3+jy0K7ETLGHz8EhIhwKu2trzxJlRsQDqJj6Se+Y7607Zk8Gcv46AEd4vbI29H VvqP03ZaiTg1o5rne3Tn9LSalcNOJgn28HIGj6YubiE84hLoE1qI36cZ4llK71OiG+Rz QiUQ== X-Gm-Message-State: AOAM531i05KfMcet/SspWdnj7jpK/KvkSPUl0jEKN9Ja50XWvDo6PAdb 2KmzeHc6RPEMx3vVqtkH4vG3LPYeinE= X-Google-Smtp-Source: ABdhPJxgyt6v8I7ydZGOFbxNzJf2nKN/r4HPzy9rkAa1+avUfozgoPS8wf2IGvii68NG9fSXHus0bg== X-Received: by 2002:a63:7c9:: with SMTP id 192mr6935394pgh.181.1598367524426; Tue, 25 Aug 2020 07:58:44 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 07:58:44 -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 , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Subject: [PATCH v7 08/12] x86: inline huge vmap supported functions Date: Wed, 26 Aug 2020 00:57:49 +1000 Message-Id: <20200825145753.529284-9-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: C062237606 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Nicholas Piggin --- Ack or objection if this goes via the -mm tree? arch/x86/include/asm/vmalloc.h | 22 +++++++++++++++++++--- arch/x86/mm/ioremap.c | 19 ------------------- arch/x86/mm/pgtable.c | 13 ------------- 3 files changed, 19 insertions(+), 35 deletions(-) diff --git a/arch/x86/include/asm/vmalloc.h b/arch/x86/include/asm/vmalloc.h index 094ea2b565f3..e714b00fc0ca 100644 --- a/arch/x86/include/asm/vmalloc.h +++ b/arch/x86/include/asm/vmalloc.h @@ -1,13 +1,29 @@ #ifndef _ASM_X86_VMALLOC_H #define _ASM_X86_VMALLOC_H +#include #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) +{ +#ifdef CONFIG_X86_64 + return boot_cpu_has(X86_FEATURE_GBPAGES); +#else + return false; +#endif +} + +static inline bool arch_vmap_pmd_supported(pgprot_t prot) +{ + return boot_cpu_has(X86_FEATURE_PSE); +} #endif #endif /* _ASM_X86_VMALLOC_H */ diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 159bfca757b9..1465a22a9bfb 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c @@ -481,25 +481,6 @@ void iounmap(volatile void __iomem *addr) } EXPORT_SYMBOL(iounmap); -bool arch_vmap_p4d_supported(pgprot_t prot) -{ - return false; -} - -bool arch_vmap_pud_supported(pgprot_t prot) -{ -#ifdef CONFIG_X86_64 - return boot_cpu_has(X86_FEATURE_GBPAGES); -#else - return false; -#endif -} - -bool arch_vmap_pmd_supported(pgprot_t prot) -{ - return boot_cpu_has(X86_FEATURE_PSE); -} - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * access diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index dfd82f51ba66..801c418ee97d 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -780,14 +780,6 @@ int pmd_clear_huge(pmd_t *pmd) return 0; } -/* - * Until we support 512GB pages, skip them in the vmap area. - */ -int p4d_free_pud_page(p4d_t *p4d, unsigned long addr) -{ - return 0; -} - #ifdef CONFIG_X86_64 /** * pud_free_pmd_page - Clear pud entry and free pmd page. @@ -859,11 +851,6 @@ int pmd_free_pte_page(pmd_t *pmd, unsigned long addr) #else /* !CONFIG_X86_64 */ -int pud_free_pmd_page(pud_t *pud, unsigned long addr) -{ - return pud_none(*pud); -} - /* * Disable free page handling on x86-PAE. This assures that ioremap() * does not update sync'd pmd entries. See vmalloc_sync_one().