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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 939E3C982EE for ; Mon, 21 Sep 2026 10:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HCXC73R0FiEzZWzOBK7V7lQxX+mRVXN7v0omS69mHiY=; b=B/vX+Qt5bsbBzh D6LAZuPL6uvw5h62bB/JHan8ehcZWuu8Oo6ggYAt5ixSDpGT2PxW+SHOg9qHW0FU728n7YTElEvzE lzrLRg1psG99Ub+clF0/Qd11FfiXMPEf/55vt0CtsPJ/eB38eC9Xu1bCf/+ixHWFCXyceDOc1DgbJ VPs4j2DnS2WzhiyRjI+Q+vq/T+I/f9gSc4+cU0zQg51z7Ln1fDdZh9kGvldT96EFCPukaAhO0sQWh VRSuO76qHI4QlUbJyTWvpPnOKXH045EWbZbjmxxW7jqk1Qr8OQC4CZwwJ0PizEQ1DS6RNzYYvprJT xSeIj6oKYhJqy8qtwsYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8bi2-00000001m0R-3huB; Mon, 21 Sep 2026 10:57:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x8bhy-00000001lvy-2HpD; Mon, 21 Sep 2026 10:57:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 60C1A1CE0; Mon, 21 Sep 2026 03:57:10 -0700 (PDT) Received: from e129823.arm.com (e129823.arm.com [10.2.213.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C61543F86C; Mon, 21 Sep 2026 03:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1789988233; bh=evfeL7lk1yM+NSCKYrKsUpK8FtfFqKH2c2v1uANMiZA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Xin7nkqtoZA/IKaN1bsZASwfU+1NECaZN6VEF7DCQgeeZsASTdyE/P29B2ESqDwcR 3PrnBYPE/iqT9P6uIvyqAv78zmz38U4I100s9VY7jCzhFHAKe9uNEexPk71cCPA/I8 rPv9w1Vloof+Vj/9mT37AC9r1STb2mNCpt1D2qq4= From: Yeoreum Yun Date: Mon, 21 Sep 2026 11:55:28 +0100 Subject: [PATCH 06/21] mm/pgtable: define (pgd|p4d|pud)_leaf() for folded page tables MIME-Version: 1.0 Message-Id: <20260921-dummy_ptxp3-v1-6-cd40cf68242e@arm.com> References: <20260921-dummy_ptxp3-v1-0-cd40cf68242e@arm.com> In-Reply-To: <20260921-dummy_ptxp3-v1-0-cd40cf68242e@arm.com> To: Russell King , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Catalin Marinas , Will Deacon , Arnd Bergmann , Andrew Morton , Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , David Hildenbrand , Michal Hocko , Lorenzo Stoakes , Tianrui Zhao , Bibo Mao , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonas Bonn , Stefan Kristiansson , Stafford Horne Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-openrisc@vger.kernel.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2651; i=yeoreum.yun@arm.com; h=from:subject:message-id; bh=MsUi6fKiy4C8DH1qxUfB7PhJ8/xMmbWjYscC+NJ7HZ8=; b=owEB7QES/pANAwAKAW3Vw9FaxTEzAcsmYgBqsQ1NMAsihcMqWtTNq8wXGlyLqx/OjaZfBDhWO BQRXRP3kPaJAbMEAAEKAB0WIQQtg+CS3QUzuFh1pJ1t1cPRWsUxMwUCarENTQAKCRBt1cPRWsUx M1JWC/4oEz21sKhzCLwgY6I/1KB5pft90w3HXdaylhrNZwNhAioe8Je0Oz2Rjw8hBIMkvhd3e0w zA69tHAwWWTuBHTswnnt0DeIqTvlxzCwlA48r0Z7UkYQkkd1IK5dTX+29BumgcET7QxrdKuGFc8 8RI08NCJyK3BuFSev/59cyoZFG0OX6kdSx9hMs3055MvaT8IVAv9XSclmUpwINFPH1qeA8l3/Jm JTv+7Cgpp9VtbAss1UR0jmvFTjHEyFbVvzemKonJiLlgg2DGpEZjwSU7hkvNUm+6Ni/AqDrrHJK D1EaTGvZDnm+C8lMK1IDSiqwgTJKIUIAUrgVzEh4QIp7qyoMLw2GuKIv+1Ztdzoi6z+CYqlpDUj L5tiwukcbc94p3teYqPPwP+UnafkHm0JuyqywJaziI4mD1XrAKI1OMPviw0mfqXOwyjjB/BggSq 20fhyXt51a2D5K+CexmOCQ/jx9XLyZmEWUJInumOy6SrMuxQhUsc9KzqpJGjAszheuAWA= X-Developer-Key: i=yeoreum.yun@arm.com; a=openpgp; fpr=2D83E092DD0533B85875A49D6DD5C3D15AC53133 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260921_035714_698665_1EADB3C1 X-CRM114-Status: GOOD ( 11.69 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: "David Hildenbrand (Arm)" Define (pgd|p4d|pud)_leaf(), hard-coding it to "false". Note that it's missed to define pud_leaf() before, allowing architectures to unknowingly overwrite it. Still use static inline functions (type checking), and while at it, just use "bool" as a return value. Signed-off-by: David Hildenbrand (Arm) --- include/asm-generic/pgtable-nop4d.h | 3 +++ include/asm-generic/pgtable-nopmd.h | 3 ++- include/asm-generic/pgtable-nopud.h | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h index 1cf739ee38aa1..c6a5a43899b50 100644 --- a/include/asm-generic/pgtable-nop4d.h +++ b/include/asm-generic/pgtable-nop4d.h @@ -22,6 +22,9 @@ static inline int pgd_none(pgd_t pgd) { return 0; } static inline int pgd_bad(pgd_t pgd) { return 0; } static inline int pgd_present(pgd_t pgd) { return 1; } static inline void pgd_clear(pgd_t *pgd) { } +static inline bool pgd_leaf(pgd_t pgd) { return false; } +#define pgd_leaf pgd_leaf +#define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) #define pgd_populate(mm, pgd, p4d) do { } while (0) #define pgd_populate_safe(mm, pgd, p4d) do { } while (0) diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index ff4235cf84d77..4e5aaf253b6a5 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h @@ -31,7 +31,8 @@ static inline int pud_none(pud_t pud) { return 0; } static inline int pud_bad(pud_t pud) { return 0; } static inline int pud_present(pud_t pud) { return 1; } static inline int pud_user(pud_t pud) { return 0; } -static inline int pud_leaf(pud_t pud) { return 0; } +static inline bool pud_leaf(pud_t pud) { return false; } +#define pud_leaf pud_leaf static inline void pud_clear(pud_t *pud) { } #define pud_populate(mm, pmd, pte) do { } while (0) diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index eedee8e3ad68f..6c9bca78047c4 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h @@ -29,6 +29,9 @@ static inline int p4d_none(p4d_t p4d) { return 0; } static inline int p4d_bad(p4d_t p4d) { return 0; } static inline int p4d_present(p4d_t p4d) { return 1; } static inline void p4d_clear(p4d_t *p4d) { } +static inline bool p4d_leaf(p4d_t p4d) { return false; } +#define p4d_leaf p4d_leaf +#define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) #define p4d_populate(mm, p4d, pud) do { } while (0) #define p4d_populate_safe(mm, p4d, pud) do { } while (0) -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv