From patchwork Sat Jul 13 07:08:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13732355 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5ACAC3DA4A for ; Sat, 13 Jul 2024 07:09:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65A186B0083; Sat, 13 Jul 2024 03:09:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 60A356B0085; Sat, 13 Jul 2024 03:09:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D1766B0089; Sat, 13 Jul 2024 03:09:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2FE1F6B0083 for ; Sat, 13 Jul 2024 03:09:03 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id ABFF1403EB for ; Sat, 13 Jul 2024 07:09:02 +0000 (UTC) X-FDA: 82333852524.28.5602D2C Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf18.hostedemail.com (Postfix) with ESMTP id 73D041C0021 for ; Sat, 13 Jul 2024 07:09:00 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720854506; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=khGNU48GKZvL2aKFycHBrjGhZBvYPLWK/qyN0wYq/X4=; b=Z2k2XQCFHrGMnL3EQa+DDyKyuz0MxeA1SjfZP5eUJozSE6HFNYHiRYDk1+5zhzQ2sAx5pL 6SuYtWUX8f6g8SYC25cojvglxBWdzYk+7dTO1e+//UZXnrjbBi8rIQ1rK1voSxk6oKuqFe sROb7xQZiAkOol/lwmPRnedJwzQ1MUs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720854506; a=rsa-sha256; cv=none; b=VY7+6EOrmiEydOyjpp8ywrY2K4HpOnK5Xsfc+fJKBjL1H3wWRXFhnJKeFpzVMiZKW5TspE bDX+cH5nynb0t1q+CL0ox8Q4uAMTEFxJW5MlbZpZxGro5CwFGo612PBn5Ptn2hJvoa6zn4 K8m0HJNT0HAzIPz5FulewR4lKyxZEr4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WLfhT746xz9sST; Sat, 13 Jul 2024 09:08:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EcLfv5DIvfXK; Sat, 13 Jul 2024 09:08:57 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4WLfhT68YXz9sSS; Sat, 13 Jul 2024 09:08:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BFAF98B76C; Sat, 13 Jul 2024 09:08:57 +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 Ht0A52iiwZyr; Sat, 13 Jul 2024 09:08:57 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.233.195]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B32A58B764; Sat, 13 Jul 2024 09:08:56 +0200 (CEST) From: Christophe Leroy To: Andrew Morton Cc: Christophe Leroy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, Oscar Salvador , Peter Xu Subject: [PATCH v3 1/5] arch/x86: Drop own definition of pgd,p4d_leaf Date: Sat, 13 Jul 2024 09:08:23 +0200 Message-ID: X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720854504; l=1436; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=jETqTIBrbMCiSKtThDBVuiOakjqQZl9LJXDhA4Uy90Y=; b=j42rjo6o36t5FwwD7Ik5HJFIbBLA/oCUlT32r6QXUQT1OdEHDQG6EX/TeG2Jo+q73BQzLaMAy OGmrGbcVS1wAtLcieRc2n/Q4O9B0lUFj2TyovGgx73fb20ZcQs3cJV8 X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 73D041C0021 X-Stat-Signature: 6spwjku66pbppufw69m73fqx4kftajhp X-HE-Tag: 1720854540-571882 X-HE-Meta: U2FsdGVkX19jXbRDq46sr9kDCmyNRREaCvsIRvFzzTkYPmnaz3sjGVNxZQppaaGhS5/VkWiuIPlh1Z/JjJM8vmyecWEvJzU9aoO8EVgG7oHb0/L+bdt1+GRIclC6zRUWShr7a8hBnVmEhWA39Tir83XOLb15kCLd1cXCki3c+jIJXTHnkIDxCak/vVx9Nt7xEKcnJ9U0qiPJc7FJGYMkT6CjWFJ0/L6ITx8ehxg3T8oPZAcrTtEm9StgT8Jg37+amhXdIqf0Vzxd3bOQ4T14ypp/ERtQtRFiUXoOtwomWGRFPja8UYkwIxdhbPRISWFb5dGCyso9dQym2DN/r7JRFq0tvWUyR9xv2lp8cwLfWoorxwySMY5aJyQu9xsYc3Kl7xO3y0Vun3XB7T6/3NYyZZ+S7gg5l2mA+I5dB7xFForeJ668gRE8S8Wi6OvatYDlAqHxPYAmTvBq7hiVPx331lIItPuJe4C3kE9e3JOAA9O/oj/7A9+zuPYqo7RiIGTx1uNIvbsA88onSpPSnP8NJ86hFQQHK9PtvPfUi8EyAP8MGn7kKPuGtoIHbBVzMtCMUBvQV5eV7TNsk0csOSTqF6LNYqzxs4PozfIE2+jr3rsHMPFITpELHzPk/7sq+mYwL2cTHZIQBD4ARlcUZGZB4tAG/fy5lFNEY1ctvxHZJOBDn2MSZlfa/IfRhSp1nrpaV2l8C1X0CcYxEIMO2r3g7G0HVBjvcBlbZpJIQhoXzqUlIhtO/pBgx8ajReO6328WMLv1f01/N7sP52/3xBk8Tzbv4V9TXioBOn8Rs1dvrAd28UoPf4winlAOLIptbZs36EGcYKwE7ZAt73KfOBp/0UbmsrZVOhMAFbkDo3gwDt9bMs4C1fn92qi5V8SgIrRksf93fDAqNS9hydxpUNAPQhoHWzO+9U6Gadp2tYH6sIc9z9vtcfBZoYJGQBpzq8eKuwlJFWLPMxtHZNDtZHr oeakS0qv t455fSzAbPdEILnv8PSspKARjRDpvYwBVldpsriQ5k4kWzSNXh+q/azH796Sew13fz0BrukUW+eVum8yRPXPpO/DJP6oEoKLEzDUk5107JHWeU0MgM8nxhWE/iVFSy0NU7kmT8FDWf0cBHvBEtnEKuiAxtk6AjiCbhObp2yaTYfC8fUf9o9IV8haHriD5G/HRvUHO 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: List-Subscribe: List-Unsubscribe: From: Oscar Salvador We provide generic definitions of pXd_leaf in pgtable.h when the arch do not define their own, where the generic pXd_leaf always return false. Although x86 defines {pgd,p4d}_leaf, they end up being a no-op, so drop them and make them fallback to the generic one. Signed-off-by: Oscar Salvador Signed-off-by: Christophe Leroy Reviewed-by: Peter Xu --- arch/x86/include/asm/pgtable.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 65b8e5bb902c..772f778bac06 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -252,13 +252,6 @@ static inline unsigned long pgd_pfn(pgd_t pgd) return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT; } -#define p4d_leaf p4d_leaf -static inline bool p4d_leaf(p4d_t p4d) -{ - /* No 512 GiB pages yet */ - return 0; -} - #define pte_page(pte) pfn_to_page(pte_pfn(pte)) #define pmd_leaf pmd_leaf @@ -1396,9 +1389,6 @@ static inline bool pgdp_maps_userspace(void *__ptr) return (((ptr & ~PAGE_MASK) / sizeof(pgd_t)) < PGD_KERNEL_START); } -#define pgd_leaf pgd_leaf -static inline bool pgd_leaf(pgd_t pgd) { return false; } - #ifdef CONFIG_MITIGATION_PAGE_TABLE_ISOLATION /* * All top-level MITIGATION_PAGE_TABLE_ISOLATION page tables are order-1 pages From patchwork Sat Jul 13 07:08:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13732356 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 433F2C3DA45 for ; Sat, 13 Jul 2024 07:09:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4D516B0085; Sat, 13 Jul 2024 03:09:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFDAE6B0089; Sat, 13 Jul 2024 03:09:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEC616B008A; Sat, 13 Jul 2024 03:09:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 92CF86B0085 for ; Sat, 13 Jul 2024 03:09:07 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 19693160E31 for ; Sat, 13 Jul 2024 07:09:07 +0000 (UTC) X-FDA: 82333852734.10.DCE20E8 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf19.hostedemail.com (Postfix) with ESMTP id DF07E1A000A for ; Sat, 13 Jul 2024 07:09:04 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720854510; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l1XU3EKWHuobuUQ7feHm0lem9WA3Xe11QjY2jKcpXo0=; b=sUZWhau4E45FeJ7SAVNlViozipLC+CE/szWwHMSa9WPwXTHN+eb9o53bibyIrJEWY6K863 qrL61iKTBOc/Er5t1JKybIy/4OAyGX/lm73EU1pz+OlhuqeoK7QEsGJOu1j2HdHwmp6yGa t/vp8paRAKnFLC2xa2+lG8qWn12cphU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720854510; a=rsa-sha256; cv=none; b=NzTOMw+e7eB4zg0Y8LhYzuhkSSFcAD+e0QnzccU/8dFwhOsZ1+BRIus91vfsPF0HuGfLVF pQA0Rvr/YcIaWijAA+za6hjcmh3yw4t3Br9btmlf+AbK8HAbkGZF984e0Z3Ez2Uc2/M9So eMGAFvqho5OFhh+3kzfzNRWLBxwOi7Q= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=none; spf=pass (imf19.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WLfhW0n1Bz9sSV; Sat, 13 Jul 2024 09:08:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NT0I5H53SC1G; Sat, 13 Jul 2024 09:08:59 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4WLfhV6fGyz9sSS; Sat, 13 Jul 2024 09:08:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D26E98B76C; Sat, 13 Jul 2024 09:08:58 +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 0WXuODkIT-v3; Sat, 13 Jul 2024 09:08:58 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.233.195]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C367B8B77B; Sat, 13 Jul 2024 09:08:57 +0200 (CEST) From: Christophe Leroy To: Andrew Morton Cc: Christophe Leroy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, Peter Xu , Oscar Salvador Subject: [PATCH v3 2/5] mm: Remove pud_user() from asm-generic/pgtable-nopmd.h Date: Sat, 13 Jul 2024 09:08:24 +0200 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720854504; l=2533; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=iBVqoMJazAvRQUo1vTp2Zd43IQ2OKhUaCoVnbqsBTJ0=; b=jJMk8U4y7cgZ/vp8633dMxDk0wPNiAX4F6OCHO9eyw5ASH4oMHt8ifjkUfcz5Xn4tKjD9A2nJ JWThXhe1dp2BhqiFdgOfAEseuosECaD6ssSvIM65cfPqwfXUql7AiTb X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DF07E1A000A X-Stat-Signature: o97ribxn1or3m3z3fqh77j87e9hwwacd X-HE-Tag: 1720854544-497761 X-HE-Meta: U2FsdGVkX18WypbvK5SffsYrQVqQGUFLd/8luFHybrLZSWtfj11GLLouhEyrWC9KbbnDHV1+rpqQggKin0nNWnlcOKC90/CyPqBQju/Eeuh+gdCwusOorygL5qEG+/vJKtj6Dv0OZnBaYRJxIA2z1SdodI6ouUPyQxgs4N4Szphieeo5iDTVWX1Sy0nwVmJqrgwLCsgRwoMx9KZi2twwKtU14ICfQAqrH5Iepyo6ljdzQmy9omX5Vs9L5YVuqv8zc5RcaIuOBTVs0N8ULuRDLEVH3t3WcC4eGVsUW7jCJAhydUIhaI5qUx9Wk757Lx4A+5DgL+BMV0GrHVIBB9F3tJMTUl8yju1XR3jwTxeYQ2tRyTo4hZmh3n6/7Ah9zYxS0gsswaFVfIWc84HBeTnmQ2TXgheYq5evBMmJDtMBsJ2feyZ6rfl5nTaiKJh3a7uUd4WSKpDSt5p54VfUisnWmYo/xMkIj5HNQI/FOsl12Rf+VpBvKoZUhTPUMU6vMcZFQ0cxqFy4awbUVzqsx4AgR82gwv/jZmMQOi+i8aMkZe9cV8qRA1wq9VKeTFxq0aoQXYq2AATpTf4odkMsjEfcwifDu/Ou/2j3vtQ+B2do59rcFrydR8ISU4mTEAfG87Qf1g3cPr8nlYI1CjXrtfLvTFj29PTHsunzo17Ffy6EV3ot8GtYVeHqEzOdsr73BK40HQEdYiXhvzEAU0Jw4TdY1AFwJtaZU9arlXTkatYEiVxHxxkL+WYuu/X29TjARGGbMQYY0WmPtNwJ4p6+ekljmB1O8oXp8ZgVXOUPPHOg+wRGGs3RlxTew8hSqK5hJLnxTY4E9fIZ71ofP/c/AaWpIU9TsT/41/Sp+i5QmmvJqQzZCvhTdvBO2H1E8q443Q3o/hnu+yMUuN6jCd8eSutXWtWf2eMSpmc5xWIEmfF8iU9pFZVo/CWWrjnuTjdGxSnzgTHpidp8rdhuDcJxR/r gBm63lpj 0VB1yUydyu7tlF4fUcH4Q316tCxFH+16Rhj2gqXNvQlew5Rw2v5kxfuKdMY8hg4zwoq4aoHkYN92OneqBruAQ2ux95v2eYtpbaj+cKkSRt5BNfySUUdJhWlCBfc+bn31/+k4kmB3oJLly5rUdbEUyGPPJ9Yn8flPMLNA0UXM1c3HeTImvEGhzAEJ31PeLrZkBEKLJZ4jyl+hUaT0= 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: List-Subscribe: List-Unsubscribe: Commit 2c8a81dc0cc5 ("riscv/mm: fix two page table check related issues") added pud_user() in include/asm-generic/pgtable-nopmd.h But pud_user() only exists on ARM64 and RISCV and is not expected by any part of MM. Add the missing definition in arch/riscv/include/asm/pgtable-32.h and remove it from asm-generic/pgtable-nopmd.h A stub pud_user() is also required for ARM64 after commit ed928a3402d8 ("arm64/mm: fix page table check compile error for CONFIG_PGTABLE_LEVELS=2") Signed-off-by: Christophe Leroy Reviewed-by: Peter Xu Reviewed-by: Oscar Salvador --- v3: Added pud_user() for arm64 --- arch/arm64/include/asm/pgtable.h | 1 + arch/riscv/include/asm/pgtable-32.h | 5 +++++ include/asm-generic/pgtable-nopmd.h | 1 - 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index f8efbc128446..c818b3328704 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -812,6 +812,7 @@ static inline pmd_t *pud_pgtable(pud_t pud) #define pud_valid(pud) false #define pud_page_paddr(pud) ({ BUILD_BUG(); 0; }) +#define pud_user false /* Always 0 with folding */ #define pud_user_exec(pud) pud_user(pud) /* Always 0 with folding */ /* Match pmd_offset folding in */ diff --git a/arch/riscv/include/asm/pgtable-32.h b/arch/riscv/include/asm/pgtable-32.h index 00f3369570a8..37878ef37466 100644 --- a/arch/riscv/include/asm/pgtable-32.h +++ b/arch/riscv/include/asm/pgtable-32.h @@ -36,4 +36,9 @@ static const __maybe_unused int pgtable_l4_enabled; static const __maybe_unused int pgtable_l5_enabled; +static inline int pud_user(pud_t pud) +{ + return 0; +} + #endif /* _ASM_RISCV_PGTABLE_32_H */ diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index 8ffd64e7a24c..b01349a312fa 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h @@ -30,7 +30,6 @@ typedef struct { pud_t pud; } pmd_t; 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 void pud_clear(pud_t *pud) { } #define pmd_ERROR(pmd) (pud_ERROR((pmd).pud)) From patchwork Sat Jul 13 07:08:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13732357 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1F42C3DA42 for ; Sat, 13 Jul 2024 07:09:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C2526B008A; Sat, 13 Jul 2024 03:09:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 371F66B008C; Sat, 13 Jul 2024 03:09:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 212E26B0092; Sat, 13 Jul 2024 03:09:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 025706B008A for ; Sat, 13 Jul 2024 03:09:11 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 774ABA2F7E for ; Sat, 13 Jul 2024 07:09:11 +0000 (UTC) X-FDA: 82333852902.19.0CCF67C Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf20.hostedemail.com (Postfix) with ESMTP id 676671C000F for ; Sat, 13 Jul 2024 07:09:09 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf20.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720854510; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VUbJGBUtYkL0HCKm49pw+6gboq/9sc9+tQT/FWl5FYY=; b=47x/Z5j/n4Zk7POKJyrb+myCtQAJ118G4Ux7zGE7ttwpV2Ff4J/00gAGsHU0n9WE42ktSx i9N38sInASLEcLH68H/DGidicpu7xNYE7Iy8OZLkRXvaxRRB5IZ4Dpeaoxru+U0N/dzPHy n1qbo/h8BVgBEjo9j0K4gAHvvyYrpmo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720854510; a=rsa-sha256; cv=none; b=lzzY+bkhybx5MK3srBBhCU3WCgsGqFlfA6kqCV1Geg2YsVM9aBShWD8axNgQmVIQg9qZUS yAC9f30nOPR0vuiAmYLjNZ7lprjEF0ZQnEZ1+EBSnFkwmLzTyehDYqF6pRY4uWv6UmnhtA msLL5f3nLG80djP+6J8CIHi+iUT+NI8= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf20.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WLfhX1pTzz9sSW; Sat, 13 Jul 2024 09:09:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QGR30cHzyt9i; Sat, 13 Jul 2024 09:09:00 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4WLfhW68VNz9sSS; Sat, 13 Jul 2024 09:08:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C0DA28B76C; Sat, 13 Jul 2024 09:08:59 +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 Is4Ot-2G3sfo; Sat, 13 Jul 2024 09:08:59 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.233.195]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CA20E8B764; Sat, 13 Jul 2024 09:08:58 +0200 (CEST) From: Christophe Leroy To: Andrew Morton Cc: Christophe Leroy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org Subject: [PATCH v3 3/5] LoongArch: Do not define pud_leaf() when there is no PMD Date: Sat, 13 Jul 2024 09:08:25 +0200 Message-ID: <732f3bdff0eed9cadfd35c698fd625e6e6cd6a04.1720854135.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720854504; l=1137; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=RQbVBWOxUSgTrrtTd+PLaiyfFRNFBzohHDDwKNmlF88=; b=kyeTq4tTk01pp+vPiGqPZ3xAI/bTN/2nOUDzVVH38OHwoM7j5I4X1quNwT1FsruuJa0FOTAwZ rE5KJnkCyhRC1DTqMd1fiL38cWn3qM95rUdVmXFoo9KKFZEIFgqwdKA X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 676671C000F X-Stat-Signature: wangyicbxmxkhooyfnng6rs9p8uw8tff X-Rspam-User: X-HE-Tag: 1720854549-284250 X-HE-Meta: U2FsdGVkX19KMquwyKpAq9C12/h5a+wi+tJxLIVlKViDXceLx2pykDYAMSWKdID+oFkqckHr5vjJjVfJgBXhlML4WoYuI/F/tWa+WvNxcxaIupktjnGb/QvucqWVhmvh7k43gpsUiF+4JFTNyNcVESfbzkUq1q7YrqjDu4A+sij8t1YXCQroXk6zIhrM3fjClkwC4QkyP5iVyolt8L7Ax8J4fsvcC7hX8BVChFUKLdfWgVhVMoDdvuTbGlRWky+Ypsa2ZFFlStgFv0a7o/qq/waGo6kRM1foiFXggfniAKsrlviSMikGjqWqeCRYJT52KnxURujLFVoEj7yXGYhA2WBMmmr8tjeYy5jzz1iCngK1GFUsCUMRp9XjIFHCnnMzoXtzDswS26QbGj9iHQZfiElaoQkRUbXYPJmVqsTlb0qnYkH9cZx2qvhRSRA2J9qi7gOx0C2NdP5Bi3dck0OHS1/W9Iwdiw68Sw0akpP6+Ahm5HKJmnPOTnwMlxrZaXUgSY9IVUeOlpoFlOE4pJ2220HBPxA0Troh4zLLotI+Tj1jvtUqBe29if509gtFsDmnF589brss3UtZa1hZeNoulAc4KPAZjjhUYsAJ8x5OnmbTOzQh1SpxScL0+AFxWI1FDj0MlwhnhBdGFjhP7Ju8qcVj9LzZNOQ3YQ3YrpkXxzgsP/iNTKyvp6yxaNagZKSM4UisIVQDOd4/uHn3sif5g385+SCGxe8CcyKbf/1G3okdWUz1MR0jaheKnWTsUUaiWaQL6Ajtj4+M8+Er9j2q4bkRIuYGmLh387GxmYPwxdRy/UoTkRKMTv4sBzyVh1cRUpk4DEUwtdsJETWeGtGB60236jIR4iTq2y8TB6BUl7+I4+McSgI6oxIWaAS8kcyN1wadCZzPuTkJnBmDX8QTwbK80kKe2IsNkmZ7mCVLppDxGuzXeIXyl+Z4NRZm1Ubril77of7+vgj5QprND7T TawBLE6b 1Qm7wFnRjcCCzi95WM22XvbC4Eix8jRjaXR82Htqp1n02wuQLyfIUG/Qz7Xz2NjRkx0vlWXsfqn68ie64Vwt2oF5pla4KkBHYriAJx36vGdSwxA6nNItAFa+e4YlXBrDALML8burdtcDVd3VmmFCRC4mbNVGRJpe69eUtkXNyXEB1IOLFPzLOLcHjTxF0qZSptoznDeiYZ35MS2g= 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: List-Subscribe: List-Unsubscribe: pud_leaf() is already provided by asm-generic/pgtable-nopmd.h Do not add a macro that hides and overrides the static inline definition in asm-generic/pgtable-nopmd.h. Signed-off-by: Christophe Leroy --- arch/loongarch/include/asm/pgtable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h index 161dd6e10479..da91b2d8bc6f 100644 --- a/arch/loongarch/include/asm/pgtable.h +++ b/arch/loongarch/include/asm/pgtable.h @@ -207,6 +207,7 @@ static inline pmd_t *pud_pgtable(pud_t pud) #define pud_phys(pud) PHYSADDR(pud_val(pud)) #define pud_page(pud) (pfn_to_page(pud_phys(pud) >> PAGE_SHIFT)) +#define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0) #endif @@ -611,7 +612,6 @@ static inline long pmd_protnone(pmd_t pmd) #endif /* CONFIG_NUMA_BALANCING */ #define pmd_leaf(pmd) ((pmd_val(pmd) & _PAGE_HUGE) != 0) -#define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0) /* * We provide our own get_unmapped area to cope with the virtual aliasing From patchwork Sat Jul 13 07:08:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13732358 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53729C3DA42 for ; Sat, 13 Jul 2024 07:09:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CEA016B0092; Sat, 13 Jul 2024 03:09:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C9BE46B0095; Sat, 13 Jul 2024 03:09:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC5A66B0096; Sat, 13 Jul 2024 03:09:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8B57E6B0092 for ; Sat, 13 Jul 2024 03:09:16 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 47C0B40DF3 for ; Sat, 13 Jul 2024 07:09:16 +0000 (UTC) X-FDA: 82333853112.22.AC7DF4C Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf17.hostedemail.com (Postfix) with ESMTP id 2144A40007 for ; Sat, 13 Jul 2024 07:09:13 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf17.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720854526; a=rsa-sha256; cv=none; b=yHitOIndNMOT33OuXJfS6f9nSnmrJL78MldQU0i7+QK8nqXFXWt2q9OyJMROHUEyOyWi7Q uHZLLlaFZbz8vem9+MdhMiEWxsTzS1/VAPguJ0lMB5FmIyB5J0fj5V+jS4+Pyd6DJYatO2 arjVON4XB4Rz2CPCCDTDeisGrgsfeHI= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf17.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720854526; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/6r4ajoFwKI7Sx2g5/kngMWszUxdPl4hxNWlsqQR4Fc=; b=Do3OBUoWr+qLGCNLEG0u2pjc5wYOpIO2sdzPtk660LKv2aq7mhBLCKHqZ2XFxiLDtbIGLR Q3A+D6DwHWBUVHfkcKbe+2juxzHvKM33YyMPLZdRiBz8dbLGYhBsaxH+IM9Q6CC1/AuGWY M3cYYXjArG2DiObD27wtqhmOGSJ192Q= Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WLfhY1Ky4z9sSY; Sat, 13 Jul 2024 09:09:01 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A-AU9RRVGJNq; Sat, 13 Jul 2024 09:09:01 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4WLfhX5qbsz9sSS; Sat, 13 Jul 2024 09:09:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B4D378B764; Sat, 13 Jul 2024 09:09:00 +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 g1jIk9GeChEz; Sat, 13 Jul 2024 09:09:00 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.233.195]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C2AE78B77B; Sat, 13 Jul 2024 09:08:59 +0200 (CEST) From: Christophe Leroy To: Andrew Morton Cc: Christophe Leroy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org Subject: [PATCH v3 4/5] mips: Do not define pud_leaf() when there is no PMD Date: Sat, 13 Jul 2024 09:08:26 +0200 Message-ID: <1cb28532d832b48b0a41f169615fec40546a5398.1720854135.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720854504; l=1388; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=+hQ+cxc/Ik0JwvL+Bfnn1kxrsZliqHaKk8FlBgA+6Fo=; b=PLrrIe9d7K8ajU9r5dWm0pYSfP8m3PYAmv4ou0R1F/fHVq5h7MJVKy8XI87mc+oO63w30Q/0N 999CdgHyAKNBeKPL3EK6axF0jxci7jZZYgenwddYCjhEEnjixrFTwoj X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 2144A40007 X-Stat-Signature: 7t1qujfxprr67fw7hoaarkbj8okpjoxn X-Rspam-User: X-HE-Tag: 1720854553-759603 X-HE-Meta: U2FsdGVkX19g9a+JVJwdHeit0mdT8ew0ImqJ7d+MF5Ei7A6rGoRNYe0vRJQ6yNksdhckLWDKvMKU0aGD9vCJsyUXzUzCYnlkV3m7UsZ0fe3EclqvnOZcNmF6/jaLDZrfOR387us9k8q++dw1TO9hy5t7wSznYUnBXNYsOppt5nQTt9sJsdmGKCBw3Oog5trs038a8rNjvwKJYKnbKa0yMfTz5dMphjeVNSEb5TqV1jBNExmd5VvBbcvNY16nc/RwPZ8RfnfgYL2olwmw/1jcfQhhYlOKeKof01xFRfu5hbmHPQXv5mWvq9TthXzsZOwOlEV1RwRuQkWkg3hfFCQXSzqkJ8VK/Hll1/yzkh3+cQxqYKimUjssT9eLmuvRpdxVYvkrxEv60eq17mjPNi86TF/ZxM4uL51e1X01r2yn2B+hxa1Co4htvfGMlX2i0B6snY9/YiL37G2o74MbyrA362aNbxKtQpUxeCNniSs6YoFBTkxoKzRcFRMCnrFZ+ovX7+X5uoAxBd8kZJchwSzbTW/gWAjkBiyBhK7u6YOUP70XkOW8u7yGFkkFSMWV6KvXyUTh5qYL4WUVVhYmYK8IjNkeYUMmYzubruxErqfjp7JcyFi1QJA1fcsDN7I+pg25xirvBWnDQ52W+Pbs/k66+ie0tzKyvr1J0LdC9xbtLdIRXj/T+GEIlNdfrCWbZBJzk8g4BUGVPrLGqfOOsYV2F3I2dK1ME3OeBt4E3QN+J3/iS4fchuOICTiBVN38K4htn2quY/o7Ip8KJ27AWenYTRlc3KEmMPuctwDxKzyOUvhsj3W5sQcGYKP4SmkfX/cSdX1sLirzbgF1vpwhD9kMJ4ZCslLWZpLreLT8IxIE6FVlxPbKUfkSEDGKvw6KT+7HBpxVIDhgvS9tg0K3w0ksDy97Qvj7MSR9SKv5fWASvHB3mZWoMOaBqaj8ZlA4e8XMYmWVH9u0oB+ew/FrFIn iKOEZP4E +qgABW469p20zrFVKScC83EFYvjxvjyhdRmba49AbyXjT8wW4JHmpD8vbiNFvvKisrBYxQTKZIu9tnpxLuksx4VLPtwP1AxNXWFXRLoSI1u4u3YXiVq2ap2UwafCN18Bkm6fk0r/QjGOH4o5l7WfYcB/FElKG+GefjXT/UMCFas62keymFBDPOh5bFjDoY16rL5q4wb1xkKyZDDc= 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: List-Subscribe: List-Unsubscribe: pud_leaf() is already provided by asm-generic/pgtable-nopmd.h Do not add a macro that hides and overrides the static inline definition in asm-generic/pgtable-nopmd.h. Signed-off-by: Christophe Leroy --- arch/mips/include/asm/pgtable-64.h | 4 ++++ arch/mips/include/asm/pgtable.h | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h index 401c1d9e4409..d2de4e2800be 100644 --- a/arch/mips/include/asm/pgtable-64.h +++ b/arch/mips/include/asm/pgtable-64.h @@ -294,6 +294,10 @@ static inline void pud_clear(pud_t *pudp) { pud_val(*pudp) = ((unsigned long) invalid_pmd_table); } + +#ifdef _PAGE_HUGE +#define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0) +#endif #endif #define pte_page(x) pfn_to_page(pte_pfn(x)) diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index c29a551eb0ca..28233025f884 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h @@ -755,7 +755,6 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, #ifdef _PAGE_HUGE #define pmd_leaf(pmd) ((pmd_val(pmd) & _PAGE_HUGE) != 0) -#define pud_leaf(pud) ((pud_val(pud) & _PAGE_HUGE) != 0) #endif #define gup_fast_permitted(start, end) (!cpu_has_dc_aliases) From patchwork Sat Jul 13 07:08:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13732359 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3940C3DA42 for ; Sat, 13 Jul 2024 07:09:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 794046B0098; Sat, 13 Jul 2024 03:09:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71BEB6B0099; Sat, 13 Jul 2024 03:09:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E37F6B009A; Sat, 13 Jul 2024 03:09:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3C19B6B0098 for ; Sat, 13 Jul 2024 03:09:21 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EAD7FC0E14 for ; Sat, 13 Jul 2024 07:09:20 +0000 (UTC) X-FDA: 82333853280.05.C67F208 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf04.hostedemail.com (Postfix) with ESMTP id C58704001C for ; Sat, 13 Jul 2024 07:09:18 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720854532; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0jM7X5TZsVn0ONkhINl6fEm19w4e9X/koSgxpMBLVAc=; b=h/g8ttqm5pI4PCcxAJUxjW7hB3nDbuiNx4mgGIQGsJ8fRxGBCWEYy/jt2nwNlJUM/SCPuX Ou+WYObOfuNqp2pL+PweUHatQNs1JF8KqiorE1DeC1vzxYqoSFUzH/5Tycee1NgpYVZwoG 7RYpYeNj66EmSMheW9f5hxHZz3nfSB0= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; spf=pass (imf04.hostedemail.com: domain of christophe.leroy@csgroup.eu designates 93.17.235.10 as permitted sender) smtp.mailfrom=christophe.leroy@csgroup.eu; dmarc=pass (policy=quarantine) header.from=csgroup.eu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720854532; a=rsa-sha256; cv=none; b=HMLcNTUbhve7fI64xio7hUmLGpxrWrLVljlr3YDTfTkBbCHiXjjfocZUvxuRBt03DrlzvQ rTI3YV3gTGJJ4LEA3j+TNSHeefWDDaaFB0FiqN856893sRW0cFWQlKoIzAViWsaOcxi2ap lbdavi5z4oQbgKrvKgOlpAXDrP1q3V0= Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WLfhZ1Ccnz9sSb; Sat, 13 Jul 2024 09:09:02 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rBAPNnN2erdv; Sat, 13 Jul 2024 09:09:02 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4WLfhY68WVz9sSS; Sat, 13 Jul 2024 09:09:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id BCB5C8B764; Sat, 13 Jul 2024 09:09:01 +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 U1NlTXZ3sw-T; Sat, 13 Jul 2024 09:09:01 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.233.195]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B6F798B76C; Sat, 13 Jul 2024 09:09:00 +0200 (CEST) From: Christophe Leroy To: Andrew Morton Cc: Christophe Leroy , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, Peter Xu Subject: [PATCH v3 5/5] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h Date: Sat, 13 Jul 2024 09:08:27 +0200 Message-ID: <7b6f39f3cc9823e0a058b27f50ad4f47b2e10979.1720854135.git.christophe.leroy@csgroup.eu> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720854504; l=2504; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=9cGeujZtX2c/zEf05hq/l7o1WBt5GJFv+9LPfky90p8=; b=MN2/woF7LqGhnWnq57H61zGqJsMcmtZviZwr/m6VoCoVv5XepEx+34tqeLFna5lL+rtgkoHC6 84JnWQ04MY8AFTasVOBH1guX6oXN81IRpiabqc6NIYejAVLsU1O2E4y X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Stat-Signature: h7o1ui93w9qp9dykn7thnsspfpbtyuno X-Rspam-User: X-Rspamd-Queue-Id: C58704001C X-Rspamd-Server: rspam02 X-HE-Tag: 1720854558-19080 X-HE-Meta: U2FsdGVkX1/GFzHa6uH983jk9MZzI9R/qDIQxXTaVylHctKNixJXz1pVdtIXSAFcQEdZ1mY11mfjVyptjhN+l4nht5kYAk9fqsZFhSvid2G2mZr4prkA6fspF05lRgUbgq2BpK0Ug3VlkrS2jQIkHjZAtUA8l3gn9nsIZ6pEUeFOboPzGod3T1w+nUea1yrYIjO54XK848tcG1TvhP0/DTS/DcuGnk8ZPBIJ/bPc32/q5BFHapCJ0reD/M0ao1/vjHd/jzPgaTmOod/bLBmxeTqK0d7J927VdG4Zpy7ytkGzxbhpwGr4UDzK4KNCjxYxCGwuCWhqNCm9g+pwTK2Q7aQfiecWhlp8MmF+zPyKmBvMp6ZkAWYbk9oulTXj4UuCT1K46cZmSRAO4mvHxD+atTLdYdICqLZ6kYKkXPoivBGKvmhyP41ZvSww4yVFex/uoXNPIPimLf9FMmqak7STFdP2WIKF/NxLIPCr+fAHecQUrDClxUlEYCi2J4UjVxRlTOee3KVsFkL8IEeYw5ApyGO+ZFk8czHo2pOEELtDKREy2m7vGNq+CSMk27ekM7WYNLP49jdWOGhws8paUNTsECLZqhxgi2tRP4yQxYSkfCB2INViuSbRUf3UQisBbrXflD29oVzwAtHW/NB3swwzqw3OHQZC/Hn1fAhD38O2xSRcYCJeFzXKjdqS2AGfqecByoZULfdvqwom8bD3GI6GU0dFDtzqJavlm8l9HfechmlV4bpYmPqQBlqK7sno3Eun4iSUvd8on5qbNpVa4/W9sy5XSUv0MKvcyBw5l34s13uXkb13iyI8aRqdHQj0QXyJ2zndNEF2Uqf7U+ceBA1LuCwDAmY8uK6TqVADtkFn7kdckE87QO2vc2yAN7T8kLh9gvU9X9CpDohn6xN33l986ayxg8Z5udjNlh9hlupDhdTeyXfReoiZnDFOeCzMdo5RHxd7gTBdTyNKk5N8JUR jDlzR5qM /RugNNfnqbyCLCG87RBMAdjE8VJoe4GkNVoaL8zKuLuQ8sUaOav76cgBCV2oWQANnk5DWldIN0I/TXCW+NrHQ5K0hbh4wIRyysA7sSDC2FovDsav9s1o0EOLTq6SXNxY7hFuclPxg/thNsSTp1gcvqQHn72oAWFLcp7VvrcyUWBfYwu9K1jCMU96mjtiiMj4ySYCeGr66IpN3yaA= 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: List-Subscribe: List-Unsubscribe: Commit 2c8a81dc0cc5 ("riscv/mm: fix two page table check related issues") added pud_leaf() in include/asm-generic/pgtable-nopmd.h Do the same for p4d_leaf() and pgd_leaf() to avoid getting them erroneously defined by architectures that do not implement the related page level. Signed-off-by: Christophe Leroy Reviewed-by: Peter Xu --- v2: Added pXd_leaf macro as well in asm-generic/pgtable-nopXd.h to cohabit with the fallback --- include/asm-generic/pgtable-nop4d.h | 2 ++ include/asm-generic/pgtable-nopmd.h | 1 + include/asm-generic/pgtable-nopud.h | 2 ++ 3 files changed, 5 insertions(+) diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h index 03b7dae47dd4..ed7ba008469f 100644 --- a/include/asm-generic/pgtable-nop4d.h +++ b/include/asm-generic/pgtable-nop4d.h @@ -21,6 +21,8 @@ typedef struct { pgd_t pgd; } p4d_t; 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 int pgd_leaf(pgd_t pgd) { return 0; } +#define pgd_leaf pgd_leaf static inline void pgd_clear(pgd_t *pgd) { } #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index b01349a312fa..e178ace2e23e 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h @@ -31,6 +31,7 @@ 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_leaf(pud_t pud) { return 0; } +#define pud_leaf pud_leaf static inline void pud_clear(pud_t *pud) { } #define pmd_ERROR(pmd) (pud_ERROR((pmd).pud)) diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index eb70c6d7ceff..655dfebea91c 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h @@ -28,6 +28,8 @@ typedef struct { p4d_t p4d; } pud_t; 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 int p4d_leaf(p4d_t p4d) { return 0; } +#define p4d_leaf p4d_leaf static inline void p4d_clear(p4d_t *p4d) { } #define pud_ERROR(pud) (p4d_ERROR((pud).p4d))