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: 13702480 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E812C2BA18 for ; Tue, 18 Jun 2024 14:53:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 592898D0028; Tue, 18 Jun 2024 10:53:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 542516B030F; Tue, 18 Jun 2024 10:53:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4097C8D0028; Tue, 18 Jun 2024 10:53:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 222D86B030E for ; Tue, 18 Jun 2024 10:53:09 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 5459EA7559 for ; Tue, 18 Jun 2024 14:42:21 +0000 (UTC) X-FDA: 82244274924.01.4FB74DF Received: from mx0b-00823401.pphosted.com (mx0b-00823401.pphosted.com [148.163.152.46]) by imf22.hostedemail.com (Postfix) with ESMTP id 71043C0008 for ; Tue, 18 Jun 2024 14:42:19 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=motorola.com header.s=DKIM202306 header.b=63ok91ig; spf=pass (imf22.hostedemail.com: domain of mbland@motorola.com designates 148.163.152.46 as permitted sender) smtp.mailfrom=mbland@motorola.com; dmarc=pass (policy=none) header.from=motorola.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718721732; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ezwWQXmivCwqBRYERK7BZUh3xDdPWSaca1WBI9VsK/Q=; b=tlWZqruMbBjLjJrMNwI0Z9R4SyOb3ZeKTBjtOM7kwzdrdZ6YD3iK/A9iwgMIN4vk8jPzQj DP6SgRUZ+pduHFQ2aeWnR5KzSZDhLGxzEZ3BYNZ5NK/M2HYsaiZ0FQl5zOXIcV584oOYst CWhCqIkS7cS2HfhJgtOjOi/3F1m/Tcw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718721732; a=rsa-sha256; cv=none; b=gjSFNZJ3THtcf+khY/zEC07F+1/615RUO52q1RSMbl7aneXLF01E/ABvMJDErlfwaHTz9O MiaAN5aiA3qMEWPWU/G4pZPuaLkmM3un3T9wat+ShCd9Tn92DLOVz49h1casCzvGNKAuHb 7ZzQBql8SwTVprOZmQSQNnTXLboq8cw= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=motorola.com header.s=DKIM202306 header.b=63ok91ig; spf=pass (imf22.hostedemail.com: domain of mbland@motorola.com designates 148.163.152.46 as permitted sender) smtp.mailfrom=mbland@motorola.com; dmarc=pass (policy=none) header.from=motorola.com 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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 71043C0008 X-Stat-Signature: as1tsf5sopjt7s5igfmprn1rhu4p3bm4 X-HE-Tag: 1718721739-767077 X-HE-Meta: U2FsdGVkX1962loTf0AdvBcTPkiB6dnjcAI8XT38HIDhrHlyrKgS22bO7ilKZxqrtYPTnvFCqQ4faZ5KqTCivMeAuBTd6F5rqKXcjfQGMmtCWg9IVcQ4HuxH6m/4E8orqTFB5nzujLRQD86vNuCrVQzn35rtu1NAV8Wnbzz/o6Y+oKYiM3QlHBeA7N9jhEpNtoaa3p0S3puMRRCbihBdUKjHCt2vIaf8BP861I9PwEYF9X1beNMJvlQ6RzbEDIm0X5t+mMjB2XKG3DVsV2yzn8k/6o/N9QRQix4IyzYON2vjwlYKbOX8ugB6ftiZIzljHO3VEeqFAEeo9XOFm53PITTiw3Kzn3W5DDvzvw/H2URwZzIRtsOmscB2KcuJnGr0OZ/GOaO3olEtD78HN7Em+AkQL125QFJkxiVIz7O2tvz1MuAf0bZ2hkhdDg3AiiB8uBEhz4HNIQcBicoc/0qUJEoIH4o2g5Duemaf4kdIDZRooU3UewiT1DSkSPqLfn6sufRmBjnd5ULwtazyZIMHcKMzFn+KfBdgzDOKjeNbJuMzDFhx4Sd7a3J+NITEkn7KsNHR9WKkvFpxoL4IG0dQTGq77fySeWSdxl8Rbh+AcCcCHoaItcETxbHSyamQq1oK3ZLCOy9IR1/nQieLlN4samFvBccMPJX99W+JIQAQ51IBH2NS1T6K0qu2GC0v+gjEVgwFuKBpPQXlyH6juwn22YKpsD/fWo+F7OdM7e8vT0Nrxxww4guBGuhW+4fmzLjA2Gb2EN/4ybV6VK7WeckbKuodbkcxITxzcw24wAb4AZqBZTXECJm1qhiexZPBKhWtCgDqdCbx2RAmLqfg4hemNtaXjcMAnmnXm1NNx7qQBoKLOavFptqeygXE0XdFN+HmevLHWB3gygvNYBgMGke9iZUD716gZlLIxFnyNxjRTEb3kNOj3cwWF6PZ1DK7vtT1x+CJzoEZebvlsmRfVCG 7MtZV6Ic h3xJxiNbIFb8ofJaapUEdlwQ9ahY5CIKbL6lvdBJl65fVlmhP839YulwmYXTrG/1O6RgZLY8qW8vSvSjkl9PeWe9Q+/12z8OoIhUHWp1A/+1/LtHgG9zSIf79PYbySUtG9B4izhufW8z3r5ysTNtV4x81RsFJ/4a28/cDJJWV3zIIO2MHUyRtcs/MjxLckzJsPbdx23K8iEP6PjI0xSqrxKW5DqNAKT3/3rmkElvw/CtG2UEp9prdvOtxrhPsIKqFF95+8aH8LK3fZb3BC1Evlll7DZ8hdIB44n7qajOW1nLgvasp+NwgIXutigVFM4ZlmnoS+NyWrszUvD4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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);