From patchwork Thu Oct 19 14:40:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Ene X-Patchwork-Id: 13429341 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 92EF6CDB465 for ; Thu, 19 Oct 2023 14:41:29 +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=IZFfJP2Wjq9VUNxRdKNdxQ2FhVnx/PzfvrOzu9zaOfI=; b=uFaP/aowllU+rwOvGlgUGCdGaE 9HSedDlrfeK149iik5lHqSun/bIciYDwLB36gkWVb3PNd+tGSxCB1DfQ7yT/WdQt7yaSj4aIWTsIt hJ2+ACpR9z7DE/NjxPKB5qEgMVQbypWC4DVGEFjl5ag4s2BP/GpqnOfyd5x367HJ57JMH85S9eV3Z EhcEKrXhSoKk/kEFMguKpT32otS+QfwXuzKQXqNhbfOTKhsRUT4BP+HNbXZ1Yww3t++k4M86Ebr/T UIY4OliInEZ4/bVwvxifkimvHwFs7+a4bKLf5QbZihem/eBk6S+KYVGqTZgxigTVvXY/gljIB3avj jGY2ilnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtUCq-0006IG-0Z; Thu, 19 Oct 2023 14:41:00 +0000 Received: from mail-wr1-x449.google.com ([2a00:1450:4864:20::449]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtUCj-0006Dt-3D for linux-arm-kernel@lists.infradead.org; Thu, 19 Oct 2023 14:40:55 +0000 Received: by mail-wr1-x449.google.com with SMTP id ffacd0b85a97d-32d83fd3765so4800464f8f.3 for ; Thu, 19 Oct 2023 07:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697726451; x=1698331251; 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=4QoqI5aCHRTu5rG2YCshZg+f8V+cS7FPutmWA2GX1oY=; b=dRxypCEJwv7RuH1FtI+40/0S8Z1b6RIE6wJX2Md85baYsZXf7JVg8XK2tpEm1cpBlS zveDi8Ww0Qp/hLj/dd9Y8OX50Dn7IbQg2vWBcqhdBsfCoqTfD2rycDrp1jkENZaNMFfp DXYJNQ5aN2uBdjK5snAKdrgAsqHTStM9zAt7j3JAM019FfxfUm+5Gmlaa40b+N5vK7bF 34uA5PM29gvX12WxrbBahOpct6CKTZuDG2IY8GSq3xztcMS2oZsX71g2sA+MAz/OJZ9Y wqnZe6QPHsb8xLuuf4k4yUfMyeKmK6Rlj/GOGxZCV5w+5L6ORkP+U8ZzQ411qsQ5OyKd kyXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697726451; x=1698331251; 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=4QoqI5aCHRTu5rG2YCshZg+f8V+cS7FPutmWA2GX1oY=; b=R2BJmmIljnhOQvugZEBTq09HIdg/JbuZOLxC/Aub+mtLgaYdfQHJLarPko6W8DOsjH XprbXHhAEXuns1DYp8Guk7Qh2gODWikURFNiIaPfkjN99MZZpQSsOxcc5Ttlw46jiANU Foq281z6nEUn4zeuBBTUSMuIEf7ugse1uDF6IyZAVouJIEeCdofUNjlN64JTRcqLKTuV ybUk8cAL90XTEdUnnUFnk+IZSIunGFK1+O2KkE1JcuaVsniqqZ9y9kK94y8U5EVe9ykr pz4ii95wSeCW7X6IYnrrLG7M3joAR+iUqBNAgFAPQGePukYH84lENUWZXCnbLKElGToF Ab5g== X-Gm-Message-State: AOJu0YxTFOnOrQpjEdIYfz07g55mqu/NCYrMeXjp4oiy2Llj8R9TF/9w a66Zh1i0evFckgoAjADMq4wP53NErV1vRmPlnUA= X-Google-Smtp-Source: AGHT+IG9C3HVsTvdzZtREABIo9YGDHGNQe1R9a5yyUbc+k79HI9yZVVA3h5Q1vXZZF48rkbCBJ8b83q8/N5eW+9gmOE= X-Received: from seb.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:31bd]) (user=sebastianene job=sendgmr) by 2002:adf:cd89:0:b0:32d:8a32:3b25 with SMTP id q9-20020adfcd89000000b0032d8a323b25mr20286wrj.5.1697726451553; Thu, 19 Oct 2023 07:40:51 -0700 (PDT) Date: Thu, 19 Oct 2023 14:40:25 +0000 In-Reply-To: <20231019144032.2943044-1-sebastianene@google.com> Mime-Version: 1.0 References: <20231019144032.2943044-1-sebastianene@google.com> X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog Message-ID: <20231019144032.2943044-5-sebastianene@google.com> Subject: [PATCH v2 03/11] arm64: ptdump: Add the walker function to the ptdump info structure From: Sebastian Ene To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, maz@kernel.org Cc: 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-20231019_074054_037089_D800DA5A X-CRM114-Status: GOOD ( 15.79 ) 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; }