Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2631169rdh; Wed, 27 Sep 2023 08:12:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgYRO3mjoyK01yth0fytbPiUs3lOWcAM56zwd5WsdzrskSQ2ZxY89zayOvXPt1oxO3r2kp X-Received: by 2002:a17:902:e549:b0:1c6:1bf9:d88d with SMTP id n9-20020a170902e54900b001c61bf9d88dmr2330662plf.44.1695827531402; Wed, 27 Sep 2023 08:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695827531; cv=none; d=google.com; s=arc-20160816; b=j2B5oPebng3aJaYMQO3cjKScoOK8M8XvXPWOH326/YD5XqMldncqEYYZXxFQz2JxNB MYNawepje6oOuZj8sFVWqfCzNCbyegtVRwRhlxo06+r+cwLnhmgy/mJQa0coLKqzB4bg 8SDsHLFJd4sm6TqQjFJna0+UDguh84XnfZn1hSjPUW0R/qr3PODAbO5P7AggZwXQrZbX CVcn3yTXQlAj1EeETZyOrr2Ej0FVkrQW9sGJVv8DbOZN/O6YeMPgK8M8pJP6qt8SWmMo I2jXzaOk2uoAl0nNCCsdpoRs5y4pvzRZmmLKIZMWspMC6p7Kn6RiHkR+lqHCkLMPtsnQ wgTQ== 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=U2wy+Fu981b0iBfz2jBuvwB+Vk21Fc177L9d68PfARs=; fh=yikR9HT1wx5LLj7DvfR9kbE/RatD/mnQgNUS++qRsJM=; b=bN4f4MaG+gpRUMLcG3QGiRPt/rMXPCUsKs/K9LPq8KiS7716Q5La+Ij9Xx7Y887rMM V0ranME0jR0eS3AJoUbetLHkpYuwr/Jrg3cJhkCJCUMRTS31ty7Or35f/5LizwUswDV8 ssII38NJWd8zVHKLBsu1R/0L7ZXFQr9sYHcS1X4r5La253TTRD0BlaBNbfjVTE5yQMTZ uKd3Hia7qCspuyAr9Blidz/EVZAbXbUPiuonwUIURfWI0ehsxtKPc9h7IRrynGpcRfa2 DrFsLTkZXofrCK3WV5VPPHcIxQqzsLnprt5nnSZ7XPrp3TxUK/4RVjsysJsR1nNMJt9v 55MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=BAZ0KFt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id c3-20020a170902d90300b001c0cbaf6970si14619747plz.501.2023.09.27.08.12.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 08:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=BAZ0KFt1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 0F3C280CB174; Wed, 27 Sep 2023 04:26:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231444AbjI0LZw (ORCPT + 99 others); Wed, 27 Sep 2023 07:25:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231451AbjI0LZp (ORCPT ); Wed, 27 Sep 2023 07:25:45 -0400 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 5E2A719A for ; Wed, 27 Sep 2023 04:25:44 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d86766bba9fso13150854276.1 for ; Wed, 27 Sep 2023 04:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695813943; x=1696418743; 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=U2wy+Fu981b0iBfz2jBuvwB+Vk21Fc177L9d68PfARs=; b=BAZ0KFt1EM8ivr1Y5hQhqP/nypHmW1fCzekhJ9EaoBpOHR1z7Fh9PfVxIQqPzqOi+f gybmrPQZLQkvFCPQ5iiM/TGjXJwlvoZmo38Ob5KXiz72aRBQO/xeV+PDV/bWzsBW6laA XnMoWA6a3q1tfrMDEziOHwE/tXq8Q2koOPTGiKfbPSz9o+FplMl1jmLkTh3Xvjbbtsc1 8iv7gDk0+iSDDmUOfnI43a4x6TdAtZZ7h1XswwWBACabmwXqgr+69/o2ruomcuXU9zoD ahOKIKtFOef49E6C6v8tpJ6exYPqvuTJEZ7J+fvm/Shiu8Gaz+abvrkgfNnn7LBBBYbD T2wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695813943; x=1696418743; 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=U2wy+Fu981b0iBfz2jBuvwB+Vk21Fc177L9d68PfARs=; b=ECkytPrT+/Ka1vLbjXe47yL7xTM7Gec2Nylr7lBmUXflJjZoT2ahaYhRSgvVYoepAI qAOuuEJqeCxzUuqEtAhCPlq/AalcoGePOQ88Upt5H2p/GNd64UEb52YSfJj6+pSV32Dq lxxfFlBRb3ZgY2hGQsWfzgeS+Ucve6xHWh0IQA5eSDFuT2nsMPwLZSsI+2Fjhix5QAq5 cqcY2hjUaMjqjq8dQ3ez1YkJPNehhsr3wb72OaCdOtDJgVGXLi2hCCMkS1qtyIK1wNHM kFRnRhOa+O8zP+SBmWsm4P+HfuZ0okzl5ATav0xEkazM3iTLQhf54ag191x0iKjo4qP0 GZGQ== X-Gm-Message-State: AOJu0YxOuhX2Yz4sOS0HSt9kiHfT/HbFE8dxup1DLpW95YTvo/ssMLS9 8yYxj/5Fa7MpoE9EOz4mDYmrr8VZ0MFg5l+5x4wa9UPQRtGit4ty94KwTOiNY3Mu7Hc7gDzn5jp BI1f0AG1rQbmQn7p4HRzb/+wcNzFKC62XnfpoRPwhn8bvyryuTLmIFFWSVL5zw+tn+6CT4V2A5i ZKbqWWXN3pfw== X-Received: from seb.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:31bd]) (user=sebastianene job=sendgmr) by 2002:a25:ac89:0:b0:d86:5500:7dba with SMTP id x9-20020a25ac89000000b00d8655007dbamr22642ybi.13.1695813943422; Wed, 27 Sep 2023 04:25:43 -0700 (PDT) Date: Wed, 27 Sep 2023 11:25:09 +0000 In-Reply-To: <20230927112517.2631674-1-sebastianene@google.com> Mime-Version: 1.0 References: <20230927112517.2631674-1-sebastianene@google.com> X-Mailer: git-send-email 2.42.0.515.g380fc7ccd1-goog Message-ID: <20230927112517.2631674-4-sebastianene@google.com> Subject: [PATCH 03/11] arm64: ptdump: Add the walker function to the ptdump info structure From: Sebastian Ene To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, will@kernel.org, ryan.roberts@arm.com, mark.rutland@arm.com, maz@kernel.org, vdonnefort@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,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 27 Sep 2023 04:26:42 -0700 (PDT) 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.42.0.515.g380fc7ccd1-goog