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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 F32F9C433DB for ; Tue, 2 Feb 2021 10:23:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A77F64EE2 for ; Tue, 2 Feb 2021 10:23:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbhBBKXY (ORCPT ); Tue, 2 Feb 2021 05:23:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229767AbhBBKXW (ORCPT ); Tue, 2 Feb 2021 05:23:22 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 286EEC061573; Tue, 2 Feb 2021 02:22:42 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id e9so2083405pjj.0; Tue, 02 Feb 2021 02:22:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=feNMs9NZIZZBFRuPZuPQAraD1ls2HBTzJnPTDra1dJo=; b=Hsn610B9baMjUo1dtjNGVVl0OMIYTZTIqhnRX3zMn7zT8usqwHFf51r2OfflOoiC0c 19XwAcKChgc/bO3PHxkM0Sszy87AP165fkRjy9N9U5+kYTBBFGNrGeeMkAHUGleudAgh 54LrQGzm/wtP2C3shypmgkoFHl1Peul+jfBAvSV9vdz+0Ah0FzSZ9hGANzqMRm4IDNhC Y7lLxrRQxpvh1/LVTxLwGEhvGLkM1b/wWBUPLvVlX8QBHq2pAhmDzzDPLIphrrd6Bljg aGFaAJHE9uUfySvC5HASZYUAGc4IyII5YQS6M975rZTgLCb/ciN2JNJi3IlkvM8ZJeVN A/qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=feNMs9NZIZZBFRuPZuPQAraD1ls2HBTzJnPTDra1dJo=; b=QwwS/BmUvbj10aDzr4f9C+P1HsHkSuGgHUK1EhZZhG1IQJZPjtxPm9+NeeCjyrdyUa J6dAuZLlOawcKD6JRcdH1pM96JkQC3HNUA2QBwjbVAbHN4eF/ahOs0TT7cggV4043gn/ 9oXaR6JIJFQ0MjG0RTeEskVUdTzNhaj43fQ8YqAB89Ndl68EjEzhp5s3yDurcdOBBg+s JPRhkwvnxf0c+oEAGal9/A8BGYy9hJbV5eD70+qmwvneFu2Moo4j25Upf1Mgh2+8ozcZ ONJ3Ilawn3SBXAvxMR4Ah+2183AJ8EjOz8EVsUkr3NzjFlbpMEoATFE1/8wGYe9lA8n3 Vh0A== X-Gm-Message-State: AOAM533/w+Z91gKsqPI5tOgmySmkpNJfbN63+PZkKdc1ay6BZ3CPaqbr bawXfads9nP4jU8FMRzWSb8= X-Google-Smtp-Source: ABdhPJwAydycRDrEu05vCkvnwXNns+f1xdrkCkAXHMftwOd5L2+xxwr6QxnPETGvBPuRovul4hnQfw== X-Received: by 2002:a17:90a:aa85:: with SMTP id l5mr3754761pjq.230.1612261361659; Tue, 02 Feb 2021 02:22:41 -0800 (PST) Received: from localhost (60-242-11-44.static.tpgi.com.au. [60.242.11.44]) by smtp.gmail.com with ESMTPSA id o10sm21105273pfp.87.2021.02.02.02.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 02:22:40 -0800 (PST) Date: Tue, 02 Feb 2021 20:22:35 +1000 From: Nicholas Piggin Subject: Re: [PATCH v11 01/13] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page To: Andrew Morton , Ding Tianhong , linux-mm@kvack.org Cc: Christophe Leroy , Christoph Hellwig , Christoph Hellwig , Jonathan Cameron , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Rick Edgecombe References: <20210126044510.2491820-1-npiggin@gmail.com> <20210126044510.2491820-2-npiggin@gmail.com> <2dcbe2c9-c968-4895-fc43-c40dfe9f06d3@huawei.com> In-Reply-To: <2dcbe2c9-c968-4895-fc43-c40dfe9f06d3@huawei.com> MIME-Version: 1.0 Message-Id: <1612261080.2gjaa5ecdf.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Excerpts from Ding Tianhong's message of January 28, 2021 1:13 pm: > On 2021/1/26 12:44, Nicholas Piggin wrote: >> vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. >> Whether or not a vmap is huge depends on the architecture details, >> alignments, boot options, etc., which the caller can not be expected >> to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. >>=20 >> This change teaches vmalloc_to_page about larger pages, and returns >> the struct page that corresponds to the offset within the large page. >> This makes the API agnostic to mapping implementation details. >>=20 >> [*] As explained by commit 029c54b095995 ("mm/vmalloc.c: huge-vmap: >> fail gracefully on unexpected huge vmap mappings") >>=20 >> Reviewed-by: Christoph Hellwig >> Signed-off-by: Nicholas Piggin >> --- >> mm/vmalloc.c | 41 ++++++++++++++++++++++++++--------------- >> 1 file changed, 26 insertions(+), 15 deletions(-) >>=20 >> diff --git a/mm/vmalloc.c b/mm/vmalloc.c >> index e6f352bf0498..62372f9e0167 100644 >> --- a/mm/vmalloc.c >> +++ b/mm/vmalloc.c >> @@ -34,7 +34,7 @@ >> #include >> #include >> #include >> - >> +#include >> #include >> #include >> #include >> @@ -343,7 +343,9 @@ int is_vmalloc_or_module_addr(const void *x) >> } >> =20 >> /* >> - * Walk a vmap address to the struct page it maps. >> + * Walk a vmap address to the struct page it maps. Huge vmap mappings w= ill >> + * return the tail page that corresponds to the base page address, whic= h >> + * matches small vmap mappings. >> */ >> struct page *vmalloc_to_page(const void *vmalloc_addr) >> { >> @@ -363,25 +365,33 @@ struct page *vmalloc_to_page(const void *vmalloc_a= ddr) >> =20 >> if (pgd_none(*pgd)) >> return NULL; >> + if (WARN_ON_ONCE(pgd_leaf(*pgd))) >> + return NULL; /* XXX: no allowance for huge pgd */ >> + if (WARN_ON_ONCE(pgd_bad(*pgd))) >> + return NULL; >> + >> p4d =3D p4d_offset(pgd, addr); >> if (p4d_none(*p4d)) >> return NULL; >> - pud =3D pud_offset(p4d, addr); >> + if (p4d_leaf(*p4d)) >> + return p4d_page(*p4d) + ((addr & ~P4D_MASK) >> PAGE_SHIFT); >> + if (WARN_ON_ONCE(p4d_bad(*p4d))) >> + return NULL; >> =20 >> - /* >> - * Don't dereference bad PUD or PMD (below) entries. This will also >> - * identify huge mappings, which we may encounter on architectures >> - * that define CONFIG_HAVE_ARCH_HUGE_VMAP=3Dy. Such regions will be >> - * identified as vmalloc addresses by is_vmalloc_addr(), but are >> - * not [unambiguously] associated with a struct page, so there is >> - * no correct value to return for them. >> - */ >> - WARN_ON_ONCE(pud_bad(*pud)); >> - if (pud_none(*pud) || pud_bad(*pud)) >> + pud =3D pud_offset(p4d, addr); >> + if (pud_none(*pud)) >> + return NULL; >> + if (pud_leaf(*pud)) >> + return pud_page(*pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT); >=20 > Hi Nicho: >=20 > /builds/1mzfdQzleCy69KZFb5qHNSEgabZ/mm/vmalloc.c: In function 'vmalloc_to= _page': > /builds/1mzfdQzleCy69KZFb5qHNSEgabZ/include/asm-generic/pgtable-nop4d-hac= k.h:48:27: error: implicit declaration of function 'pud_page'; did you mean= 'put_page'? [-Werror=3Dimplicit-function-declaration] > 48 | #define pgd_page(pgd) (pud_page((pud_t){ pgd })) > | ^~~~~~~~ >=20 > the pug_page is not defined for aarch32 when enabling 2-level page config= , it break the system building. Hey thanks for finding that, not sure why that didn't trigger any CI. Anyway newer kernels don't have the ptable-*-hack.h headers, but even so=20 it still breaks upstream. arm is using some hand-rolled 2-level folding of its own (which is fair enough because most 32-bit archs were 2 level at the time I added pgtable-nopud.h header). This patch seems to at least make it build. Thanks, Nick --- arch/arm/include/asm/pgtable-3level.h | 2 -- arch/arm/include/asm/pgtable.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/p= gtable-3level.h index 2b85d175e999..d4edab51a77c 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h @@ -186,8 +186,6 @@ static inline pte_t pte_mkspecial(pte_t pte) =20 #define pmd_write(pmd) (pmd_isclear((pmd), L_PMD_SECT_RDONLY)) #define pmd_dirty(pmd) (pmd_isset((pmd), L_PMD_SECT_DIRTY)) -#define pud_page(pud) pmd_page(__pmd(pud_val(pud))) -#define pud_write(pud) pmd_write(__pmd(pud_val(pud))) =20 #define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd)) #define pmd_thp_or_huge(pmd) (pmd_huge(pmd) || pmd_trans_huge(pmd)) diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.= h index c02f24400369..d63a5bb6bd0c 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -166,6 +166,9 @@ extern struct page *empty_zero_page; =20 extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; =20 +#define pud_page(pud) pmd_page(__pmd(pud_val(pud))) +#define pud_write(pud) pmd_write(__pmd(pud_val(pud))) + #define pmd_none(pmd) (!pmd_val(pmd)) =20 static inline pte_t *pmd_page_vaddr(pmd_t pmd) --=20 2.23.0 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=-10.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 338DEC433E0 for ; Wed, 3 Feb 2021 00:42:30 +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 5DB4164F6A for ; Wed, 3 Feb 2021 00:42:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DB4164F6A 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 4DVjZC4V3xzDqlr for ; Wed, 3 Feb 2021 11:42:27 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::102e; helo=mail-pj1-x102e.google.com; envelope-from=npiggin@gmail.com; receiver=) 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=Hsn610B9; dkim-atps=neutral Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) (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 4DVLVH61NbzDqwg for ; Tue, 2 Feb 2021 21:22:43 +1100 (AEDT) Received: by mail-pj1-x102e.google.com with SMTP id s24so1975074pjp.5 for ; Tue, 02 Feb 2021 02:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=feNMs9NZIZZBFRuPZuPQAraD1ls2HBTzJnPTDra1dJo=; b=Hsn610B9baMjUo1dtjNGVVl0OMIYTZTIqhnRX3zMn7zT8usqwHFf51r2OfflOoiC0c 19XwAcKChgc/bO3PHxkM0Sszy87AP165fkRjy9N9U5+kYTBBFGNrGeeMkAHUGleudAgh 54LrQGzm/wtP2C3shypmgkoFHl1Peul+jfBAvSV9vdz+0Ah0FzSZ9hGANzqMRm4IDNhC Y7lLxrRQxpvh1/LVTxLwGEhvGLkM1b/wWBUPLvVlX8QBHq2pAhmDzzDPLIphrrd6Bljg aGFaAJHE9uUfySvC5HASZYUAGc4IyII5YQS6M975rZTgLCb/ciN2JNJi3IlkvM8ZJeVN A/qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=feNMs9NZIZZBFRuPZuPQAraD1ls2HBTzJnPTDra1dJo=; b=DSlxjyPezTOUexEnK0IFeoUIb1yzGAf/bRF4X/rhdausVWYHr6h3Sih0+gZM3S94Wk H01BdmsyYauSPE6cz9UjB3SzSY3GpAfdwKD6kUA5s8SfgIDlUX6tJqt/qzhF3kfW46/R aw+lR5qZHwOE8kCelsAat3a89ruVGuiV0kPfia0pHZl3WXeRm1Q/QwNkKyQGowJkSzoK DLmswIbwodTQwZIBsaxT5A6uQeLG53gISC2CadpH5nNvl7LpzkntEs0Vqc86XCE9gdOF QlGor+gKEc+FnKWmqeBHF8jD7vBhb5yV/3YtVnYtiRXLT4p8xVLscZMB4Xk7fkACSTYV LWmg== X-Gm-Message-State: AOAM532y6WwLwc2PHT1TUYWO2rzfjvHi6cDOBHrfnAfIffX0kiKnslJc 2j92EbGAKLU+1Xhso3WEACiEFcrtwf8= X-Google-Smtp-Source: ABdhPJwAydycRDrEu05vCkvnwXNns+f1xdrkCkAXHMftwOd5L2+xxwr6QxnPETGvBPuRovul4hnQfw== X-Received: by 2002:a17:90a:aa85:: with SMTP id l5mr3754761pjq.230.1612261361659; Tue, 02 Feb 2021 02:22:41 -0800 (PST) Received: from localhost (60-242-11-44.static.tpgi.com.au. [60.242.11.44]) by smtp.gmail.com with ESMTPSA id o10sm21105273pfp.87.2021.02.02.02.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 02:22:40 -0800 (PST) Date: Tue, 02 Feb 2021 20:22:35 +1000 From: Nicholas Piggin Subject: Re: [PATCH v11 01/13] mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page To: Andrew Morton , Ding Tianhong , linux-mm@kvack.org References: <20210126044510.2491820-1-npiggin@gmail.com> <20210126044510.2491820-2-npiggin@gmail.com> <2dcbe2c9-c968-4895-fc43-c40dfe9f06d3@huawei.com> In-Reply-To: <2dcbe2c9-c968-4895-fc43-c40dfe9f06d3@huawei.com> MIME-Version: 1.0 Message-Id: <1612261080.2gjaa5ecdf.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, linux-kernel@vger.kernel.org, Christoph Hellwig , Jonathan Cameron , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, Christoph Hellwig Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Excerpts from Ding Tianhong's message of January 28, 2021 1:13 pm: > On 2021/1/26 12:44, Nicholas Piggin wrote: >> vmalloc_to_page returns NULL for addresses mapped by larger pages[*]. >> Whether or not a vmap is huge depends on the architecture details, >> alignments, boot options, etc., which the caller can not be expected >> to know. Therefore HUGE_VMAP is a regression for vmalloc_to_page. >>=20 >> This change teaches vmalloc_to_page about larger pages, and returns >> the struct page that corresponds to the offset within the large page. >> This makes the API agnostic to mapping implementation details. >>=20 >> [*] As explained by commit 029c54b095995 ("mm/vmalloc.c: huge-vmap: >> fail gracefully on unexpected huge vmap mappings") >>=20 >> Reviewed-by: Christoph Hellwig >> Signed-off-by: Nicholas Piggin >> --- >> mm/vmalloc.c | 41 ++++++++++++++++++++++++++--------------- >> 1 file changed, 26 insertions(+), 15 deletions(-) >>=20 >> diff --git a/mm/vmalloc.c b/mm/vmalloc.c >> index e6f352bf0498..62372f9e0167 100644 >> --- a/mm/vmalloc.c >> +++ b/mm/vmalloc.c >> @@ -34,7 +34,7 @@ >> #include >> #include >> #include >> - >> +#include >> #include >> #include >> #include >> @@ -343,7 +343,9 @@ int is_vmalloc_or_module_addr(const void *x) >> } >> =20 >> /* >> - * Walk a vmap address to the struct page it maps. >> + * Walk a vmap address to the struct page it maps. Huge vmap mappings w= ill >> + * return the tail page that corresponds to the base page address, whic= h >> + * matches small vmap mappings. >> */ >> struct page *vmalloc_to_page(const void *vmalloc_addr) >> { >> @@ -363,25 +365,33 @@ struct page *vmalloc_to_page(const void *vmalloc_a= ddr) >> =20 >> if (pgd_none(*pgd)) >> return NULL; >> + if (WARN_ON_ONCE(pgd_leaf(*pgd))) >> + return NULL; /* XXX: no allowance for huge pgd */ >> + if (WARN_ON_ONCE(pgd_bad(*pgd))) >> + return NULL; >> + >> p4d =3D p4d_offset(pgd, addr); >> if (p4d_none(*p4d)) >> return NULL; >> - pud =3D pud_offset(p4d, addr); >> + if (p4d_leaf(*p4d)) >> + return p4d_page(*p4d) + ((addr & ~P4D_MASK) >> PAGE_SHIFT); >> + if (WARN_ON_ONCE(p4d_bad(*p4d))) >> + return NULL; >> =20 >> - /* >> - * Don't dereference bad PUD or PMD (below) entries. This will also >> - * identify huge mappings, which we may encounter on architectures >> - * that define CONFIG_HAVE_ARCH_HUGE_VMAP=3Dy. Such regions will be >> - * identified as vmalloc addresses by is_vmalloc_addr(), but are >> - * not [unambiguously] associated with a struct page, so there is >> - * no correct value to return for them. >> - */ >> - WARN_ON_ONCE(pud_bad(*pud)); >> - if (pud_none(*pud) || pud_bad(*pud)) >> + pud =3D pud_offset(p4d, addr); >> + if (pud_none(*pud)) >> + return NULL; >> + if (pud_leaf(*pud)) >> + return pud_page(*pud) + ((addr & ~PUD_MASK) >> PAGE_SHIFT); >=20 > Hi Nicho: >=20 > /builds/1mzfdQzleCy69KZFb5qHNSEgabZ/mm/vmalloc.c: In function 'vmalloc_to= _page': > /builds/1mzfdQzleCy69KZFb5qHNSEgabZ/include/asm-generic/pgtable-nop4d-hac= k.h:48:27: error: implicit declaration of function 'pud_page'; did you mean= 'put_page'? [-Werror=3Dimplicit-function-declaration] > 48 | #define pgd_page(pgd) (pud_page((pud_t){ pgd })) > | ^~~~~~~~ >=20 > the pug_page is not defined for aarch32 when enabling 2-level page config= , it break the system building. Hey thanks for finding that, not sure why that didn't trigger any CI. Anyway newer kernels don't have the ptable-*-hack.h headers, but even so=20 it still breaks upstream. arm is using some hand-rolled 2-level folding of its own (which is fair enough because most 32-bit archs were 2 level at the time I added pgtable-nopud.h header). This patch seems to at least make it build. Thanks, Nick --- arch/arm/include/asm/pgtable-3level.h | 2 -- arch/arm/include/asm/pgtable.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/p= gtable-3level.h index 2b85d175e999..d4edab51a77c 100644 --- a/arch/arm/include/asm/pgtable-3level.h +++ b/arch/arm/include/asm/pgtable-3level.h @@ -186,8 +186,6 @@ static inline pte_t pte_mkspecial(pte_t pte) =20 #define pmd_write(pmd) (pmd_isclear((pmd), L_PMD_SECT_RDONLY)) #define pmd_dirty(pmd) (pmd_isset((pmd), L_PMD_SECT_DIRTY)) -#define pud_page(pud) pmd_page(__pmd(pud_val(pud))) -#define pud_write(pud) pmd_write(__pmd(pud_val(pud))) =20 #define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd)) #define pmd_thp_or_huge(pmd) (pmd_huge(pmd) || pmd_trans_huge(pmd)) diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.= h index c02f24400369..d63a5bb6bd0c 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h @@ -166,6 +166,9 @@ extern struct page *empty_zero_page; =20 extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; =20 +#define pud_page(pud) pmd_page(__pmd(pud_val(pud))) +#define pud_write(pud) pmd_write(__pmd(pud_val(pud))) + #define pmd_none(pmd) (!pmd_val(pmd)) =20 static inline pte_t *pmd_page_vaddr(pmd_t pmd) --=20 2.23.0