Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4455321ybp; Mon, 7 Oct 2019 08:41:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyH7QN2dP8+P+2P1BVMgqNedQDtW29MWwJ5/vmews2zDGLN2GOUHqiCbg5OKLn5PquJRUiA X-Received: by 2002:a17:906:e109:: with SMTP id gj9mr23905979ejb.160.1570462884273; Mon, 07 Oct 2019 08:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570462884; cv=none; d=google.com; s=arc-20160816; b=BjDr6SysaLtloUASv+syhcd8F8l1Z2yxCO8vczC+gGRH94SQ52zcYpyDkQY5MPdpZb B+7NFR8stNaBprMHJ6C3upDqiKkObteW7mBQuAqgnSdILgnyZefIsxUcgPl6d8tYDQ8Z JZwUELpALlgvp8zpuio8elj7wJUicaoU0F5Y1JncQyYrSIl9oTcRu9O7Dn6yq6X4nwYr NQZwwfRMTaqD68hmbBn5gJeDvmbFoe9M14IzjNy281uSD3Xy8zjwOcmtYBh0kC4c6CpO bAHmgTiyodl/a32ZS2sFCOpOmvVKwAuhzAS1TarmTAqzDy8CJp5TdHo/qrcHMTW5U5uQ JmWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JBRMrRB1vcyuC+wT7PC5Yf6gYKX6/OwBzMl8GKFEMiw=; b=WKSW2AC6UX6Xle7xnEDsnI0puqkV3JJrCVMxvNlEyQz/UU8gDR6aqp8JUSByDD259p FEixoRXFcyVQ/LaW+GDghvY4WNPVHt35HGzeNx8x3UCAztKXUC+yUvl4FCUX2BxIKTS8 NXZcN01T2fvUihOPg91WIaB6ypdLFvV/GM30/9MWAPkeGXTVv1wUqokhYA67A/oD92r5 ZFZOf+q1b+pam5I8jIlvVYzBjQUMe8OrnIJoW7hJ5bnzWeSX6plCKF9cZc32ynVMeMzs 4xZwCZ1NqV8PF7CXlIIl87dBSbCP6z2N1TWv7TR04gAGPSMfNf4T8PJIvJKNaTAmP1Do yWyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gf9si1991663ejb.230.2019.10.07.08.41.01; Mon, 07 Oct 2019 08:41:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729335AbfJGPj4 (ORCPT + 99 others); Mon, 7 Oct 2019 11:39:56 -0400 Received: from foss.arm.com ([217.140.110.172]:38910 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729289AbfJGPjp (ORCPT ); Mon, 7 Oct 2019 11:39:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 78DD9142F; Mon, 7 Oct 2019 08:39:45 -0700 (PDT) Received: from e112269-lin.arm.com (unknown [10.1.197.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DEB933F6C4; Mon, 7 Oct 2019 08:39:42 -0700 (PDT) From: Steven Price To: linux-mm@kvack.org Cc: Steven Price , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dave Hansen , Ingo Molnar , James Morse , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , "Liang, Kan" , Andrew Morton Subject: [PATCH v11 22/22] arm64: mm: Display non-present entries in ptdump Date: Mon, 7 Oct 2019 16:38:22 +0100 Message-Id: <20191007153822.16518-23-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191007153822.16518-1-steven.price@arm.com> References: <20191007153822.16518-1-steven.price@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previously the /sys/kernel/debug/kernel_page_tables file would only show lines for entries present in the page tables. However it is useful to also show non-present entries as this makes the size and level of the holes more visible. This aligns the behaviour with x86 which also shows holes. Signed-off-by: Steven Price --- arch/arm64/mm/dump.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index 9d9b740a86d2..3203dd8e6d0a 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c @@ -269,21 +269,22 @@ static void note_page(struct ptdump_state *pt_st, unsigned long addr, int level, if (st->current_prot) { note_prot_uxn(st, addr); note_prot_wx(st, addr); - pt_dump_seq_printf(st->seq, "0x%016lx-0x%016lx ", + } + + pt_dump_seq_printf(st->seq, "0x%016lx-0x%016lx ", st->start_address, addr); - delta = (addr - st->start_address) >> 10; - while (!(delta & 1023) && unit[1]) { - delta >>= 10; - unit++; - } - pt_dump_seq_printf(st->seq, "%9lu%c %s", delta, *unit, - pg_level[st->level].name); - if (pg_level[st->level].bits) - dump_prot(st, pg_level[st->level].bits, - pg_level[st->level].num); - pt_dump_seq_puts(st->seq, "\n"); + delta = (addr - st->start_address) >> 10; + while (!(delta & 1023) && unit[1]) { + delta >>= 10; + unit++; } + 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); + pt_dump_seq_puts(st->seq, "\n"); if (addr >= st->marker[1].start_address) { st->marker++; -- 2.20.1