[PATCH v4 06/19] s390: mm: Add p?d_large() definitions

2019-03-06 Thread Steven Price
implemented as static inline functions. Add a #define so we don't pick up the generic version introduced in a later patch. CC: Martin Schwidefsky CC: Heiko Carstens CC: linux-s...@vger.kernel.org Signed-off-by: Steven Price --- arch/s390/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions

[PATCH v4 04/19] powerpc: mm: Add p?d_large() definitions

2019-03-06 Thread Steven Price
-...@vger.kernel.org Signed-off-by: Steven Price --- arch/powerpc/include/asm/book3s/64/pgtable.h | 30 ++-- arch/powerpc/kvm/book3s_64_mmu_radix.c | 12 ++-- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch

[PATCH v4 01/19] arc: mm: Add p?d_large() definitions

2019-03-06 Thread Steven Price
() is needed. CC: Vineet Gupta CC: linux-snps-...@lists.infradead.org Signed-off-by: Steven Price Acked-by: Vineet Gupta --- arch/arc/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index cf4be70d5892

[PATCH v4 05/19] riscv: mm: Add p?d_large() definitions

2019-03-06 Thread Steven Price
or execute bit set on it. CC: Palmer Dabbelt CC: Albert Ou CC: linux-ri...@lists.infradead.org Signed-off-by: Steven Price --- arch/riscv/include/asm/pgtable-64.h | 7 +++ arch/riscv/include/asm/pgtable.h| 7 +++ 2 files changed, 14 insertions(+) diff --git a/arch/riscv/include/asm

[PATCH v4 03/19] mips: mm: Add p?d_large() definitions

2019-03-06 Thread Steven Price
...@vger.kernel.org Signed-off-by: Steven Price --- arch/mips/include/asm/pgtable-64.h | 8 1 file changed, 8 insertions(+) diff --git a/arch/mips/include/asm/pgtable-64.h b/arch/mips/include/asm/pgtable-64.h index 93a9dce31f25..42162877ac62 100644 --- a/arch/mips/include/asm/pgtable-64.h +++ b/arch

[PATCH v4 02/19] arm64: mm: Add p?d_large() definitions

2019-03-06 Thread Steven Price
we can reuse for p?d_large(). CC: Catalin Marinas CC: Will Deacon Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index de70c1eabf33..6eef345dbaf4 100644

[PATCH v4 00/19] Convert x86 & arm64 to use generic page walk

2019-03-06 Thread Steven Price
in mm/pagewalk.c) Steven Price (19): arc: mm: Add p?d_large() definitions arm64: mm: Add p?d_large() definitions mips: mm: Add p?d_large() definitions powerpc: mm: Add p?d_large() definitions riscv: mm: Add p?d_large() definitions s390: mm: Add p?d_large() definitions sparc: mm

Re: [PATCH v3 08/34] ia64: mm: Add p?d_large() definitions

2019-03-06 Thread Steven Price
On 04/03/2019 19:06, Luck, Tony wrote: > On Mon, Mar 04, 2019 at 01:16:47PM +0000, Steven Price wrote: >> On 01/03/2019 21:57, Kirill A. Shutemov wrote: >>> On Wed, Feb 27, 2019 at 05:05:42PM +, Steven Price wrote: >>>> walk_page_range() is going to be allowed

Re: [PATCH v2 03/13] mm: Add generic p?d_large() macros

2019-03-04 Thread Steven Price
On 03/03/2019 07:12, Mike Rapoport wrote: > On Fri, Mar 01, 2019 at 01:39:30PM +0000, Steven Price wrote: >> On 01/03/2019 12:30, Kirill A. Shutemov wrote: >>> On Fri, Mar 01, 2019 at 01:53:01PM +0200, Mike Rapoport wrote: >>>> Him Kirill, >>>> >>>

Re: [PATCH v3 08/34] ia64: mm: Add p?d_large() definitions

2019-03-04 Thread Steven Price
On 01/03/2019 21:57, Kirill A. Shutemov wrote: > On Wed, Feb 27, 2019 at 05:05:42PM +0000, Steven Price wrote: >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'leaf' ent

Re: [PATCH v3 05/34] c6x: mm: Add p?d_large() definitions

2019-03-04 Thread Steven Price
On 01/03/2019 21:48, Kirill A. Shutemov wrote: > On Wed, Feb 27, 2019 at 05:05:39PM +0000, Steven Price wrote: >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'leaf' ent

Re: [PATCH v3 03/34] arm: mm: Add p?d_large() definitions

