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: 13457135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 929FEC072A2 for ; Wed, 15 Nov 2023 17:17:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID: References:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4iQ1GZr9dXdTB++DbfWA9D8ffwu7Vjr/aSEbwsUTx+k=; b=1P01DqCCJuVEuguaukW/5ZtIxR NwwiTsfLiE+J1w8kRYar6r8DvZ0+SjEJjisoGo2RAaJG+vRHmg0bqZ9P8wMmB4JTekJaJ0/snmb2r WhOFFaul4aFWBcecuqpmoSGbS7ugtiwNttip2YCzKt30wYCczAqqEAxitTAHZGxoHKlOesLlK23wX s6gjBy3hROQnOgG13640TYfpZ1PdGaeLOIm+bEoXbb/hoxtqNkVB0FxElQsHDjM6+maJLlR2Njua7 6h6SkOy8rYIi8gkZaXf7JpWBkpQW9DZgJZi9z1jtzJhMqO+fuEhDM8nH7J79kK5L3CQGLvVVFbS9e pV8eeODg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3JVi-001PTs-1A; Wed, 15 Nov 2023 17:17:06 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3JVd-001PRz-2h for linux-arm-kernel@lists.infradead.org; Wed, 15 Nov 2023 17:17:03 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d9a541b720aso8346157276.0 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=lists.infradead.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=xG/yrxyfYKIeVQub1AH5FyfO5KLd8HsRvZGeWe/B4ZIyrOlLcoUvfO2z7OpzurmLwp IvLC/7l1yI2malNQYMHLXjRmL7s0TjuemoV0YFfN8JnZYbRQaRrbQ8sxV/9udLYntQFN HYnyzKl/0LSxbrkiZn43sMyVs+BkT2LfOw5FVzf+3S+Z37M4uKptOftpQMDM9V0CaJP4 FybzpcctIMKsDEIEiuFSKphlPDHsoQB0tuM0XKUk1VTGBx1/D5D0nHEd4g4noqKofIcg HWFPzItO9wH1t4RSFwtee81nPWfIVh9I4wFOlxfj4qd+2LD27S4Bem6pWtZIYvG1zkP/ 1cCg== 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=Gn2+aVl7HRq/3/4PgHxVdDZ5lSSsMnjjrdehk0shVn/jDbypn5bvnMBpsILPvRscrL oq+d+O8uM/8JqLmUhXyuwM7cnPsuXTGq404gK1uz/ak6nPiY52cVZJ6saBH/GNa/ZVzQ LWim2qbK3UtW/IwCSZT5PG1/bmvCgvvykMfVa9RRVbJdZgX7GGU5sxfHmi35k6ZtaVwZ kj5ggSH+RiItj02ViuYBEgboJsKrkpzUFjGODEqwVjx+6Fod+4r5EdZ/CFZBEJ+GJbrN NbcSjrhLLd9gHiP2RGebPJZ4PhAWKRbJZyzwCKDgzuqO388sUVUKS3kmYdyP70Xrzfll wnxQ== X-Gm-Message-State: AOJu0Yy45u3D2DieM7URY2IPsEVsdfhFHi491/vQutRVJth5uZY30eJQ ghhZpWLsoLUhriWPfJ04D3z2Avdn7uiRXVzyu40= X-Google-Smtp-Source: AGHT+IGj2sqWbMdL/6D9g7CRzAYqqT3mXvwK0Hse86EHkE+8SGctzk4vkst4vCcjMP9s+i6Vnuewpw1qh5ywF521RY0= 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_091701_880347_AD50E02B X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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; }