Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp3812543rwn; Sat, 10 Sep 2022 21:52:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR7U9eJMVhdDWkLAfGrjim/fvfjvdExpq6XeXER/vWYxWgroMiwp9gYDiapFnHyFAHxRjla3 X-Received: by 2002:a17:90a:e60d:b0:201:6b28:5406 with SMTP id j13-20020a17090ae60d00b002016b285406mr17275340pjy.228.1662871926371; Sat, 10 Sep 2022 21:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662871926; cv=none; d=google.com; s=arc-20160816; b=O1U08XRJafes+VNMHxjOi3YYYZajZ7YW9IxK+vdmqUKmf2UOci2N+DVEhu0if4AaIZ TZAjprnsHtyFx3wBwZE8/e3KMSPcBHf5tdVxB54dvGEQ7fhRf9abmids0JZ3PBTI4XIw xP2ul+cVDvyjqd62rm4XaTsg/xh9v8bsGn05sZOAJc5w+arTvQ6hZur9wmYrWqhwn3SQ 4l+FmUNm0phAzbJbtX1C9ScO2HdvUpeeaEtoXzvG5YJRTnpFrb+iMhQH8ed3i9kXKSDm M7QUvO6YpaYl4yocnB3LV/Y19cGbTm24RhtSYJdNnrS4KREGjK4ZNFAJBUERr8qM7y8j 5Rlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KG4725QlTXpzBY+qEVnQTzxyGskR3UWpzkX2nEM6/xQ=; b=jMRh7ZaST/Xhw+rfpwuVI7WVFRj9W/iDU9WgFtTS+HRC9Gj6bTPUcbVqoIJWLSFv0z AErmngKtVtcbAZDPelOKnrcszjTaWvRfhlDUZwBELy9z2plV8Ub/G0apNOXPHbRhgz+z Hl/hRQt2syOxcSjK6piG0+DeP+i5slS0Tk51g8hQX8fDqvl2QZ2vSeYE6oaJdX0uIbOV nMqCzpmsPx0Rs1JIcLtCKSMytJFn+wsSUgVL/qK3KB8sKhrR9ZQTWzfjuGhsWL9jNJNW A8qKXiUykvMtmPIJkJLZ/sCXbyCeR2w0P3joCIbYFvbD3ckx39KpHxjDJXjOj4LCFL+w zKjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pg12-20020a17090b1e0c00b001f7b16bb542si5438975pjb.180.2022.09.10.21.51.54; Sat, 10 Sep 2022 21:52:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbiIKEh3 (ORCPT + 99 others); Sun, 11 Sep 2022 00:37:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbiIKEhZ (ORCPT ); Sun, 11 Sep 2022 00:37:25 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4575541D06 for ; Sat, 10 Sep 2022 21:37:24 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MQH2z3TDWzHnk2; Sun, 11 Sep 2022 12:35:23 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 11 Sep 2022 12:37:22 +0800 Received: from localhost.localdomain.localdomain (10.175.113.25) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sun, 11 Sep 2022 12:37:21 +0800 From: Kefeng Wang To: Russell King CC: Mike Rapoport , Andrew Morton , , , Kefeng Wang Subject: [PATCH v2 2/2] ARM: dump: show page table level name Date: Sun, 11 Sep 2022 12:41:28 +0800 Message-ID: <20220911044128.138458-2-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220911044128.138458-1-wangkefeng.wang@huawei.com> References: <20220911044128.138458-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ARM could have 3 page table level if ARM_LPAE enabled, or only 2 page table level, let's show the page table level name when dump. Signed-off-by: Kefeng Wang --- arch/arm/mm/dump.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c index 712da6a81b23..a71c2240e319 100644 --- a/arch/arm/mm/dump.c +++ b/arch/arm/mm/dump.c @@ -200,6 +200,7 @@ static const struct prot_bits section_bits[] = { }; struct pg_level { + const char *name; const struct prot_bits *bits; size_t num; u64 mask; @@ -213,9 +214,11 @@ static struct pg_level pg_level[] = { }, { /* p4d */ }, { /* pud */ }, { /* pmd */ + .name = (CONFIG_PGTABLE_LEVELS > 2) ? "PMD" : "PGD", .bits = section_bits, .num = ARRAY_SIZE(section_bits), }, { /* pte */ + .name = "PTE", .bits = pte_bits, .num = ARRAY_SIZE(pte_bits), }, @@ -282,7 +285,8 @@ static void note_page(struct pg_state *st, unsigned long addr, delta >>= 10; unit++; } - pt_dump_seq_printf(st->seq, "%9lu%c", delta, *unit); + pt_dump_seq_printf(st->seq, "%9lu%c %s", delta, *unit, + pg_level[st->level].name); if (st->current_domain) pt_dump_seq_printf(st->seq, " %s", st->current_domain); -- 2.35.3