2019-03-04 Thread Steven Price
On 01/03/2019 21:47, Kirill A. Shutemov wrote: > On Wed, Feb 27, 2019 at 05:05:37PM +0000, Steven Price wrote: >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'leaf' ent

Re: [PATCH v2 03/13] mm: Add generic p?d_large() macros

2019-03-01 Thread Steven Price
On 01/03/2019 12:30, Kirill A. Shutemov wrote: > On Fri, Mar 01, 2019 at 01:53:01PM +0200, Mike Rapoport wrote: >> Him Kirill, >> >> On Fri, Feb 22, 2019 at 12:06:18AM +0300, Kirill A. Shutemov wrote: >>> On Thu, Feb 21, 2019 at 05:16:46PM +, Steven Price wr

Re: [PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-03-01 Thread Steven Price
On 28/02/2019 19:00, Dave Hansen wrote: > On 2/28/19 3:28 AM, Steven Price wrote: >> static int get_level(unsigned long addr, unsigned long end) >> { >> /* Add 1 to account for ~0ULL */ >> unsigned long size = (end - addr) + 1; >> if (size <

Re: [PATCH v3 11/34] mips: mm: Add p?d_large() definitions

2019-03-01 Thread Steven Price
On 28/02/2019 18:55, Paul Burton wrote: > Hi Steven, > > On Thu, Feb 28, 2019 at 12:11:24PM +0000, Steven Price wrote: >> On 28/02/2019 02:15, Paul Burton wrote: >>> On Wed, Feb 27, 2019 at 05:05:45PM +, Steven Price wrote: >>>> For mips, we don't suppor

Re: [PATCH v3 11/34] mips: mm: Add p?d_large() definitions

2019-02-28 Thread Steven Price
On 28/02/2019 02:15, Paul Burton wrote: > Hi Steven, > > On Wed, Feb 27, 2019 at 05:05:45PM +0000, Steven Price wrote: >> For mips, we don't support large pages on 32 bit so add stubs returning 0. > > So far so good :) > >> For 64 bit look for _PAGE_HUGE flag

Re: [PATCH v3 09/34] m68k: mm: Add p?d_large() definitions

2019-02-28 Thread Steven Price
On 28/02/2019 11:53, Geert Uytterhoeven wrote: > Hi Mike, > > On Thu, Feb 28, 2019 at 12:37 PM Mike Rapoport wrote: >> On Wed, Feb 27, 2019 at 08:27:40PM +0100, Geert Uytterhoeven wrote: >>> On Wed, Feb 27, 2019 at 6:07 PM Steven Price wrote: >>>> walk

Re: [PATCH v3 20/34] sparc: mm: Add p?d_large() definitions

2019-02-28 Thread Steven Price
On 27/02/2019 18:38, David Miller wrote: > From: Steven Price > Date: Wed, 27 Feb 2019 17:05:54 + > >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'lea

Re: [PATCH v3 18/34] s390: mm: Add p?d_large() definitions

2019-02-28 Thread Steven Price
On 27/02/2019 17:40, Martin Schwidefsky wrote: > On Wed, 27 Feb 2019 17:05:52 + > Steven Price wrote: > >> walk_page_range() is going to be allowed to walk page tables other than >> those of user space. For this it needs to know when it has reached a >> 'lea

Re: [PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-28 Thread Steven Price
On 27/02/2019 17:38, Dave Hansen wrote: > On 2/27/19 9:06 AM, Steven Price wrote: >> #ifdef CONFIG_SHMEM >> static int smaps_pte_hole(unsigned long addr, unsigned long end, >> -struct mm_walk *walk) >> + __always_unused int

[PATCH v3 26/34] mm: pagewalk: Allow walking without vma

2019-02-27 Thread Steven Price
r. Remove the requirement to have a vma except when trying to split huge pages. Signed-off-by: Steven Price --- mm/pagewalk.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mm/pagewalk.c b/mm/pagewalk.c index 98373a9f88b8..dac0c848b458 10064

[PATCH v3 32/34] x86/mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct

2019-02-27 Thread Steven Price
To enable x86 to use the generic walk_page_range() function, the callers of ptdump_walk_pgd_level_debugfs() need to pass in the mm_struct. This means that ptdump_walk_pgd_level_core() is now always passed a valid pgd, so drop the support for pgd==NULL. Signed-off-by: Steven Price --- arch/x86

[PATCH v3 30/34] x86/mm: Point to struct seq_file from struct pg_state

2019-02-27 Thread Steven Price
-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 69 ++- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index e3cdc85ce5b6..ecbaf30a6a2f 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch

[PATCH v3 24/34] mm: Add generic p?d_large() macros

2019-02-27 Thread Steven Price
(). For x86 move the existing definitions of p?d_large() so that they are only defined when the corresponding levels are not folded. Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 21 - include/asm-generic/4level-fixup.h | 1 + include/asm

[PATCH v3 34/34] x86: mm: Convert dump_pagetables to use walk_page_range

2019-02-27 Thread Steven Price
callbacks which can decide to skip an entire tree of entries Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 279 ++ 1 file changed, 146 insertions(+), 133 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index

[PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-27 Thread Steven Price
that is reported is the actual level where the entry is missing (ignoring any folding that is in place), i.e. any levels where PTRS_PER_P?D is set to 1 are ignored. Note that depth starts at 0 for a PGD so that PUD/PMD/PTE retain their natural numbers as levels 2/3/4. Signed-off-by: Steven Price --- fs

[PATCH v3 33/34] x86/mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-02-27 Thread Steven Price
page tables. This fake_mm structure is initialised with the minimum necessary for the generic page walk code. Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 36 --- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/arch/x86/mm

[PATCH v3 25/34] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-02-27 Thread Steven Price
ll entries, not just transparent huge pages. Signed-off-by: Steven Price --- include/linux/mm.h | 9 ++--- mm/pagewalk.c | 27 --- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 80bb6408fe73.

[PATCH v3 23/34] xtensa: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Chris Zankel CC: Max Filippov CC: linux-xte...@linux-xtensa.org Signed-off-by: Steven Price --- arch/xtensa/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 29cfe421cf41

[PATCH v3 31/34] x86/mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct

2019-02-27 Thread Steven Price
Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 2 +- arch/x86/mm/dump_pagetables.c | 4 ++-- arch/x86/platform/efi/efi_32.c | 2 +- arch/x86/platform/efi/efi_64.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/i

[PATCH v3 28/34] mm: pagewalk: Add test_p?d callbacks

2019-02-27 Thread Steven Price
It is useful to be able to skip parts of the page table tree even when walking without VMAs. Add test_p?d callbacks similar to test_walk but which are called just before a table at that level is walked. If the callback returns non-zero then the entire table is skipped. Signed-off-by: Steven Price

[PATCH v3 29/34] arm64: mm: Convert mm/dump.c to use walk_page_range()

2019-02-27 Thread Steven Price
Now walk_page_range() can walk kernel page tables, we can switch the arm64 ptdump code over to using it, simplifying the code. Signed-off-by: Steven Price --- arch/arm64/mm/dump.c | 108 +-- 1 file changed, 53 insertions(+), 55 deletions(-) diff --git

[PATCH v3 22/34] unicore32: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
a stub returning 0. CC: Guan Xuetao Signed-off-by: Steven Price --- arch/unicore32/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/unicore32/include/asm/pgtable.h b/arch/unicore32/include/asm/pgtable.h index a4f2bef37e70..b45429df8b99 100644 --- a/arch/unicore32

[PATCH v3 10/34] microblaze: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
stubs returning 0. CC: Michal Simek Signed-off-by: Steven Price --- arch/microblaze/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/microblaze/include/asm/pgtable.h b/arch/microblaze/include/asm/pgtable.h index 142d3f004848..044ea7dbb4cc 100644 --- a/arch/microblaze

[PATCH v3 13/34] nios2: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Ley Foon Tan CC: nios2-...@lists.rocketboards.org Signed-off-by: Steven Price --- arch/nios2/include/asm/pgtable.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/nios2/include/asm/pgtable.h b/arch/nios2/include/asm/pgtable.h index db4f7d179220..b6ee0c205279 100644

[PATCH v3 14/34] openrisc: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Jonas Bonn CC: Stefan Kristiansson CC: Stafford Horne CC: openr...@lists.librecores.org Signed-off-by: Steven Price --- arch/openrisc/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/openrisc/include/asm/pgtable.h b/arch/openrisc/include/asm

[PATCH v3 12/34] nds32: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Greentime Hu CC: Vincent Chen Signed-off-by: Steven Price --- arch/nds32/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/nds32/include/asm/pgtable.h b/arch/nds32/include/asm/pgtable.h index 9f52db930c00..202ac93c0a6b 100644 --- a/arch/nds32/include

[PATCH v3 15/34] parisc: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: "James E.J. Bottomley" CC: Helge Deller CC: linux-par...@vger.kernel.org Signed-off-by: Steven Price --- arch/parisc/include/asm/pgtable.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtab

[PATCH v3 20/34] sparc: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Steven Price --- arch/sparc/include/asm/pgtable_32.h | 10 ++ arch/sparc/include/asm/pgtable_64.h | 1 + 2 files changed, 11 insertions(+) diff --git a/arch/sparc/include/asm/pgtable_32.h b/

[PATCH v3 16/34] powerpc: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
CC: linuxppc-...@lists.ozlabs.org CC: kvm-...@vger.kernel.org Signed-off-by: Steven Price --- arch/powerpc/include/asm/book3s/32/pgtable.h | 1 + arch/powerpc/include/asm/book3s/64/pgtable.h | 27 --- arch/powerpc/include/asm/nohash/32/pgtable.h | 1 + .../include/asm/nohash/64

[PATCH v3 17/34] riscv: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
or execute bit set on it. CC: Palmer Dabbelt CC: Albert Ou CC: linux-ri...@lists.infradead.org Signed-off-by: Steven Price --- arch/riscv/include/asm/pgtable-64.h | 6 ++ arch/riscv/include/asm/pgtable.h| 6 ++ 2 files changed, 12 insertions(+) diff --git a/arch/riscv/include/asm

[PATCH v3 19/34] sh: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Yoshinori Sato CC: Rich Felker CC: linux...@vger.kernel.org Signed-off-by: Steven Price --- arch/sh/include/asm/pgtable-3level.h | 1 + arch/sh/include/asm/pgtable_32.h | 1 + arch/sh/include/asm/pgtable_64.h | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/sh

[PATCH v3 09/34] m68k: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0 CC: Geert Uytterhoeven CC: linux-m...@lists.linux-m68k.org Signed-off-by: Steven Price --- arch/m68k/include/asm/mcf_pgtable.h | 2 ++ arch/m68k/include/asm/motorola_pgtable.h | 2 ++ arch/m68k/include/asm/pgtable_no.h | 1 + arch/m68k/include/asm/sun3_pgtable.h | 2 ++ 4

[PATCH v3 18/34] s390: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Martin Schwidefsky CC: Heiko Carstens CC: linux-s...@vger.kernel.org Signed-off-by: Steven Price --- arch/s390/include/asm/pgtable.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 063732414dfb

[PATCH v3 21/34] um: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Jeff Dike CC: Richard Weinberger CC: Anton Ivanov CC: linux...@lists.infradead.org Signed-off-by: Steven Price --- arch/um/include/asm/pgtable-3level.h | 1 + arch/um/include/asm/pgtable.h| 1 + 2 files changed, 2 insertions(+) diff --git a/arch/um/include/asm/pgtable

[PATCH v3 11/34] mips: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
stubs returning 0. For 64 bit look for _PAGE_HUGE flag being set. This means exposing the flag when !CONFIG_MIPS_HUGE_TLB_SUPPORT. CC: Ralf Baechle CC: Paul Burton CC: James Hogan CC: linux-m...@vger.kernel.org Signed-off-by: Steven Price --- arch/mips/include/asm/pgtable-32.h | 5

[PATCH v3 01/34] alpha: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: linux-al...@vger.kernel.org CC: Richard Henderson CC: Ivan Kokshaysky CC: Matt Turner Signed-off-by: Steven Price --- arch/alpha/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/alpha/include/asm/pgtable.h b/arch/alpha/include/asm/pgtable.h

[PATCH v3 08/34] ia64: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
implement stubs returning 0. CC: Tony Luck CC: Fenghua Yu CC: linux-i...@vger.kernel.org Signed-off-by: Steven Price --- arch/ia64/include/asm/pgtable.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/ia64/include/asm/pgtable.h b/arch/ia64/include/asm/pgtable.h index b1e7468eb65a

[PATCH v3 07/34] hexagon: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Richard Kuo CC: linux-hexa...@vger.kernel.org Signed-off-by: Steven Price --- arch/hexagon/include/asm/pgtable.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/hexagon/include/asm/pgtable.h b/arch/hexagon/include/asm/pgtable.h index 65125d0b02dd..422e6aa2a6ef

[PATCH v3 05/34] c6x: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
just add stubs. CC: Mark Salter CC: Aurelien Jacquiot CC: linux-c6x-...@linux-c6x.org Signed-off-by: Steven Price --- arch/c6x/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/c6x/include/asm/pgtable.h b/arch/c6x/include/asm/pgtable.h index ec4db6df5e0d

[PATCH v3 00/34] Convert x86 & arm64 to use generic page walk

2019-02-27 Thread Steven Price
() function in mm/pagewalk.c) Steven Price (34): alpha: mm: Add p?d_large() definitions arc: mm: Add p?d_large() definitions arm: mm: Add p?d_large() definitions arm64: mm: Add p?d_large() definitions c6x: mm: Add p?d_large() definitions csky: mm: Add p?d_large() definitions hexagon: mm

[PATCH v3 06/34] csky: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
returning 0. CC: Guo Ren Signed-off-by: Steven Price --- arch/csky/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/csky/include/asm/pgtable.h b/arch/csky/include/asm/pgtable.h index edfcbb25fd9f..4ffdb6bfbede 100644 --- a/arch/csky/include/asm/pgtable.h +++ b/arch

[PATCH v3 03/34] arm: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
. Add a stub for PUD as we don't have huge pages at that level. CC: Russell King Signed-off-by: Steven Price --- arch/arm/include/asm/pgtable-2level.h | 1 + arch/arm/include/asm/pgtable-3level.h | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch

[PATCH v3 04/34] arm64: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
we can reuse for p?d_large(). CC: Catalin Marinas CC: Will Deacon Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index de70c1eabf33..6eef345dbaf4 100644

[PATCH v3 02/34] arc: mm: Add p?d_large() definitions

2019-02-27 Thread Steven Price
() is needed. CC: Vineet Gupta CC: linux-snps-...@lists.infradead.org Signed-off-by: Steven Price --- arch/arc/include/asm/pgtable.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h index cf4be70d5892..0edd27bc7018 100644

Re: [PATCH v2 03/13] mm: Add generic p?d_large() macros

2019-02-22 Thread Steven Price
On 21/02/2019 21:06, Kirill A. Shutemov wrote: > On Thu, Feb 21, 2019 at 05:16:46PM +0000, Steven Price wrote: >>>> Note that in terms of the new page walking code, these new defines are >>>> only used when walking a page table without a VMA (which isn't currently &

Re: [PATCH v2 03/13] mm: Add generic p?d_large() macros

2019-02-21 Thread Steven Price
On 21/02/2019 14:57, Kirill A. Shutemov wrote: > On Thu, Feb 21, 2019 at 02:46:18PM +0000, Steven Price wrote: >> On 21/02/2019 14:28, Kirill A. Shutemov wrote: >>> On Thu, Feb 21, 2019 at 11:34:52AM +, Steven Price wrote: >>>> From: James Morse >>

Re: [PATCH v2 03/13] mm: Add generic p?d_large() macros

2019-02-21 Thread Steven Price
On 21/02/2019 14:28, Kirill A. Shutemov wrote: > On Thu, Feb 21, 2019 at 11:34:52AM +0000, Steven Price wrote: >> From: James Morse >> >> Exposing the pud/pgd levels of the page tables to walk_page_range() means >> we may come across the exotic large mappings

[PATCH v2 09/13] x86/mm: Point to struct seq_file from struct pg_state

2019-02-21 Thread Steven Price
-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 69 ++- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index cf37abc0f58a..b1b86157d456 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch

[PATCH v2 06/13] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-21 Thread Steven Price
that is reported is the actual level where the entry is missing (ignoring any folding that is in place), i.e. any levels where PTRS_PER_P?D is set to 1 are ignored. Note that depth starts at 0 for a PGD so that PUD/PMD/PTE retain their natural numbers as levels 2/3/4. Signed-off-by: Steven Price --- fs

[PATCH v2 13/13] x86: mm: Convert dump_pagetables to use walk_page_range

2019-02-21 Thread Steven Price
callbacks which can decide to skip an entire tree of entries Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 282 ++ 1 file changed, 146 insertions(+), 136 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index

[PATCH v2 12/13] x86/mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-02-21 Thread Steven Price
page tables. This fake_mm structure is initialised with the minimum necessary for the generic page walk code. Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 36 --- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/arch/x86/mm

[PATCH v2 08/13] arm64: mm: Convert mm/dump.c to use walk_page_range()

2019-02-21 Thread Steven Price
Now walk_page_range() can walk kernel page tables, we can switch the arm64 ptdump code over to using it, simplifying the code. Signed-off-by: Steven Price --- arch/arm64/mm/dump.c | 108 +-- 1 file changed, 53 insertions(+), 55 deletions(-) diff --git

[PATCH v2 10/13] x86/mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct

2019-02-21 Thread Steven Price
Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 2 +- arch/x86/mm/dump_pagetables.c | 4 ++-- arch/x86/platform/efi/efi_32.c | 2 +- arch/x86/platform/efi/efi_64.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/i

[PATCH v2 11/13] x86/mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct

2019-02-21 Thread Steven Price
To enable x86 to use the generic walk_page_range() function, the callers of ptdump_walk_pgd_level_debugfs() need to pass in the mm_struct. This means that ptdump_walk_pgd_level_core() is now always passed a valid pgd, so drop the support for pgd==NULL. Signed-off-by: Steven Price --- arch/x86

[PATCH v2 07/13] mm: pagewalk: Add test_p?d callbacks

2019-02-21 Thread Steven Price
It is useful to be able to skip parts of the page table tree even when walking without VMAs. Add test_p?d callbacks similar to test_walk but which are called just before a table at that level is walked. If the callback returns non-zero then the entire table is skipped. Signed-off-by: Steven Price

[PATCH v2 02/13] x86/mm: Add p?d_large() definitions

2019-02-21 Thread Steven Price
these defined as inline functions, add a macro of the same name so we don't end up with the generic version too. Signed-off-by: James Morse Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/mm/dump_pagetables.c | 3 +++ 2 files changed, 6 insertions(+) diff --git

[PATCH v2 04/13] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-02-21 Thread Steven Price
ll entries, not just transparent huge pages. Signed-off-by: Steven Price --- include/linux/mm.h | 9 ++--- mm/pagewalk.c | 27 --- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 80bb6408fe73.

[PATCH v2 03/13] mm: Add generic p?d_large() macros

2019-02-21 Thread Steven Price
nothing default. Signed-off-by: James Morse Signed-off-by: Steven Price --- include/asm-generic/pgtable.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 05e61e6c843f..f0de24100ac6 100644 --- a/include/asm

[PATCH v2 05/13] mm: pagewalk: Allow walking without vma

2019-02-21 Thread Steven Price
r. Remove the requirement to have a vma except when trying to split huge pages. Signed-off-by: Steven Price --- mm/pagewalk.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mm/pagewalk.c b/mm/pagewalk.c index 98373a9f88b8..dac0c848b458 10064

[PATCH v2 00/13] Convert x86 & arm64 to use generic page walk

2019-02-21 Thread Steven Price
to explain mapping between depth and P?D * Handle folded page tables at all levels, so depth from pte_hole() ignores folding at any level (see real_depth() function in mm/pagewalk.c) James Morse (2): arm64: mm: Add p?d_large() definitions mm: Add generic p?d_large() macros Steven Price (11

[PATCH v2 01/13] arm64: mm: Add p?d_large() definitions

2019-02-21 Thread Steven Price
. arm64 already has these macros defined, but with a different name. p?d_large() is used by s390, sparc and x86. Only arm/arm64 use p?d_sect(). Add a macro to allow both names. Signed-off-by: James Morse Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 ++ 1 file changed, 2

Re: [PATCH 06/13] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-20 Thread Steven Price
On 20/02/2019 11:35, William Kucharski wrote: > > >> On Feb 15, 2019, at 10:02 AM, Steven Price wrote: >> >> The pte_hole() callback is called at multiple levels of the page tables. >> Code dumping the kernel page tables needs to know what at what dept

Re: [PATCH 03/13] mm: Add generic p?d_large() macros

2019-02-20 Thread Steven Price
On 19/02/2019 03:44, Liang, Kan wrote: > > > On 2/18/2019 9:19 AM, Steven Price wrote: >> On 18/02/2019 11:31, Peter Zijlstra wrote: >>> On Fri, Feb 15, 2019 at 05:02:24PM +, Steven Price wrote: >>>> From: James Morse >>>> >

Re: [PATCH 01/13] arm64: mm: Add p?d_large() definitions

2019-02-18 Thread Steven Price
On 18/02/2019 17:04, Mark Rutland wrote: > On Mon, Feb 18, 2019 at 03:30:38PM +0000, Steven Price wrote: >> On 18/02/2019 15:06, Peter Zijlstra wrote: >>> On Mon, Feb 18, 2019 at 02:29:52PM +, Mark Rutland wrote: >>>> I think that Peter means p?d_huge(x)

Re: [PATCH 01/13] arm64: mm: Add p?d_large() definitions

2019-02-18 Thread Steven Price
On 18/02/2019 15:06, Peter Zijlstra wrote: > On Mon, Feb 18, 2019 at 02:29:52PM +, Mark Rutland wrote: >> I think that Peter means p?d_huge(x) should imply p?d_large(x), e.g. >> >> #define pmd_large(x) \ >> (pmd_sect(x) || pmd_huge(x) || pmd_trans_huge(x)) >> >> ... which should work

Re: [PATCH 06/13] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-18 Thread Steven Price
On 18/02/2019 11:23, Mark Rutland wrote: > On Fri, Feb 15, 2019 at 05:02:27PM +0000, Steven Price wrote: >> +/* If the p4ds are actually just pgds then we should report a depth >> + * of 0 not 1 (as a missing entry is really a missing pgd >> + */ > > Nit: comment style

Re: [PATCH 03/13] mm: Add generic p?d_large() macros

2019-02-18 Thread Steven Price
On 18/02/2019 12:53, Peter Zijlstra wrote: > On Mon, Feb 18, 2019 at 11:14:23AM +, Mark Rutland wrote: >>> +#ifndef pgd_large >>> +#define pgd_large(x)0 >>> +#endif >>> +#ifndef pud_large >>> +#define pud_large(x)0 >>> +#endif >>> +#ifndef pmd_large >>> +#define pmd_large(x)0 >>> +#endif >> >>

Re: [PATCH 03/13] mm: Add generic p?d_large() macros

2019-02-18 Thread Steven Price
On 18/02/2019 11:31, Peter Zijlstra wrote: > On Fri, Feb 15, 2019 at 05:02:24PM +0000, Steven Price wrote: >> From: James Morse >> >> Exposing the pud/pgd levels of the page tables to walk_page_range() means >> we may come across the exotic large mappings

Re: [PATCH 01/13] arm64: mm: Add p?d_large() definitions

2019-02-18 Thread Steven Price
On 18/02/2019 11:29, Peter Zijlstra wrote: > On Fri, Feb 15, 2019 at 05:02:22PM +0000, Steven Price wrote: > >> diff --git a/arch/arm64/include/asm/pgtable.h >> b/arch/arm64/include/asm/pgtable.h >> index de70c1eabf33..09d308921625 100644 >> --- a/arch/arm64/inclu

Re: [PATCH 13/13] x86: mm: Convert dump_pagetables to use walk_page_range

2019-02-15 Thread Steven Price
On 15/02/2019 17:16, Dave Hansen wrote: > On 2/15/19 9:02 AM, Steven Price wrote: >> arch/x86/mm/dump_pagetables.c | 281 ++ >> 1 file changed, 146 insertions(+), 135 deletions(-) > > I'll look through this in more detail in a bit. But, I

[PATCH 05/13] mm: pagewalk: Allow walking without vma

2019-02-15 Thread Steven Price
r. Remove the requirement to have a vma except when trying to split huge pages. Signed-off-by: Steven Price --- mm/pagewalk.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mm/pagewalk.c b/mm/pagewalk.c index 98373a9f88b8..dac0c848b458 10064

[PATCH 10/13] x86/mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct

2019-02-15 Thread Steven Price
Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 2 +- arch/x86/mm/dump_pagetables.c | 4 ++-- arch/x86/platform/efi/efi_32.c | 2 +- arch/x86/platform/efi/efi_64.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/i

[PATCH 13/13] x86: mm: Convert dump_pagetables to use walk_page_range

2019-02-15 Thread Steven Price
callbacks which can decide to skip an entire tree of entries Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 281 ++ 1 file changed, 146 insertions(+), 135 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index

[PATCH 11/13] x86/mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct

2019-02-15 Thread Steven Price
To enable x86 to use the generic walk_page_range() function, the callers of ptdump_walk_pgd_level_debugfs() need to pass in the mm_struct. This means that ptdump_walk_pgd_level_core() is now always passed a valid pgd, so drop the support for pgd==NULL. Signed-off-by: Steven Price --- arch/x86

[PATCH 03/13] mm: Add generic p?d_large() macros

2019-02-15 Thread Steven Price
nothing default. Signed-off-by: James Morse Signed-off-by: Steven Price --- include/asm-generic/pgtable.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index 05e61e6c843f..7630d663cd51 100644 --- a/include/asm-generic

[PATCH 12/13] x86/mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-02-15 Thread Steven Price
page tables. This fake_mm structure is initialised with the minimum necessary for the generic page walk code. Signed-off-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 36 --- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/arch/x86/mm

[PATCH 09/13] x86/mm: Point to struct seq_file from struct pg_state

2019-02-15 Thread Steven Price
-by: Steven Price --- arch/x86/mm/dump_pagetables.c | 69 ++- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index 695647dc9cb9..ad6986c9e8e7 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch

[PATCH 07/13] mm: pagewalk: Add test_p?d callbacks

2019-02-15 Thread Steven Price
It is useful to be able to skip parts of the page table tree even when walking without VMAs. Add test_p?d callbacks similar to test_walk but which are called just before a table at that level is walked. If the callback returns non-zero then the entire table is skipped. Signed-off-by: Steven Price

[PATCH 08/13] arm64: mm: Convert mm/dump.c to use walk_page_range()

2019-02-15 Thread Steven Price
Now walk_page_range() can walk kernel page tables, we can switch the arm64 ptdump code over to using it, simplifying the code. Signed-off-by: Steven Price --- arch/arm64/mm/dump.c | 108 +-- 1 file changed, 53 insertions(+), 55 deletions(-) diff --git

[PATCH 04/13] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-02-15 Thread Steven Price
ll entries, not just transparent huge pages. Signed-off-by: Steven Price --- include/linux/mm.h | 9 ++--- mm/pagewalk.c | 27 --- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 80bb6408fe73.

[PATCH 06/13] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-15 Thread Steven Price
starts at 0 for a PGD so that PUD/PMD/PTE retain their natural numbers as levels 2/3/4. Signed-off-by: Steven Price --- fs/proc/task_mmu.c | 4 ++-- include/linux/mm.h | 5 +++-- mm/hmm.c | 2 +- mm/migrate.c | 1 + mm/mincore.c | 1 + mm/pagewalk.c | 16

[PATCH 02/13] x86/mm: Add p?d_large() definitions

2019-02-15 Thread Steven Price
these defined as inline functions, add a macro of the same name so we don't end up with the generic version too. Signed-off-by: James Morse Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 3 +++ arch/x86/mm/dump_pagetables.c | 2 ++ 2 files changed, 5 insertions(+) diff --git

[PATCH 01/13] arm64: mm: Add p?d_large() definitions

2019-02-15 Thread Steven Price
-by: Steven Price --- arch/arm64/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index de70c1eabf33..09d308921625 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h

[PATCH 00/13] Convert x86 & arm64 to use generic page walk

2019-02-15 Thread Steven Price
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

Re: [PATCH 2/8] initramfs: free initrd memory if opening /initrd.image fails

2019-02-14 Thread Steven Price
it means that the initrd is freed (previously it was ignored and never freed). But that seems like reasonable behaviour and the previous behaviour looks like another oversight. FWIW: Reviewed-by: Steven Price > Signed-off-by: Christoph Hellwig > --- > init/initramfs.c | 14 ++

Re: [PATCH 3/3] arm64: update headers to use STUB_UNLESS macro

2019-01-18 Thread Steven Price
On 18/01/2019 16:00, Andrew Murray wrote: > Use the STUB_UNLESS macro to simplify function declaration. > > Signed-off-by: Andrew Murray > --- > arch/arm64/include/asm/acpi.h | 38 +- > arch/arm64/include/asm/alternative.h| 6 +--- >

Re: [PATCH 2/3] cpufreq: update headers to use STUB_UNLESS macro

2019-01-18 Thread Steven Price
On 18/01/2019 16:00, Andrew Murray wrote: > Use the STUB_UNLESS macro to simplify function declaration. > > Signed-off-by: Andrew Murray Reviewed-by: Steven Price > --- > include/linux/cpufreq.h | 21 ++--- > 1 file changed, 6 insertions(+), 15 deletions(

Re: [PATCH 1/3] kconfig.h: abstract empty functions with STUB_UNLESS macro

2019-01-18 Thread Steven Price
' followed by an empty function body. Where optional argument 'body' > then 'body' will be used as the function body, intended to allow for simple > return statements. > > Signed-off-by: Andrew Murray Seems like it should remove a lot of boilerplate code, so looks good to me. Re

Re: [PATCH 5/6] arm64: add sysfs vulnerability show for speculative store bypass

2018-12-14 Thread Steven Price
On 14/12/2018 10:36, Will Deacon wrote: > On Fri, Dec 14, 2018 at 10:34:31AM +0000, Steven Price wrote: >> On 06/12/2018 23:44, Jeremy Linton wrote: >>> From: Mian Yousaf Kaukab >>> >>> Return status based no ssbd_state and the arm64 SSBS feature. >>

<    1   2   3   4   5   6   7   >