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=HIzTz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8eSutXWtWf2eMSpmc5xWIEmfF8iU9pFZVo/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))