Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp766967pxy; Wed, 28 Apr 2021 13:52:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUhziq4gLfPniiY3TGpxQD7jEj6tCu/8QVXse4UhUr6c2AeOTcJjWeC9GDXVr+5hgu1wMc X-Received: by 2002:a17:906:4342:: with SMTP id z2mr30418431ejm.337.1619643131697; Wed, 28 Apr 2021 13:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619643131; cv=none; d=google.com; s=arc-20160816; b=HJbkdamEIAjsEXstCLLz0nzuNUnzdWUh7j8cthfY3L2tUN71V6IdmKr2oPiHd+R7i9 H9gMqXuBbRoZHHIm7KFwneMaBEdLvV2grguCrXuzBsgYNlXWeRyMt63aEujY+IuG/IeA OEspsju9CFe0jJzxQhZ7L6Yu/pSkxy238gvWOmAQoom6n9EZ4QEM9hHMk3O1NVDuXVnh nEXzmMXZailIqKwfbpyvLvl294cLtLbHN2WmKLDX4MeKGcL2RM31CY/bnqea3z60gwlP 5cBASUdxzbxh85PHMCCYgFceMWpsdaSxwT/S9j3+5C4ao/Ej/yG2sOIqG0p1fG5oRFXi /hqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=3c/TtkM67c77ItVQ+SLXXad1Mr4YPF1Elee4oXHVo3w=; b=bTJp0GD+kGX1gTcPxmTr0k9sTp1co/4twnY7soqw9Z6JErjVm5+ENb4olQPuHEf/di dzz2qlNPNYzarvasSAoB+dVOEzT1fBWAXuMDF5pftoek9W7EaFRZGoWCoA7Ol5M/b5Lq yT7Ds8yQ6FPLcIlAYtPOXpKzn3nWzfoi6uOkh5GN3kQAoCm6KeKXTm0gl6sTrJT70B86 VB+Hvrgp+fO24OlcXze4w4E5En4nZc+LeYhfZXS0uyigWTHELpfUcgg5gLPJeR4dupbX SjxUoc+ZyiBbNOkr+RIjC2eteutTNwavCDEoPeXkkfgFQLZXQeskyl7CH7OuGME3Wn74 vraw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id de36si1241691ejc.92.2021.04.28.13.51.48; Wed, 28 Apr 2021 13:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241262AbhD1QrF (ORCPT + 99 others); Wed, 28 Apr 2021 12:47:05 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:38738 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241222AbhD1QrB (ORCPT ); Wed, 28 Apr 2021 12:47:01 -0400 Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4FVkzV4qlxz9tcX; Wed, 28 Apr 2021 18:46:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rGxpY2iI8zAH; Wed, 28 Apr 2021 18:46:14 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4FVkzV3vmDz9tcV; Wed, 28 Apr 2021 18:46:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 6F0128B837; Wed, 28 Apr 2021 18:46:14 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 4PWl6TcHRv8j; Wed, 28 Apr 2021 18:46:14 +0200 (CEST) Received: from po15610vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 083158B831; Wed, 28 Apr 2021 18:46:14 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id D8D336428C; Wed, 28 Apr 2021 16:46:13 +0000 (UTC) Message-Id: <6f482b6722f7a891ce335db7e02ecbdb42574e8b.1619628001.git.christophe.leroy@csgroup.eu> In-Reply-To: References: From: Christophe Leroy Subject: [RFC PATCH v1 3/4] mm/pgtable: Add stubs for {pmd/pub}_{set/clear}_huge To: Andrew Morton , Nicholas Piggin , Mike Kravetz , Mike Rapoport Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, linux-mm@kvack.org Date: Wed, 28 Apr 2021 16:46:13 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For architectures with no PMD and/or no PUD, add stubs similar to what we have for architectures without P4D. Signed-off-by: Christophe Leroy --- include/linux/pgtable.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 46b13780c2c8..d41474a2d255 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1371,10 +1371,34 @@ static inline int p4d_clear_huge(p4d_t *p4d) } #endif /* !__PAGETABLE_P4D_FOLDED */ +#ifndef __PAGETABLE_PUD_FOLDED int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot); -int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot); int pud_clear_huge(pud_t *pud); +#else +static inline int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot) +{ + return 0; +} +static inline int pud_clear_huge(pud_t *pud) +{ + return 0; +} +#endif /* !__PAGETABLE_PUD_FOLDED */ + +#ifndef __PAGETABLE_PMD_FOLDED +int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot); int pmd_clear_huge(pmd_t *pmd); +#else +static inline int pmd_set_huge(pmd_t *pmd, phys_addr_t addr, pgprot_t prot) +{ + return 0; +} +static inline int pmd_clear_huge(pmd_t *pmd) +{ + return 0; +} +#endif /* !__PAGETABLE_PMD_FOLDED */ + int p4d_free_pud_page(p4d_t *p4d, unsigned long addr); int pud_free_pmd_page(pud_t *pud, unsigned long addr); int pmd_free_pte_page(pmd_t *pmd, unsigned long addr); -- 2.25.0