From patchwork Tue Jun 18 14:42:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxwell Bland X-Patchwork-Id: 13702476 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 22D46C27C4F for ; Tue, 18 Jun 2024 14:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ezwWQXmivCwqBRYERK7BZUh3xDdPWSaca1WBI9VsK/Q=; b=qoon+Kdq49krrV9M9yDGMASqeF THV4y4Y7G/b1CH836MqkmBPMwlWA2Pb3r8bXnKb3GsfH6fUtKYWbkgUF6VvI2/GGXfBAGRNklHTHf PHJ60IfhRKv32Ypj8LrkcS7FEzd8CBUu/xsoZTnTymh5ppSAWqdd2Fac6J9cuSL2OKHVzHn0qX4YP xkh8xwFvV90mj3UiN0yC+9fFXaBEPJFdk5eU7tSSgDSLW3U5BZqscKOV3O0TWd/Ft9RDCgnDOnVTt 9WHqdHa5NA4ktOqwM9TxNcesPTLGpsWtqn2gz8dIX3xggqX9tijEVDIo8TRTGzQ/wAi2bl9GL8l+3 8Lm0Eu6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJa2T-0000000FRIb-3EP1; Tue, 18 Jun 2024 14:42:25 +0000 Received: from mx0b-00823401.pphosted.com ([148.163.152.46]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJa2R-0000000FRHB-0neW for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2024 14:42:24 +0000 Received: from pps.filterd (m0355092.ppops.net [127.0.0.1]) by mx0b-00823401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45IBkGKC002088; Tue, 18 Jun 2024 14:42:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=motorola.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=DKIM202306; bh=ezwWQXmivCwqBRYERK7BZUh 3xDdPWSaca1WBI9VsK/Q=; b=63ok91igM9aGiEEBMeMzFg5e2fnYqPPTXSMShHM 8N1gRUJqcMTc+GQqkI4iu5qfSwof0HNHrqzcR6rwua+Ndvq3bV5TEV2D/7yBG7Tq 9mIDeeyV563EHgBl0TYfuwOwUCFF90/bgx9eVd16kiwuyPHqAzUWz9nOAcv0Yz7f riIdLZWRo4rAldszEdiXfM3jTTSJVpdx1xpY4hxM2gQn1aC7RI02rekC6VRRGpe2 iTTg6jnMaoAWACDhrQ9NAJ6XHGj/l8KWMtRCq+lsNfOO+QwBo9i3+F5YdT3vD2on EepZda0hQwKf2NbJsxyo7ks8XT5D8VNn/rMMrb2sPnsdh6Q== Received: from va32lpfpp02.lenovo.com ([104.232.228.22]) by mx0b-00823401.pphosted.com (PPS) with ESMTPS id 3yss9d6hk2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jun 2024 14:42:10 +0000 (GMT) Received: from ilclmmrp02.lenovo.com (ilclmmrp02.mot.com [100.65.83.26]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by va32lpfpp02.lenovo.com (Postfix) with ESMTPS id 4W3Twy1Qvtz50TkT; Tue, 18 Jun 2024 14:42:10 +0000 (UTC) Received: from ilclasset02 (ilclasset02.mot.com [100.64.49.13]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mbland) by ilclmmrp02.lenovo.com (Postfix) with ESMTPSA id 4W3Twy07LJz3p6jp; Tue, 18 Jun 2024 14:42:10 +0000 (UTC) Date: Tue, 18 Jun 2024 09:42:08 -0500 From: Maxwell Bland To: linux-mm@kvack.org Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Ard Biesheuvel , Mark Rutland , Christophe Leroy , Maxwell Bland , Alexandre Ghiti , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/5] arm64: indent ptdump by level, aligning attributes Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Proofpoint-ORIG-GUID: Y_evLIlZBS663m3UA_uhG0DNOEs7VpPu X-Proofpoint-GUID: Y_evLIlZBS663m3UA_uhG0DNOEs7VpPu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-18_02,2024-06-17_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 impostorscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 adultscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405170001 definitions=main-2406180110 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240618_074223_388535_50277B8A X-CRM114-Status: GOOD ( 14.74 ) 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 Outputs each level of the page table with two additional spaces for parsers, distinction, and readability while maintaining the alignment of region size and attributes. Signed-off-by: Maxwell Bland --- arch/arm64/mm/ptdump.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c index 8f0b459c13ed..2ec16b523043 100644 --- a/arch/arm64/mm/ptdump.c +++ b/arch/arm64/mm/ptdump.c @@ -336,6 +336,10 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level, addr >= st->marker[1].start_address) { const char *unit = units; unsigned long delta; + unsigned int i; + + for (i = 0; i < st->level; i++) + pt_dump_seq_printf(st->seq, " "); if (st->current_prot) { note_prot_uxn(st, addr); @@ -362,6 +366,10 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level, st->start_address, addr); } + /* Align region information regardlesss of level */ + for (i = st->level; i < 4; i++) + pt_dump_seq_printf(st->seq, " "); + delta >>= 10; while (!(delta & 1023) && unit[1]) { delta >>= 10; @@ -369,6 +377,7 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level, } pt_dump_seq_printf(st->seq, "%9lu%c %s", delta, *unit, pg_level[st->level].name); + if (st->current_prot && pg_level[st->level].bits) dump_prot(st, pg_level[st->level].bits, pg_level[st->level].num);