From patchwork Thu Jul 4 06:30:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13723291 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 A83FFC30653 for ; Thu, 4 Jul 2024 06:30:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1BF96B00B0; Thu, 4 Jul 2024 02:30:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA4D46B00B1; Thu, 4 Jul 2024 02:30:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D45BC6B00B2; Thu, 4 Jul 2024 02:30:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B4C236B00B0 for ; Thu, 4 Jul 2024 02:30:14 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1EA3D121006 for ; Thu, 4 Jul 2024 06:30:14 +0000 (UTC) X-FDA: 82301095548.19.7331DA1 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf16.hostedemail.com (Postfix) with ESMTP id 07E8018000E for ; Thu, 4 Jul 2024 06:30:10 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; spf=pass (imf16.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=1720074599; 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=+w8tkRktYnXEvXcCOXRjycdKM4leZGHCRvt9iERz+QI=; b=lvsbWIP7vymgDbRb+BHS8UpVs1hOgUhIrzZXm28338k6oRhztPifedGIHZuO2WniB5QaUd 6uZ+uS6vjVUyneLhALJdZIKoRiEGrwbBM/g1DZEWQLfKWs7UT0tN2YGeA/OZ/QeykAYtmR 3lABF9V22eFgHZHcJ1Rhvsp+6DLBAtA= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; spf=pass (imf16.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=1720074599; a=rsa-sha256; cv=none; b=evRnfyfSwtagTebNDDWLJ+nq8CDPM40+5MjpFkskKgtcaAje9JqfZxqRi9olzsG1Du8xmR 3/jQrG+rawm0ZfhWWdXUQh3wu/LHEkFgWXDwZsSZKqBr7bkWU2Ol+4vbLGn5XLcqW4Ywoc AJxSEeZUaN8D0AYw1u/p5rBeQP4T3d4= Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4WF6Fr2ZTFz9sS7; Thu, 4 Jul 2024 08:30:08 +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 0IvprGPQSDHR; Thu, 4 Jul 2024 08:30:08 +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 4WF6Fr1r3Wz9sRy; Thu, 4 Jul 2024 08:30:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 2F33D8B774; Thu, 4 Jul 2024 08:30:08 +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 2OEaojhVLPzU; Thu, 4 Jul 2024 08:30:08 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.202.46]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8311F8B764; Thu, 4 Jul 2024 08:30:07 +0200 (CEST) From: Christophe Leroy To: Andrew Morton , Arnd Bergmann Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-riscv@lists.infradead.org, Oscar Salvador Subject: [PATCH 1/3] arch/x86: Drop own definition of pgd,p4d_leaf Date: Thu, 4 Jul 2024 08:30:03 +0200 Message-ID: X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1720074605; l=1393; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=y1Fku5Ig+SrLh/mlbGZSDg5khbyWLz2sNH+Fhxvf8CY=; b=Pn3cDPQjTJsynYwMXz4i7tu+dV52gAPkJmLyMuCh4slMgVe6g/HMgDSmdujn73izysJbgmI+t xg36IxeSmYXAH00CChn+Qo0WztBTLEw0miy96K/UdsZPHZRXd7EOvR/ X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 07E8018000E X-Stat-Signature: yrttff3dny36qujigx4qbu5e9dzbrnfk X-HE-Tag: 1720074610-491156 X-HE-Meta: U2FsdGVkX1+KByOvGITDdWbqtIzVB2xz9TtTiq2dayodcM8qcGoYYDTUzAbCiI8eAALtEsShtCGVnxl5zCleXD+8BU89O1bWRe8T7F7/uWGZ+z5bodMX0Se3R6okA0qGiX9ZfKh8HxOr46a6+bxNFfop/C719WScQxzeTmKrKYWK1u5PgnSKM8OXMZQk5YPF24tzIrDyrAtdpaD7BYjxdyuhJIM//q1gsH9N5OgSSbL/SuATWZ70nb9sQtG3VoystdRc6jt2bu9mMlVlIMU52JyWhP0aNbU+Y/Fd6HEpbx7Q0B0FD8OmrVMvyFdRyeap77FqcRKpQ7fjbsjFYQsFyb2z7SuJnNzVAoyjreNnvZJrDcncEianLZO1+iuVZiOGuTcEKQP+aOztHQF2b4sMcBXk9eCP7JwpqOspG/t1aEYShkp1rCoIvfoBOh6pG/MLaqgn2zdAG3N8lGBv1RKQ2CjIKe6bxxNZ9SV+6ivJ9ZUyhlWnpnyCybdDGceIftjKY2XQ7G6V3PKM6DKu83ZgADa8QfzD7NygJttfKVFEZH7xO5iXqQage3dTXNUKJGxwvoNHDaAOTUXr3ROoIJ1ojN1dulyTXpRNTkguOfUijk7o1zhVFl6SsW3IwhHPcl4Xp4XxYPk3gxEluL8Gf13tfOoRvVsD7EpOaNFMeBaGllN30ekwJp+E4QOy2P4xpmdzQN/rtMDEcjoGS2XGycLUg18eeyXcLUsKLefA47U+1lZQK2nFIhQuk7G4FQJeJbg7CXzuyM0ryphm+MVyPcqE6F49mWeK+pq6/1UIYI1NbaJhM1jtfy8sw9vmm2PzuZDIKZU91+VjNaFmjvnV1N3uiFuw+KqhnYhrRkuKcHms1ztKVJaKegJ5tmjbV/1Ej/Jc1ePutKomZu75g76CoBxanuwW8EizkWbngzuLqOvaZj2HEDyF+H5HIZxHCnI71FY5m7WOgIBCMccm0a7wBgC 5Ekw4P/C YSfZTIBCPlOlIIoLxraX5azPjJsyyUlX2dHDSAELCFIOCMW0K9zZdumgN/pBFjwS76iZl8eDnkSJYehOM5D2pwGwwS62ANosFzCP4LB8IINpm1CvHF23ALpclo2Xyc8REKlmNDSZxGo8KNAHRkk1Y5S6I7P0e6ShU1SJa4fkMKNwT24s= 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 --- 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 Thu Jul 4 06:30:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13723292 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 422F9C3065C for ; Thu, 4 Jul 2024 06:30:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C84A56B00B1; Thu, 4 Jul 2024 02:30:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BE5B56B00B2; Thu, 4 Jul 2024 02:30:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A607D6B00B3; Thu, 4 Jul 2024 02:30:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8B7B26B00B1 for ; Thu, 4 Jul 2024 02:30:21 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 2000D160BC0 for ; Thu, 4 Jul 2024 06:30:21 +0000 (UTC) X-FDA: 82301095842.13.0DF4782 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf19.hostedemail.com (Postfix) with ESMTP id 0D47A1A000A for ; Thu, 4 Jul 2024 06:30:18 +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=1720074594; 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=kXLlm6Wxr7Bxgj5fGzNjy34TkL5KXYwxij6j6SAa8vo=; b=YEvoot6HzNoPzW2PB4ycYvBv+0Okiv+qSWlkemUScwiPM2ZgtQjsDGkP2B6g1z9vvH2nF9 a+k5imJUC8sBDy6m3hlbDXmoF22ofjWY+YY1MKjNXZJnmyhjH/eGYyzMbKIQCj5byMbbat U7Ye4HUWCcj80Hog6351UIugxg+pzXE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720074594; a=rsa-sha256; cv=none; b=NcTzpu70zCtmJ5eYvgHFDhhypfne5U/mNT6KLJYSxix6kR3fZn3NSMtKfKzswlSSJ8toWJ SuvAZc7ma4OEPAeY4QdiuRKiiBHuDnuBq7+VQqvTpv5pIXoe4qD07I4iQEc6xjKuIgQkM1 bvrHhK/peexezIB9RTSjgVVh1E/42Bg= 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 4WF6Ft4fTfz9sSC; Thu, 4 Jul 2024 08:30:10 +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 tc2KK6SMybGZ; Thu, 4 Jul 2024 08:30:10 +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 4WF6Fs0MGQz9sS8; Thu, 4 Jul 2024 08:30:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id EB9B48B775; Thu, 4 Jul 2024 08:30:08 +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 FnvUhWgoWsbX; Thu, 4 Jul 2024 08:30:08 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.202.46]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 3BDF78B764; Thu, 4 Jul 2024 08:30:08 +0200 (CEST) From: Christophe Leroy To: Andrew Morton , Arnd Bergmann Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-riscv@lists.infradead.org, Oscar Salvador , Tong Tiangen Subject: [PATCH 2/3] mm: Remove pud_user() from asm-generic/pgtable-nopmd.h Date: Thu, 4 Jul 2024 08:30:04 +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=1720074605; l=1658; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=P+XptGl9DFkWiOOf5gEDy59BT6RaK29b7Gl+mTkrxXs=; b=2RfhmzjlUmgXQ8XQSHQ5dag9Musd8qAx6KQfnrol8V1giJeiO0XXF0qdIX3ZkEHvWqbqqFz4q PEMjcm8RqozAQms57Vznm8NgN2zBt49jTKt2LV/y96A1vqTBkJERY8e X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Stat-Signature: wtx8bqctr4b4mt596ggwnytxzn731htc X-Rspamd-Queue-Id: 0D47A1A000A X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1720074618-753456 X-HE-Meta: U2FsdGVkX1+HgaoGn7Db/7fVmyeHTasga3Tdi0cB/4D0dCKA66QH/uC9eNyta+zNMcaCc7YwiUwqkELRFQrb1WejE1dGD9pIoRHn6HlYgPl9W2h0Lrj+hB3Er9XnyMoI8wo8gDhh3HW1nXb9j4Vg1huVVfAECQOv0nTROrHkhNaKe7CguxnJ0m55HZmxfcMmz0DBrSsrMM1F0V5ojcyeFSjUU9C9an4qS8CNNR4hrt7Ii8QNVnCCGAa6X0MtF8vpErIpX/s5D/y9ML7vFimW4+lNrUNBzJ8P6ux9jPBKtzAnKFDa2RROE9iee7Y5oPTYhULBsWM4XD1rNJAD5TDYACcBU7PqXyQcajebHlT3o8XUPQxgRzmbEJkF/Km1XZymzJ7e97klz7XSOg+AB2Hhrk28f6d/XLnn2IRDrXJC/UhhkYKQael+hqULWJP2R02EqdwEud+hZmxSJd75epja/3pCcvMzvLT0o72lb9jjNUD401QPkHCxYFYsFsGJya+K8ittpgiM4iXcmckUuysrNuxmRzDH8rtIOOYi4Rd100u/m85siRB2nSFf0jQa8DVA/4UbPtbH/j+msPuq9kKk3EmGOlDl5tIEY7l1xKkQkQuCC2dYHKcAtubhT+Loz7QBsUcFMCfS1uDOI6VQhvIKN+f0ykIroe3AkE7o1sEmJHndNdSsCgFQKJ/Iqq7ukMA7sLZ6JtPqUFLOaAUiJGz15Bcy58fEimhNZLXL1IHDV8iDIvgD4AFhynKIZOqfNbCPGL0bpFI2M7buuICQq8CbjeUwCYX3HNiX9NWCz85FXn2siLdpWCmVzTiH+DAqWARalQeTwYKGrg8JFfZcs+ihTGvjkuyAj2IcSobX9dEmcAFo7RvCOvO2H7iyuUjSA1360pkSniPAr+tVi54EyARlnWt7Y1Arh66oL3qi8QfOL/SbEibwXhUpE7a1qiqRpLD11yg+ULJIIvELHYm1b5O b7ZQ054J NACvMmTJrzz4eL37TkJ+VEY/y/AkBMYvaDROCDEZscfl/no7GEgQ6bvpEr5xbh3HSDGcInZef/LjL3L8nZO1X7pufiLuZAtYZ6SEpCMaqTFpTxW7Re1enKjlgZsyKh+iCipSOg/5EFD5QyuI206CnLSmpjjN1fMTomVGbKjizg6ixLg0= 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 Signed-off-by: Christophe Leroy --- arch/riscv/include/asm/pgtable-32.h | 5 +++++ include/asm-generic/pgtable-nopmd.h | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) 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 Thu Jul 4 06:30:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 13723293 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 DC188C30653 for ; Thu, 4 Jul 2024 06:30:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 705F66B00B3; Thu, 4 Jul 2024 02:30:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 68F0C6B00B4; Thu, 4 Jul 2024 02:30:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52F676B00B5; Thu, 4 Jul 2024 02:30:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3283D6B00B3 for ; Thu, 4 Jul 2024 02:30:26 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id A59A8A3560 for ; Thu, 4 Jul 2024 06:30:25 +0000 (UTC) X-FDA: 82301096010.16.4F7BA9B Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by imf03.hostedemail.com (Postfix) with ESMTP id 8677620012 for ; Thu, 4 Jul 2024 06:30:23 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf03.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=1720074600; 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=VCxo9RA95ZXxfCvke4eCxOsciTSuuDApyGKtl1it+mg=; b=WGD8GG2QuiktJJTYXeAnkYxtAAXA1ST+ylN2uKn24gOAxSKe0Ze1oXcfQi5oY8TeXKJd+W Ry37TayYDwsqay04+qz3VgHT4hJf+Djm/TpqytfDJbKd1TciKMUVRV599rEeQFOfmvOMUl cPtRdf/ITdMekdkZIRC4EFm0w+quvto= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720074600; a=rsa-sha256; cv=none; b=fdNFUnGENWWEJ9wZCv3cHK8n2LftwU4mkTC9r6oRPnkjeEjUAx4pVGlRbY5qN4mrtqc2DP mD4f6rwd98jo+7aYJzVwK1wMSMTmQzq/E+mscMwRx4T7bKHOU59vHcPDz1YQOXr5DarVIz +SIil1gvCnVaEIXMCRPAHJQrbxYOKeA= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=csgroup.eu; spf=pass (imf03.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 4WF6Fv1xlNz9sS8; Thu, 4 Jul 2024 08:30:11 +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 tzQAq9F0VSsR; Thu, 4 Jul 2024 08:30:11 +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 4WF6Fs5QfBz9sRy; Thu, 4 Jul 2024 08:30:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A8A5D8B774; Thu, 4 Jul 2024 08:30:09 +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 jUYe5UpM6zxp; Thu, 4 Jul 2024 08:30:09 +0200 (CEST) Received: from PO20335.idsi0.si.c-s.fr (unknown [192.168.202.46]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 049628B764; Thu, 4 Jul 2024 08:30:08 +0200 (CEST) From: Christophe Leroy To: Andrew Morton , Arnd Bergmann Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-riscv@lists.infradead.org, Oscar Salvador Subject: [PATCH 3/3] mm: Add p{g/4}d_leaf() in asm-generic/pgtable-nop{4/u}d.h Date: Thu, 4 Jul 2024 08:30:05 +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=1720074605; l=2466; i=christophe.leroy@csgroup.eu; s=20211009; h=from:subject:message-id; bh=Qtio/5SWrxR4yNgLMS59Jf0uRJ+1ynjUQGU6piFtlq0=; b=azkcAf3wdFGcbqU1O5vMt5uKoTHRw3KHARwsWzN1kcj9JA/2Zqkg3tgnO+WN7dI+hkpsqGuyU Ek7ifyQRmn6BRdM6oZNuS29ECHniE5zPf7j4PVxqF0C1xeD9cC9pPk1 X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= X-Rspamd-Queue-Id: 8677620012 X-Stat-Signature: 4k8gt8dj3ntj7hwgtggrfe3urpcojgec X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1720074623-927636 X-HE-Meta: U2FsdGVkX18l2MH9eHh3H6y1Ho/dD1hNIh6qQHKukdYp+X1eFvL6BLR/1VzdCwmlzz4u2UJqHSRniEAgQsg1XIyXVrScYixWEUzH+udnVu7ta24re5oSYxhGGVYUlpaeoG26ybudDjuYjkhAnKrCiMzD1UOWVybYrna/YcJ7sak+G0EXlkr6VKSHzjb54DMFgBFNElBeawrxUK1JFPOMEdKA61FNVhgH9S7GqWpgrpIXB7i78Hv7pOQKug1Gg/Z7gz+0H+blZ4ru39r9X1NRB8miNK7CFthov3MCsxPX5Vo6Yx/UGXBMucsA8qDzS6ICLaXv9fgwhaGNzssLWdKrz+bVL8JglwlTu02ERdHxjHfOGOdItH8ExGxerH82YJyLV36DV49irswGP+dZf/PyIfYd6EAR80SgfjNftWCQ0454ND9ogDt5UyhSCDZJS14Rfg+jkRnEe8OM9D8xiemCwbh0X3pRc91BNvDsEEOkbwKVagqoyBmCGdV9Cg4GmZCrgYLJltRc0SNsr0x/0is5DAOc82B46GX4MNwnAqDIbU+c10SM5Ksxee+me/xGWMjgvxfvkLJNU/hKe8/7uZ/vEDj5MCKfrG0L+mBok+uMzQUtTbq/8i7SCflvlQZBMAjnymjW7pvLgTobFCpjGwM9/T+lbFD6OgHTMOgiTGMxe/q0uVR4ahBRAFQ1egloz7pkyq6Uj2p5uUp4hD0UgQFzBAEj59BE1hrC6yOgqid98a09+q5MVdGsZNpRDRbWRExizRvR0W+vUKPUhBUe/S1iwBe6OMFIzjiy/fitvlwMsrJobWtspSTwV28ts2PHgWVfwUXDS6GbnRe2YIKrYItrUy/PnkE5IutgZmO5NK2oQ8mhhhHVupTw8gDX6Lr2gmvzbPoPmvCRvA+UPCDHyzhGSIDKKGC38ddrqqqb9WtLp1xeVZdXitkF0gkIf2ZEg1S9qcMVLhDccS68qCFb8WC LftoTJZX Kz4iFfIflEalkLso/ICJIyATrAI3USN9FTD7PqLz2dBMl2UmzRRB1SrcflNs+h8j3jpBrXESF0qVLBsGKDrv36Y34FoexxUreLwOuKqHbJchgXnCuesD/xxaNuB5L7XHa8xFcasArISBVgWrD7naVflRJ+EvBxlhD43k6998kMT0dn2Y= 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 --- include/asm-generic/pgtable-nop4d.h | 1 + include/asm-generic/pgtable-nopud.h | 1 + include/linux/pgtable.h | 6 +++--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/pgtable-nop4d.h b/include/asm-generic/pgtable-nop4d.h index 03b7dae47dd4..75c96bbc5a96 100644 --- a/include/asm-generic/pgtable-nop4d.h +++ b/include/asm-generic/pgtable-nop4d.h @@ -21,6 +21,7 @@ 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; } static inline void pgd_clear(pgd_t *pgd) { } #define p4d_ERROR(p4d) (pgd_ERROR((p4d).pgd)) diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index eb70c6d7ceff..14aeb8ef2d8a 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h @@ -28,6 +28,7 @@ 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; } static inline void p4d_clear(p4d_t *p4d) { } #define pud_ERROR(pud) (p4d_ERROR((pud).p4d)) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 2a6a3cccfc36..b27e66f542d6 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1882,13 +1882,13 @@ typedef unsigned int pgtbl_mod_mask; * - It should cover all kinds of huge mappings (e.g., pXd_trans_huge(), * pXd_devmap(), or hugetlb mappings). */ -#ifndef pgd_leaf +#if !defined(__PAGETABLE_P4D_FOLDED) && !defined(pgd_leaf) #define pgd_leaf(x) false #endif -#ifndef p4d_leaf +#if !defined(__PAGETABLE_PUD_FOLDED) && !defined(p4d_leaf) #define p4d_leaf(x) false #endif -#ifndef pud_leaf +#if !defined(__PAGETABLE_PMD_FOLDED) && !defined(pud_leaf) #define pud_leaf(x) false #endif #ifndef pmd_leaf