Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2745714rdb; Wed, 15 Nov 2023 09:17:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/+csxmszSezaSfYJVJn9QXyQijRTA2wGKNDneY86WwequahXcZVc2xy75kTsRm7M1rQ31 X-Received: by 2002:a05:6a20:4322:b0:171:a2df:4e68 with SMTP id h34-20020a056a20432200b00171a2df4e68mr11250835pzk.36.1700068658915; Wed, 15 Nov 2023 09:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700068658; cv=none; d=google.com; s=arc-20160816; b=BLMPOhkiXmriavXn7+PTR695JHfU2Y7EVfn09vLRr8Q8R3zGzdBIM/PwpvPOvPAfJF Au27dkBiQF7Ljo06yyg+ZInKb26Xm0e3X4FJqwMu1UK3fweXy/gNeSX2oc5QF+U2E/FT 9lQnkfr7gfnNdGYhbqt+S4r3Uw4g74YiDitUZPAEZEB6FWyRY/AnqG15aX8di2fw3Ohq JiHpsHSODzcyXEvlkDZG+uFQtESAnrs7XHeFRrVMqpu1ba2lANs2hTN4HrcicO5oRj9d LFdzBtQcmysQ8nOEdATrR/Rlw8U0iwzA7bDExUcxawBnvMlhkFAK+poJBWbxKbl94za6 33+Q== 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.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id u192-20020a6379c9000000b005b3e61af56esi9961908pgc.121.2023.11.15.09.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 09:17:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; 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.32 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 agentk.vger.email (Postfix) with ESMTP id 95F77801E753; Wed, 15 Nov 2023 09:17:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232405AbjKORRJ (ORCPT + 99 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 09:17:29 -0800 (PST) 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; } -- 2.43.0.rc0.421.g78406f8d94-goog