Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4324192imb; Wed, 6 Mar 2019 10:32:03 -0800 (PST) X-Google-Smtp-Source: APXvYqzIUNgPByu0ZHJUJ699THjh4aD4qXpRoH/kPaS8tFjxwGRT7qUUcFaKUpTMoOJAk2Im73xC X-Received: by 2002:a63:2141:: with SMTP id s1mr7308630pgm.363.1551897123155; Wed, 06 Mar 2019 10:32:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551897123; cv=none; d=google.com; s=arc-20160816; b=x1ytItuM7GGdPsczv6p79ybz1O/QthrRPet41KpBa+VYVmgoYWdxYj1Duwynnqppep v7e3TgIDeXMC/VjetjAttxXjT3tFBoUitP8jfcGYjrKVOhT3XmPMuyfsCoyzI86HYUZQ cr2xLAe1CmWIXceCjcsBImK9zKO7t4vavWP05HyS82I34eSeaUZxi4PUcuN9HqKxIeDX RNNLW5f1rWclj2OGSCLlZKH29f03pVbl3x2KLPK7Z7ZkH4t4lAS5ZPz4YNlCDN76HZ1e nlD5A51g7obXl8Ag1SVNIKIjX7mFxqkv9VNBfBNActfIuQal9vRq6a2zPhHIwS4sIa2W xgDg== 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=Z2xmHlQRnW0/E7tQW5e32ucEvBkvUl11M26FOjZx8LI=; b=xPiN51AHamABJPRLZym6R2TcSVjgB4AZcJRxtRirIIyJYEsroicp1Lc8Pw3xuNYIUZ h0jw9opXaGCKt1H3LdcwwhbLk6cjKJWOKFJ1KAMe0PF7J5Vl5BSf/0ahHzL/xUwCjVfB ocaJK3ydkgVEQ8maGyyBetbVmoiPb3Mmood6CI/YNuzs8W1SeOyQDEMkiDrxfsNEKFQM IGmdLqtIuMv3yGM2bGoR7sSgRo1z2AmbcQWX9jYDP2Vr7JWPk/xkBETUik7Ehy/bDCCR Sd1mtGWFJmozYKJhAbH+DW1cfaA/1Df0mWJ1AM9JnX18F5c5J+c2qMs1IBb7JY16lBqi QW6w== 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 n7si2117141plk.85.2019.03.06.10.31.47; Wed, 06 Mar 2019 10:32:03 -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 S1730251AbfCFPvk (ORCPT + 99 others); Wed, 6 Mar 2019 10:51:40 -0500 Received: from foss.arm.com ([217.140.101.70]:34650 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730211AbfCFPvh (ORCPT ); Wed, 6 Mar 2019 10:51:37 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9261F80D; Wed, 6 Mar 2019 07:51:37 -0800 (PST) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 573AC3F703; Wed, 6 Mar 2019 07:51:34 -0800 (PST) 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" Subject: [PATCH v4 14/19] x86: mm: Don't display pages which aren't present in debugfs Date: Wed, 6 Mar 2019 15:50:26 +0000 Message-Id: <20190306155031.4291-15-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190306155031.4291-1-steven.price@arm.com> References: <20190306155031.4291-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 For the /sys/kernel/debug/page_tables/ files, rather than outputing a mostly empty line when a block of memory isn't present just skip the line. This keeps the output shorter and will help with a future change switching to using the generic page walk code as we no longer care about the 'level' that the page table holes are at. Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index cf37abc0f58a..f9eb25dd3766 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch/x86/mm/dump_pagetables.c @@ -304,8 +304,8 @@ static void note_page(struct seq_file *m, struct pg_state *st, /* * Now print the actual finished series */ - if (!st->marker->max_lines || - st->lines < st->marker->max_lines) { + if ((cur & _PAGE_PRESENT) && (!st->marker->max_lines || + st->lines < st->marker->max_lines)) { pt_dump_seq_printf(m, st->to_dmesg, "0x%0*lx-0x%0*lx ", width, st->start_address, @@ -321,7 +321,8 @@ static void note_page(struct seq_file *m, struct pg_state *st, printk_prot(m, st->current_prot, st->level, st->to_dmesg); } - st->lines++; + if (cur & _PAGE_PRESENT) + st->lines++; /* * We print markers for special areas of address space, -- 2.20.1