Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp762224ybl; Fri, 6 Dec 2019 05:55:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyfM252dxE1sVwFofKwXpwO/CaU20XUKJ6i6B3c74K9Ed3UoNWdTW0AgxBkc4cfoqVzzjDb X-Received: by 2002:a54:4781:: with SMTP id o1mr11720338oic.117.1575640555673; Fri, 06 Dec 2019 05:55:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575640555; cv=none; d=google.com; s=arc-20160816; b=b+EBGHEvEzMhYTrIZ5V4yPpBp+1vdN5a6Se3iAhfWk8sNTzlT614wb8L+dJD9FTLtQ YFiGKyoy0OVJEKOjFjgGeRrSFTEAbfv65vpyVgCxiG/77TYV8/MS+d7f6We1n+ai3dOD JKAUo/Tg/QLUSxS+VRdbcwG8ADRH6I64PXY1iJx4XLhE18O9sN4j0oQSFe7bUK0glExm /aSkABb3Mh/vYkTdGV/jZ9fb09CAXs/mIKa/buc5QrkxLmD9dXzC3sIYuK2uxi6yLerI 3GzVZ3Qkl9mMA9lYFIqz8jy8NK8s4+tiainaDxHRf4KiFFjNRRxO33HfVMvIsLm6S+Gk xAMw== 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=qhP2Z1iWvIrj1UVLLS5TJ06v3thMgQa0E2miwhcXpaE=; b=K5my6hPgVwuzlza4+K5pDijfPYmvWOys8SQMk+/kj49aZdthQZyfU3Nq5QpEzwVqVw i7r5rEKxaglcrt3s2JfSrK07gfRPeFZhdZordfH9W38VOqo/i7seblb5UlV/jbynfjMk rYk+XWeav+K0J4DW50yP+oTKCg5YKQYecBog78ktFPQ9FcFosIkBCS4qDB6dxFSVKRpz 2d9N8t/47EobVFzQAPi3tbVdVqMJSpN3wRKS41GH4Yu7KS07NrJGqCakHJYdV+u95p0O O0biNEIjEyN6Iw7Uesv8Iiltiq25QL39m940R/PztSe9H8jzYvEyA8baVU1yrUDb/MWK gMmg== 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 d133si2581819oif.206.2019.12.06.05.55.43; Fri, 06 Dec 2019 05:55:55 -0800 (PST) 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 S1727048AbfLFNyy (ORCPT + 99 others); Fri, 6 Dec 2019 08:54:54 -0500 Received: from foss.arm.com ([217.140.110.172]:45118 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727030AbfLFNyw (ORCPT ); Fri, 6 Dec 2019 08:54:52 -0500 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 5C797139F; Fri, 6 Dec 2019 05:54:52 -0800 (PST) Received: from e112269-lin.cambridge.arm.com (e112269-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D0F983F718; Fri, 6 Dec 2019 05:54:49 -0800 (PST) From: Steven Price To: Andrew Morton , 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" Subject: [PATCH v16 24/25] arm64: mm: Display non-present entries in ptdump Date: Fri, 6 Dec 2019 13:53:15 +0000 Message-Id: <20191206135316.47703-25-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191206135316.47703-1-steven.price@arm.com> References: <20191206135316.47703-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. Acked-by: Catalin Marinas 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