Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9738248ybi; Wed, 24 Jul 2019 09:07:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqHbCrtqslY49418L6mAD2W+0MycxXH3bf7/mw9BrLQzdTiTP0CQSh3s83nGRDpCXbEzM1 X-Received: by 2002:a17:902:8207:: with SMTP id x7mr86723324pln.63.1563984432219; Wed, 24 Jul 2019 09:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563984432; cv=none; d=google.com; s=arc-20160816; b=SefSztJHc9pKKtpgkXjRaPmaxJ7PJ2+nzekl0USA1OpnI4ySJcbCNbSsaAWn0TDkBt QsPrLGxMpT+zVWVwXqvOV8zT+twH5J8wrIPkqZsy4IMqtbp/ZYzwu++CGhQCnNkoJwJ1 3p1OLCM4KcwoluvYXamXqprdeXzIRA0us0oEkeDdul/UrVZaqt3qLnN79E7d17D5NmwC K57UrKtbE+Lm9vP8EMxQfbUJVyYziBrqbgyfi7vYjfrYTWiGPQAm2WSX7i2lGkkzjYWO lQcC/Mu1q3PpVnuk64Mj+VtPgLfdV/mjNMyPvUZmJIV8EWGJ1qMQ7GWZLg3Ai4spGl3b ZNeg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LkCUzc18basGUDp6OqoEbeqDJDPyww5tVbHDdIoUd5k=; b=SDewo72N0kC1x87qw1KIw86ihzmlglH/OkQ5I7UdqW4MAaEAo2KVIxsBjrU6xSNIKb gaAcIXDGptixm5fAoqyL9ju29kpgvtqRgvu3bPYsL427ke6Weh+SKHV3tlHpgz9nmYhc j+YBCWcJNguwqd6i0A+e6WfvnsPn5+M3QRrzZb4eHLE56t/Yeb1y5rHS1PZAawvwRpg6 2nZfyeiqeNQdgEwzgxtCub7t8OL0zqVUwExXiI1JZriKD+/bVrIpZmI/n/6ceUw5Kko7 mdppHy9EhVlKlpeZcI2JqG6NzV5YeyNvEaXxGrEMuWcIwVy6SwgYevV0L5cUxizAmCvq 7Hew== 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 2si15639351pla.22.2019.07.24.09.06.57; Wed, 24 Jul 2019 09:07:12 -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 S1727601AbfGXNfj (ORCPT + 99 others); Wed, 24 Jul 2019 09:35:39 -0400 Received: from foss.arm.com ([217.140.110.172]:40916 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbfGXNfi (ORCPT ); Wed, 24 Jul 2019 09:35:38 -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 E512F28; Wed, 24 Jul 2019 06:35:37 -0700 (PDT) Received: from [10.1.196.133] (e112269-lin.cambridge.arm.com [10.1.196.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7FA4B3F71A; Wed, 24 Jul 2019 06:35:35 -0700 (PDT) Subject: Re: [PATCH v9 00/21] Generic page walk and ptdump To: Mark Rutland Cc: x86@kernel.org, Arnd Bergmann , Ard Biesheuvel , Peter Zijlstra , Catalin Marinas , Dave Hansen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , James Morse , Thomas Gleixner , Will Deacon , Andrew Morton , linux-arm-kernel@lists.infradead.org, "Liang, Kan" References: <20190722154210.42799-1-steven.price@arm.com> <20190723101639.GD8085@lakrids.cambridge.arm.com> From: Steven Price Message-ID: Date: Wed, 24 Jul 2019 14:35:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190723101639.GD8085@lakrids.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/07/2019 11:16, Mark Rutland wrote: > On Mon, Jul 22, 2019 at 04:41:49PM +0100, Steven Price wrote: >> This is a slight reworking and extension of my previous patch set >> (Convert x86 & arm64 to use generic page walk), but I've continued the >> version numbering as most of the changes are the same. In particular >> this series ends with a generic PTDUMP implemention for arm64 and x86. >> >> Many architectures current have a debugfs file for dumping the kernel >> page tables. Currently each architecture has to implement custom >> functions for this because the details of walking the page tables used >> by the kernel are different between architectures. >> >> This series extends the capabilities of walk_page_range() so that it can >> deal with the page tables of the kernel (which have no VMAs and can >> contain larger huge pages than exist for user space). A generic PTDUMP >> implementation is the implemented making use of the new functionality of >> walk_page_range() and finally arm64 and x86 are switch to using it, >> removing the custom table walkers. >> >> To enable a generic page table walker to walk the unusual mappings of >> the kernel we need to implement a set of functions which let us know >> when the walker has reached the leaf entry. After a suggestion from Will >> Deacon I've chosen the name p?d_leaf() as this (hopefully) describes >> the purpose (and is a new name so has no historic baggage). Some >> architectures have p?d_large macros but this is easily confused with >> "large pages". >> >> Mostly this is a clean up and there should be very little functional >> change. The exceptions are: >> >> * x86 PTDUMP debugfs output no longer display pages which aren't >> present (patch 14). >> >> * arm64 has the ability to efficiently process KASAN pages (which >> previously only x86 implemented). This means that the combination of >> KASAN and DEBUG_WX is now useable. > > Are there any visible changes to the arm64 output? arm64 output shouldn't change. I've confirmed that "efi_page_tables" is identical on a Juno before/after the change. "kernel_page_tables" obviously will vary depending on the exact layout of memory, but the format isn't changed. x86 output does change due to patch 14. In this case the change is removing the lines from the output of the form... > 0xffffffff84800000-0xffffffffa0000000 440M pmd ...which are unpopulated areas of the memory map. Populated lines which have attributes are unchanged. Steve