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: 13732368 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 7083EC3DA42 for ; Sat, 13 Jul 2024 07:10:25 +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:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7+UkY7LmaBf/r/VqVwv8rUyt4d2JhpZZGZstKrsiPms=; b=nsSxWPPrg4k/JS 4Y8DF9Gj5P6PtGPsO6GKTHgT/GYiMCspOagh2nDVNfPLyOtP34U9087nmeZWGEjGfIdgAtto6o+U9 c8DBvvYwcimQ+iqv7B8kvHYBMMUzvx+DcYmA0YSKEAWTqf8IXdKfnnGg21qkK9BI1d1VvThp74qK1 J4bLaG1BGm1OYHyOxN4MxOz1n5+XUtyNXXqh+2B+61wLT9KOlu0x61TQ/hYYFirOtiek1MJoqlC43 75cznvk8K12cLiah3UcoavCwiKUTzt8yqh963/Gpeg9i8ORB/QYzrU8Acro+3vLvuOjY8sYr46rL8 GHD6wN8fRwmOKMm1O+7A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSWth-000000025BC-1eNf; Sat, 13 Jul 2024 07:10:21 +0000 Received: from pegase2.c-s.fr ([93.17.235.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sSWsl-000000024gw-2bfo; Sat, 13 Jul 2024 07:09:25 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240713_000923_836220_EC67B855 X-CRM114-Status: UNSURE ( 9.79 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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)