Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp928115imj; Fri, 15 Feb 2019 09:06:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZyIYUV4p760f3vtEojUw8VYSDFClOmpyIxbXknEJ5QNS8oDGf8nRo201tvNH+E0SBv7zy1 X-Received: by 2002:a63:f844:: with SMTP id v4mr6248126pgj.82.1550250397813; Fri, 15 Feb 2019 09:06:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550250397; cv=none; d=google.com; s=arc-20160816; b=ljX4nmtzLJNLnwmX4zUdKgF7QWUpJwS95xEYpKs4LkKzlzr5712V1gq8db+XqBFK1h NLDvg3vZVX30CcBdu01iSPtsntTxqiTDigqsGuUKk70J46ELY0dkwYFb3/csE2kyBq1z BLJQGVfMovBjbEXoyt/GD0VwBR1iw7z6deZaI2iobX7EEFJ5QcP5NRachCQOo9u1mR3J qTVK5iJNAPz+NI5ph+yPOUp50Pw4tTGyQ00Q/Shm8pvvgcFf8Qj08g1PFgedPca4niBu dyDGymsnawBkitryMDfBOgBDJu6120cxLzJDyE14/O8GDPPdK3mahSzllWe+YsDIER5s m7/w== 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 :message-id:date:subject:cc:to:from; bh=OLdK6qnJVeZJFxiIfOrWpKFHM3h9lXf0pOIxynRsQ60=; b=xMKhApTc4O6WcHmZW4XaijefD8qmVwgA2VhspuggUxClDmRkuIO0YwyWKsAKtX71KZ rD0tYr6AaRExq50wbaZI9DU33eUS7fpjh6mtof/rv9wzdKm8dHJ6ahxl+IwMpjynDfM3 +3D/Zf6zpYw9ufc55hzBfKkCLY6tykCwCpALnLwoZTdQU2d6YYCy/KWCPfGvX/IAGjV8 jnK9PrD5pzjTrPwJ4GJo0sk6fgjiE03oVRZB1gKasEVveAripGzoAFmMbnwGCRElUy59 U5mveDpkt+wp4RQLRjzCMLpuPQIDy8HYhsYlDO3+aN8YZOXTkxR/pOyrAJw5OQtHiMkm SgNQ== 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 i9si6211267plb.35.2019.02.15.09.06.20; Fri, 15 Feb 2019 09:06:37 -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 S1730255AbfBORDE (ORCPT + 99 others); Fri, 15 Feb 2019 12:03:04 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35592 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbfBORDE (ORCPT ); Fri, 15 Feb 2019 12:03:04 -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 9A0F8EBD; Fri, 15 Feb 2019 09:03:03 -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 A5A373F557; Fri, 15 Feb 2019 09:03:00 -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 Subject: [PATCH 00/13] Convert x86 & arm64 to use generic page walk Date: Fri, 15 Feb 2019 17:02:21 +0000 Message-Id: <20190215170235.23360-1-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 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 Most architectures current have a debugfs file for dumping the kernel page tables. Currently each architecture has to implement custom functions for walking the page tables because the generic walk_page_range() function is unable to walk the page tables used by the kernel. 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). x86 and arm64 are then converted to make use of walk_page_range() removing the custom page table walkers. Potentially future changes could unify the implementations of the debugfs walkers further, moving the common functionality into common code. This would require a common way of handling the effective permissions (currently implemented only for x86) along with a per-arch way of formatting the page table information for debugfs. One immediate benefit would be getting the KASAN speed up optimisation in arm64 (and other arches) which is currently only implemented for x86. James Morse (2): arm64: mm: Add p?d_large() definitions mm: Add generic p?d_large() macros Steven Price (11): x86/mm: Add p?d_large() definitions mm: pagewalk: Add p4d_entry() and pgd_entry() mm: pagewalk: Allow walking without vma mm: pagewalk: Add 'depth' parameter to pte_hole mm: pagewalk: Add test_p?d callbacks arm64: mm: Convert mm/dump.c to use walk_page_range() x86/mm: Point to struct seq_file from struct pg_state x86/mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct x86/mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct x86/mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct x86: mm: Convert dump_pagetables to use walk_page_range arch/arm64/include/asm/pgtable.h | 2 + arch/arm64/mm/dump.c | 108 +++++----- arch/x86/include/asm/pgtable.h | 8 +- arch/x86/mm/debug_pagetables.c | 8 +- arch/x86/mm/dump_pagetables.c | 342 ++++++++++++++++--------------- arch/x86/platform/efi/efi_32.c | 2 +- arch/x86/platform/efi/efi_64.c | 4 +- fs/proc/task_mmu.c | 4 +- include/asm-generic/pgtable.h | 10 + include/linux/mm.h | 25 ++- mm/hmm.c | 2 +- mm/migrate.c | 1 + mm/mincore.c | 1 + mm/pagewalk.c | 92 ++++++--- 14 files changed, 350 insertions(+), 259 deletions(-) -- 2.20.1