Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp173452lqs; Mon, 4 Mar 2024 20:39:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUj1ZISnS408s8pT9IQiLjT6LL7988ahfQQIzJxK60MnYt9OOAr5AAjyjU4mhXYtnxLdZJkTXwXi88n89SoJGnNcNHN4COw1yVNglwPFw== X-Google-Smtp-Source: AGHT+IGCLMxKz6scljNnJzvQlNu4xUcK+MdsNxu3AM7s2KbxtSSx5aySXW225gG4oSAfrOruJV5k X-Received: by 2002:a05:6a21:a58f:b0:1a1:4cb5:cac1 with SMTP id gd15-20020a056a21a58f00b001a14cb5cac1mr832020pzc.6.1709613554988; Mon, 04 Mar 2024 20:39:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709613554; cv=pass; d=google.com; s=arc-20160816; b=0VNZyYl1ilGFMfqOWlQX51ij9rtP5QZdtwu6BOij4soGC9D9Hg5DTq+zleiozo8M8c vJRa1OFgmC/aX1xAx+agPk4TSIuxaWhbb90CqRIwpFdBdp5JCGMWNbYCP8KFQA8xQrhU 9icy1TN2SXMoG4CzbnYV2tjdsktyeuHynoSwLx9DrQdHdIfXukO6eXz+knvkRdSBijK8 Su2ziUNbnG34OwGmPQveoZ5rqBkfshuLIIQlwDXiG9UDvcj+AmRPKrVrY2ptIzEAjia1 SonO/KiSLGZUZAP/S6VpoizCJXt62vu8Aw8D/UJmbpCmbPLvIQE0urUr2ct6RwYDE8ag mUfw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RdT2Q0TeX0+DskPh7cQ9GWjsaXoSWZfTenFAEBHiO1c=; fh=O0RYiE98R0FSPgWTRwi36N/EaPgTL/DVQdvGX5vTETw=; b=fakiP8HKou9h9djoJcP9HTNoqekblpJ0BqIWw+qBHLgzD8mkH3Gxl/mcWbtrXAXMmH jvPLwyFRP0rmcdb0FYH7yL3US6a9jEcjswVbmqmWTlamiC9CxYvAojBlKcbwpsHD+7Sj kM3YEL0LFF8VLXdOnrmxWn0PCpqUt0jHXZlbLeQW+w+/xXeTb0ldVXRYeFo7Cgz4iL/3 iqWWu5SAB5rDBTk224qF8G2gxn30UCcBTRYCA/5bviFNDsgXNMBGb9L5q5htEE3NP2cW z/I3psHh3XCl8/E9z6HnnzK2PwNt1htDlyQTtXoZeJuW25YFWn480vMQDiNYxTzMYpxS RcpA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OxaZ+Ypv; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-91670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id gx17-20020a056a001e1100b006e4ec0dfe3bsi9311678pfb.43.2024.03.04.20.39.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 20:39:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OxaZ+Ypv; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-91670-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91670-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A4BB82812A5 for ; Tue, 5 Mar 2024 04:39:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 309C445BE1; Tue, 5 Mar 2024 04:38:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OxaZ+Ypv" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E10E433E8 for ; Tue, 5 Mar 2024 04:38:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709613518; cv=none; b=nez6R2JKBB0YcQZfErOUm0FxXOB0Y1QYY85zBT80dOmlC3ptmm3Ig13QAHKYdjab2L7f9rdKcfpWzrOGHoRjDGX3/ovEYFmjJ+2Q0dujGsQVMXtf1KyUJdK4pQsz8FJGnSbKJnSGS7/OB+SE2HPlnOD1h8mAzm5jhoisHksHNK0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709613518; c=relaxed/simple; bh=N7l6PogKSPgMXEy2CH0FOs7lvcKgL9n5xVZQYxFTBVc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ld4qHitdlpWFQXl14b821hfXu0LeyYlSMBNZVU65hc5AfgwgUZ0cbkwQiDPleq0l5G22pu/lgskK9mAAAGHZGfWNTJGC5GSuLGW4tZKvZkc3NmRfizxDw/YcKKKtnIB0wtweu2G2OAzZahp0FvHqSlnuni+rLjv7tRfRdVW1bvY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=OxaZ+Ypv; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709613515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RdT2Q0TeX0+DskPh7cQ9GWjsaXoSWZfTenFAEBHiO1c=; b=OxaZ+Ypvdvd3gr/9EpnLgv+lOJpS0SWQyoj1K4wQLxwUx+CSnFeV+Zl8TLvgjMCgU9VHHA 6AYAL0OYx72kaCG8Aqnp7pUXaQjaOTvoXLrgwo7ia3ho2vWYKOfOO/IM/MGHC0+Bh4tbMB qIjrE4VxBGKdJC0Q0k59lVNTQuvjwnY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-594-cAgx3rZoNfqMGBlxB6YwXw-1; Mon, 04 Mar 2024 23:38:31 -0500 X-MC-Unique: cAgx3rZoNfqMGBlxB6YwXw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63FC0185AD0B; Tue, 5 Mar 2024 04:38:30 +0000 (UTC) Received: from x1n.redhat.com (unknown [10.72.116.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 68DA5C1F086; Tue, 5 Mar 2024 04:38:23 +0000 (UTC) From: peterx@redhat.com To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Christophe Leroy , x86@kernel.org, "Kirill A . Shutemov" , Jason Gunthorpe , Yang Shi , peterx@redhat.com, Andrew Morton , linuxppc-dev@lists.ozlabs.org, Muchun Song , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Subject: [PATCH v3 04/10] mm/x86: Replace pgd_large() with pgd_leaf() Date: Tue, 5 Mar 2024 12:37:44 +0800 Message-ID: <20240305043750.93762-5-peterx@redhat.com> In-Reply-To: <20240305043750.93762-1-peterx@redhat.com> References: <20240305043750.93762-1-peterx@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 From: Peter Xu pgd_leaf() is a global API while pgd_large() is not. Always use the global pgd_leaf(), then drop pgd_large(). Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Signed-off-by: Peter Xu --- arch/x86/include/asm/pgtable.h | 4 ++-- arch/x86/mm/pti.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 69ed0ea0641b..d6e993a5659f 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -1418,8 +1418,8 @@ static inline bool pgdp_maps_userspace(void *__ptr) return (((ptr & ~PAGE_MASK) / sizeof(pgd_t)) < PGD_KERNEL_START); } -#define pgd_leaf pgd_large -static inline int pgd_large(pgd_t pgd) { return 0; } +#define pgd_leaf pgd_leaf +static inline int pgd_leaf(pgd_t pgd) { return 0; } #ifdef CONFIG_PAGE_TABLE_ISOLATION /* diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index dc0a81f5f60e..c17aab24c1b3 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -185,7 +185,7 @@ static p4d_t *pti_user_pagetable_walk_p4d(unsigned long address) set_pgd(pgd, __pgd(_KERNPG_TABLE | __pa(new_p4d_page))); } - BUILD_BUG_ON(pgd_large(*pgd) != 0); + BUILD_BUG_ON(pgd_leaf(*pgd) != 0); return p4d_offset(pgd, address); } -- 2.44.0