From patchwork Wed Sep 27 11:25:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Ene X-Patchwork-Id: 145423 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2711258vqu; Wed, 27 Sep 2023 08:32:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHSX/eGqhsi5JP6MomEDzvK1yLneOH88QF7CNoDpa8Ijhnx2laIIuHF62Rg0FA3C6+Bnn/a X-Received: by 2002:a05:6a00:10c6:b0:692:b429:390 with SMTP id d6-20020a056a0010c600b00692b4290390mr2424135pfu.29.1695828749971; Wed, 27 Sep 2023 08:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695828749; cv=none; d=google.com; s=arc-20160816; b=gjQVLU1//NFJrp7c+TcRd/As8q6KwBbNtpkMYHDHKzDX/nqx2y8exjVGdbQystx4al +Aul1+bQIwrbziXbHlA51S6WSRs6Ett5cYBeo+IZySTII24lcqe09e2iavl3h9NJcvmB soili0ntglXW1/FnTh7sdyelpg709aLV6Dapf6D2Q0Ypoxfy5sdkUSHkeDVl8co8ydhG lQ/mU4NRJUGrb4HIj0IyYeyhZSY31Eykl5mxYPdeuH4Ydh3nBEHeo92h3rHujCjnJu76 +cxjlhIRccifO9Y8prw9cTTPfcyA0HLAaD7XHG+DawpzwoPM3XN3fRh3PrQ6/5kv/lth C6tg== 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.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id cv7-20020a056a0044c700b00690d00d52efsi16249837pfb.264.2023.09.27.08.32.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 08:32:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; 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.31 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 morse.vger.email (Postfix) with ESMTP id A0DB8809E883; Wed, 27 Sep 2023 04:26:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231462AbjI0LZw (ORCPT + 22 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 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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 27 Sep 2023 04:26:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778205327505954717 X-GMAIL-MSGID: 1778205327505954717 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; }