Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6129125ybi; Wed, 31 Jul 2019 08:49:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7m0zW6x4BK5X1V0+mlTucGZU0tan4gw6Et9ZRdrL+vEYbMKMQfCayvMStGaqZDl7R3p46 X-Received: by 2002:a17:902:da4:: with SMTP id 33mr110705465plv.209.1564588182082; Wed, 31 Jul 2019 08:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564588182; cv=none; d=google.com; s=arc-20160816; b=TcLe3H+Cj1GiB4H7lqGX7+NL7l/VG2dyCwZ/NwP/bBqOaCxLN8iEmc/EYFFBOAzkHc crDm0oBKeyoMQIoHRCWw4yMHKZz7R7EwD/aHbIY2ZCSJnGL02B5gIwsJaLM8ZwVWkoC8 JsudIM01RzPoUpe+8FMce48ZAEqzclhyeSY6/9GaYMb+NMVMTQMnughfg0KSvzH35562 dptkoHJJgSpthffsqefN4lpaMT1E8jC7AQ9WDUK9oWPrHkf/VQZZItHF0Wvfo/Hn8NGd h4iihVso0UQ3xxIBEHK4WNcH/kuAGf7MtNP4IBc9mY+VlQz4FSfuicLoA4VlGOgEEPC4 OTZw== 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=cCG731u2YfkSB5eYdLxPnKjT9032CC6TDk+EWjWhbmE=; b=B9k0lQEDekr4uAEPP5hy5zxBzFU1yc9vGm2H/OSx4RNaGwKQ9Bz6zhllF0z2HH3yXr jLyETulGtAZ1/D8yaoKjrg8+OFnnboEcL7/FuQ6lnlubAp+7NlOtQQw1SDb09XkVUUk3 O4FRyQEIu3X/qFjuUcLwYzQzHvYLj6LRz0Shwv1I+eVHdr6o7t6jiNMdma0Oc5EVpLWO Xz0doH0Q3V4UW/gsGCA8+lqC8DIGjV+LB7xbeQJ7AM0Pq+5XGb2/D9ZSAaOU8481hXcr 0lO5ZqkFI2x+YqBGv4YV4OXpKN6Fbz44B4OQkMC8cjY1+zas1/qaNU5FmxbZuJPJJ6ft ISqg== 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 j18si31686479pgh.186.2019.07.31.08.49.26; Wed, 31 Jul 2019 08:49:42 -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 S1730213AbfGaPrR (ORCPT + 99 others); Wed, 31 Jul 2019 11:47:17 -0400 Received: from foss.arm.com ([217.140.110.172]:50172 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730202AbfGaPrP (ORCPT ); Wed, 31 Jul 2019 11:47:15 -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 789A81576; Wed, 31 Jul 2019 08:47:15 -0700 (PDT) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E394B3F694; Wed, 31 Jul 2019 08:47:12 -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 v10 22/22] arm64: mm: Display non-present entries in ptdump Date: Wed, 31 Jul 2019 16:46:03 +0100 Message-Id: <20190731154603.41797-23-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190731154603.41797-1-steven.price@arm.com> References: <20190731154603.41797-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 | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index 5cc71ad567b4..765e8fc5640a 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c @@ -259,21 +259,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 ", - 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"); + 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 (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