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+KByOvGITDdWbqtIzVB2xz9TtTiq2dayodcM8qcGoYYDTUzAbCiI8eAALtE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0e6ShU1SJa4fkMKNwT24s= 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