From patchwork Mon Mar 31 08:13:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 14033790 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 8C3A2C3600B for ; Mon, 31 Mar 2025 16:29:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1B61280001; Mon, 31 Mar 2025 12:29:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DC926280005; Mon, 31 Mar 2025 12:29:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9106280001; Mon, 31 Mar 2025 12:29:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AA474280005 for ; Mon, 31 Mar 2025 12:29:32 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6D0DF160DAD for ; Mon, 31 Mar 2025 08:14:10 +0000 (UTC) X-FDA: 83281133460.21.253617C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id B10F140006 for ; Mon, 31 Mar 2025 08:14:08 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dIKTEZiO; spf=pass (imf07.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743408848; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lU8XHCD/pp6vsb0Fo6FpwHmvpoSyWoqbMK/saKstTlg=; b=KWab/1QRJbxlWnMhHMFVJmcX76BS6r7YhThCER6mhba/rBH7H9TZRNOjuJUyOy1XB2M3eJ rOggfanDMUcL43CT00PkzZrQjzVbICotpzYXyXRZhXTm5TuimVWKLWVp8iWZieXxCGImjq f5EpRT49kBzNx6TckNJmDy0gdavYqVs= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=dIKTEZiO; spf=pass (imf07.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=quarantine) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1743408848; a=rsa-sha256; cv=none; b=WElsAN3WDnRHqyvvVLO+eBURxOv3j0vPM9/+7M/vzigozncfv3+3KF9WhQvetSLEGkOAqy y5HqJMhSEFzGNh/+YBTvZ+Spbfo/2YsV7nK7R4DLxgmZjeDPjHG10WSVUavFvHilMdhX/f K9GM8uz8tQwsj9Ogz99E60JxJblXq7Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743408848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lU8XHCD/pp6vsb0Fo6FpwHmvpoSyWoqbMK/saKstTlg=; b=dIKTEZiOoGoiMOv+OvzDszB1DhcinqxEB5rre+O7DDTIkEWQwgqCWofhdW9MppdZ4tfn6B Az14DaPhZnQfh6UynpyiwLF27E67UwmR2gjHssEy8WvRx8y9c4/yOiEdntq4QkKn5pcSuD vVx+R4pGaDFwzAPByWttj0UcNVA6y7o= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-w3DzhzJnOJmOe7Q5-csrBw-1; Mon, 31 Mar 2025 04:14:02 -0400 X-MC-Unique: w3DzhzJnOJmOe7Q5-csrBw-1 X-Mimecast-MFC-AGG-ID: w3DzhzJnOJmOe7Q5-csrBw_1743408840 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CD80D180AB16; Mon, 31 Mar 2025 08:14:00 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.112.9]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4F53D1955BEF; Mon, 31 Mar 2025 08:13:56 +0000 (UTC) From: Baoquan He To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, yanjun.zhu@linux.dev, Baoquan He , x86@kernel.org Subject: [PATCH v2 6/7] x86/mm: remove p4d_leaf definition Date: Mon, 31 Mar 2025 16:13:26 +0800 Message-ID: <20250331081327.256412-7-bhe@redhat.com> In-Reply-To: <20250331081327.256412-1-bhe@redhat.com> References: <20250331081327.256412-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspamd-Queue-Id: B10F140006 X-Stat-Signature: kcznkmdwcrnk6xj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5N/tUgZo1yK+ptE/2d/reZYngTibqAyhXNcyRthn0S1sa5bRp/hO2eob4mW/4HNshFnDp0St2yfD/VkLgShQFplji5k1P8gqhibGX4sYDKNXNtR/cXnW7PZEhwBUFClKZUI//5kdLrUa5F6AZgN3jMBHQoOp0odK9ZQgB8Q+BZOpDqYKNbBfVb09kxp2hYx8DikTEevwoF0rCKwJ/eBuKB0Fss2n7/nTapYgOzDUtxHkBAs6v2k3dC8O3PrOeJ5U7FUezISvsOutH6tBFhP1yxjUCaM7z6XTyUOvEFSv8PAhojFPlBd7kPRY/SV0k8MtHU8DHDO2TwxKp0xcyoDF9Aji64VeMSU5P8A7+OJAfYMts3VLdCi5Qz4GnHe7sixbCOpLcWrRYHVzW/6mH4g== 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: There's no p4d huge page support yet, let's use the generic definition. And also update the BUILD_BUG_ON() in pti_user_pagetable_walk_pmd() because p4d_leaf() returns boolean value. Signed-off-by: Baoquan He Cc: x86@kernel.org Reviewed-by: Oscar Salvador --- arch/x86/include/asm/pgtable.h | 7 ------- arch/x86/mm/pti.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 5f4fcc0eea17..5ddba366d3b4 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -292,13 +292,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 diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index c2e1de40136f..190299834011 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -206,7 +206,7 @@ static pmd_t *pti_user_pagetable_walk_pmd(unsigned long address) if (!p4d) return NULL; - BUILD_BUG_ON(p4d_leaf(*p4d) != 0); + BUILD_BUG_ON(p4d_leaf(*p4d)); if (p4d_none(*p4d)) { unsigned long new_pud_page = __get_free_page(gfp); if (WARN_ON_ONCE(!new_pud_page))