From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 15B34C433E3 for ; Fri, 21 Aug 2020 15:42:56 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 B72052063A for ; Fri, 21 Aug 2020 15:42:55 +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="C61EU6HX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B72052063A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BY5Pn70NpzDqXN for ; Sat, 22 Aug 2020 01:42:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::641; helo=mail-pl1-x641.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=C61EU6HX; dkim-atps=neutral Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BY4lf4p5lzDqlD for ; Sat, 22 Aug 2020 01:13:18 +1000 (AEST) Received: by mail-pl1-x641.google.com with SMTP id k13so988368plk.13 for ; Fri, 21 Aug 2020 08:13:18 -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=/TNFv6HMLiWXamsCOEc67C9ud98FI7LShW37Zy1NZ3Q=; b=C61EU6HXNNiIE03XtFMUUqH0afKGOIVNbSDjGdx057g8dEiIh5RJ37CBcBRlcqMGp2 AqxrungEYkWu+oIKtkmSUOzy/+Au53BUprQpyGz/LZJqP4A/KwsYAATREHIm/WefPvqd pu2o5GkG+bynDn1hswfdToNcyF2ifZfTP7XHQXdD/TNqeDCMlpxPcvj2sJ0YFaLLZGCq XN6VgMZIrg74vq/qsWlwaKAK0JFLaf9nckuEf2X2UbXEDapC1I136yAjpO7dmUGU4/6C PJYr7n4Cgio2Zpo2a7rN8G3HXn2ofcfKbFBH6cjmSGoNCRkS6dI7nw9yqEVwS/tRwOr0 hRjQ== 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=/TNFv6HMLiWXamsCOEc67C9ud98FI7LShW37Zy1NZ3Q=; b=bnGK26jQD4f5Bbu23oOvqi5dTki4006dI6VFck9L1KE88oV1LTsTuwSVTZfKKu/uvQ B2djh6mXlgwtVOyxc/zD9lXcmLTtiy0QnM3dj/ZXtvHRYZS6Wdj75sDbYteRRYXkXOv5 Lu+Z/G6mk84MvZULskBt/hFB40fYKUNvM2TkfSiKRnvT9Qs4WKGCf3NIgDsCUrjoh3IW cZNjNsYjBvqJjmbdVjrvzKTWbI6xAz2MoXqG6uvNgM4ai2GaOX6bmfAteD9tJWYxIukU faFh4bNDBrtyjdA1TE+QXO0LptetlyWWPMfVw1KlmbdrHqc/9wI9G7dLY4KlAoK9MXjG q7qQ== X-Gm-Message-State: AOAM531LvmY0COrh3XOlpx1zNH0/3vuW2cGrhWqstGdNIV0bW6Ax0Gl8 fQQ+gXzvAhy/VmbVvG2XCLc= X-Google-Smtp-Source: ABdhPJxJ42RePcnQK55+NHJSCK6N+XE6cpbW5VmwJeO028VLoSugON1xyR8CJ90w/V7P+0Hx+E2elg== X-Received: by 2002:a17:902:8e85:: with SMTP id bg5mr2686443plb.306.1598022795348; Fri, 21 Aug 2020 08:13:15 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 08:13:14 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Subject: [PATCH v6 08/12] x86: inline huge vmap supported functions Date: Sat, 22 Aug 2020 01:12:12 +1000 Message-Id: <20200821151216.1005117-9-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 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Nicholas Piggin , Christoph Hellwig , Zefan Li , Borislav Petkov , Jonathan Cameron , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Ingo Molnar Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 --- 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(). -- 2.23.0