From patchwork Wed Nov 15 17:16:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Ene X-Patchwork-Id: 165514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2686914vqg; Wed, 15 Nov 2023 09:17:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IF1m+Jotf5oISecNVCKkY9SNhHgNAJBx8SqVArvIILaDvFi5BJ6/e2dkNM44X9OFkpVdkaP X-Received: by 2002:a05:6a20:2584:b0:187:636d:a61e with SMTP id k4-20020a056a20258400b00187636da61emr2205460pzd.42.1700068633059; Wed, 15 Nov 2023 09:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700068633; cv=none; d=google.com; s=arc-20160816; b=LMQ/UIzCbFX45KryA3OWu+/eIz9e6k4bRL6cz9yTzp1C5dS76aUxDWjubV7/th+EXe T/wip6a6zJsqSfJl5r0TAoz+/gIvnx2M7vgJOG4jmdBckGKoDQYV1UnggHJrPhQpRWpB vFOEpVznGn7qifIRRaG1sVMTlqEyZvcPjS2NQ5FL1dhWYBPBiGy/BFYrRYZ5FCHVQ5+e Sb/A2Z/R2PG0WV3uRsb4hyTfbfaxKvckwEBhXIPz+TImRZ1Hpl4lBi13lBZJnGWtvxsv SVspWZoi5yosmuozA79sywbMTD+wv8xZqBkAGY4z2P+pZwydN75iVuO3RBSGg5/HqST5 VVrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=ancG5BntywgLYEtvolLfMGCRB6TUL9+Qsz3r5K1PW+Y=; fh=4RXM1FFjr/2FDx2f50K7N78eRirWaG15JMQkQwGVT00=; b=E9LGJE7LkzvsBpIRrwXNG0rL+ugPitLaupO8AiVb2aUD6s/u7S4FwZ/Rr0GmTDKe7C tCAt67DBwHf4LRuVsR0uMbnX4V59K/Kj1ePCJe3Fh2FXX+q87ud0ffTub5DYIBVmq8C2 y6Pa5jcHtGcqU3gssnh408uLvaCxO13nT6dtK/whF+CnvEIVfczoeTfQ61EiTRawSkFL M274ipYGG06pT9OILoQUBewwS3h41A4seV4AJeb0aiY5WrAjTD8K85PQ3mrBLOJu9r9E X6Qukhknp/yFrjp0maJKYNGxQvTqi3l4nHyAmEcx7ji0qoftqbsIDjt+EbBtEOU+wkGy cgmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xrWsTiyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m14-20020a056a00080e00b006b70c01a08dsi10479587pfk.161.2023.11.15.09.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 09:17:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xrWsTiyC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 354D98218232; Wed, 15 Nov 2023 09:17:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232552AbjKORRJ (ORCPT + 29 others); Wed, 15 Nov 2023 12:17:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232470AbjKORRF (ORCPT ); Wed, 15 Nov 2023 12:17:05 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81E75197 for ; Wed, 15 Nov 2023 09:17:01 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-da2b8af7e89so8334817276.1 for ; Wed, 15 Nov 2023 09:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1700068620; x=1700673420; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ancG5BntywgLYEtvolLfMGCRB6TUL9+Qsz3r5K1PW+Y=; b=xrWsTiyCHBiwz7mSj9bK7ctp7FaEseGHYVltxpTbsvsJ4EkO8ejqyPyA25FFtQ2kPC lRc8zKpqCSq+dTp7K8XgCFgIQbiAy7lRV11KtDDlqqCKU1NPlqKA/Ex6FySx8Oh1Cbrm w6OCt/xSgzdSrD6NgF59v7NEjkcVirfui50mPgdly6Rc04JPt2Qh750gsWJLhZ95G5/S AoA4LsXGCkRAKalKlnkEylI/d0o/N5spOyjtWl4Ep6cFNNOBhvKj0DmRiNn9e1+m7rvR nswgOvw0vuM8IOJFPwVptBjK8HiKiGkJdGGbsNktRhNhnG0SUw2M2MMTI7YW9/BPGtOl vCqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700068620; x=1700673420; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ancG5BntywgLYEtvolLfMGCRB6TUL9+Qsz3r5K1PW+Y=; b=IHydyqEkdiRytYXIMG4hOmlBVCjtA5UWYSEzDiKleE2LucU+yRXUDSahb3LTwBT/FQ ppUZ1r7/lbQiiCKoeU1+zwaxaGI1yEKP55Ow7Rh2PCKRr8IlCMEFJHXl7JLTvowVkVFp qBgSg5u7mjZE8bld222iF84bnTAcw2Mb9Ue+OOLO+Z6siXgP1OwbJG0s5NSRUsRAuzA5 9vcl20WceH4c6j5ZSAcEOLjV7bcUuXgQUV6e3oyUNHZ+noZHexI9YbeCTgWEGSu1hXCU HzQ1330uzXuChkgdUsO0lX0OB0VbrHevNyfUystqzX/8gicmVKhffzM6qw1YKO6RQdu5 EsqA== X-Gm-Message-State: AOJu0Yy3RXBYuJxjolvlNyxsZVUkNbcPA1W9wVn2+FFag4Id+kqBrtPy 5YWRXY7yBGmCkUa4wYnaBLwMaeZ+MxyWAlDOdaA= X-Received: from sebkvm.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:cd5]) (user=sebastianene job=sendgmr) by 2002:a25:dcc3:0:b0:d9a:4fb2:16a2 with SMTP id y186-20020a25dcc3000000b00d9a4fb216a2mr310123ybe.12.1700068620695; Wed, 15 Nov 2023 09:17:00 -0800 (PST) Date: Wed, 15 Nov 2023 17:16:33 +0000 In-Reply-To: <20231115171639.2852644-2-sebastianene@google.com> Mime-Version: 1.0 References: <20231115171639.2852644-2-sebastianene@google.com> X-Mailer: git-send-email 2.43.0.rc0.421.g78406f8d94-goog Message-ID: <20231115171639.2852644-5-sebastianene@google.com> Subject: [PATCH v3 03/10] arm64: ptdump: Add the walker function to the ptdump info structure From: Sebastian Ene To: will@kernel.org, Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , catalin.marinas@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, maz@kernel.org Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com, vdonnefort@google.com, qperret@google.com, smostafa@google.com, Sebastian Ene X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 09:17:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782651166868887459 X-GMAIL-MSGID: 1782651166868887459 Stage-2 needs a dedicated walk function to be able to parse concatenated pagetables. The ptdump info structure is used to hold different configuration options for the walker. This structure is registered with the debugfs entry and is stored in the argument for the debugfs file. Hence, in preparation for parsing the stage-2 pagetables add the walk function as an argument for the debugfs file. Signed-off-by: Sebastian Ene --- arch/arm64/include/asm/ptdump.h | 1 + arch/arm64/mm/ptdump.c | 1 + arch/arm64/mm/ptdump_debugfs.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/ptdump.h b/arch/arm64/include/asm/ptdump.h index 581caac525b0..1f6e0aabf16a 100644 --- a/arch/arm64/include/asm/ptdump.h +++ b/arch/arm64/include/asm/ptdump.h @@ -19,6 +19,7 @@ struct ptdump_info { struct mm_struct *mm; const struct addr_marker *markers; unsigned long base_addr; + void (*ptdump_walk)(struct seq_file *s, struct ptdump_info *info); }; void ptdump_walk(struct seq_file *s, struct ptdump_info *info); diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c index 8761a70f916f..d531e24ea0b2 100644 --- a/arch/arm64/mm/ptdump.c +++ b/arch/arm64/mm/ptdump.c @@ -346,6 +346,7 @@ static struct ptdump_info kernel_ptdump_info = { .mm = &init_mm, .markers = address_markers, .base_addr = PAGE_OFFSET, + .ptdump_walk = &ptdump_walk, }; void ptdump_check_wx(void) diff --git a/arch/arm64/mm/ptdump_debugfs.c b/arch/arm64/mm/ptdump_debugfs.c index 68bf1a125502..7564519db1e6 100644 --- a/arch/arm64/mm/ptdump_debugfs.c +++ b/arch/arm64/mm/ptdump_debugfs.c @@ -10,7 +10,8 @@ static int ptdump_show(struct seq_file *m, void *v) struct ptdump_info *info = m->private; get_online_mems(); - ptdump_walk(m, info); + if (info->ptdump_walk) + info->ptdump_walk(m, info); put_online_mems(); return 0; }