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

2019-02-14 Thread Steven Price
eans 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 ++

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

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

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

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

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

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

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

2019-02-15 Thread Steven Price
y has 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(+) di

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

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

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

2019-02-15 Thread Steven Price
: 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 03/13] mm: Add generic p?d_large() macros

2019-02-15 Thread Steven Price
ded a does 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/a

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

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

[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 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 10/13] x86/mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct

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

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,

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 >>>> >&g

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 depth >>

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

2019-02-21 Thread Steven Price
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
pings. 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 chang

[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 03/13] mm: Add generic p?d_large() macros

2019-02-21 Thread Steven Price
ded a does 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/i

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

2019-02-21 Thread Steven Price
y has 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(+) di

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

2019-02-21 Thread Steven Price
for all 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 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 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 a

[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 10/13] x86/mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct

2019-02-21 Thread Steven Price
ned-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 12/13] x86/mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-02-21 Thread Steven Price
user 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/x

[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 09/13] x86/mm: Point to struct seq_file from struct pg_state

2019-02-21 Thread Steven Price
: 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
at 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 --

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

2019-01-18 Thread Steven Price
prototype' prepended with 'static > inline' 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

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 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 +--- > arch/arm64/include/asm/cpuf

Re: Bad virt_to_phys since commit 54c7a8916a887f35

2019-05-23 Thread Steven Price
On 23/05/2019 10:54, Mike Rapoport wrote: > On Thu, May 23, 2019 at 10:31:38AM +0100, Will Deacon wrote: >> Hi Steven, >> >> On Thu, May 16, 2019 at 03:20:59PM +0100, Steven Price wrote: >>> I'll spin a real patch and add your Tested-by >> >> Did

[PATCH v3 0/2] drm/panfrost: drm_gem_map_offset() helper

2019-05-20 Thread Steven Price
anges since v1: * Rename drm_gem_dumb_map_offset to drop _dumb * Add a shmem helper Steven Price (2): drm/gem: Rename drm_gem_dumb_map_offset() to drm_gem_map_offset() drm/panfrost: Use drm_gem_shmem_map_offset() drivers/gpu/drm/drm_dumb_buffers.c | 4 ++-- drivers/gpu/drm/drm_gem.c |

[PATCH v3 2/2] drm/panfrost: Use drm_gem_shmem_map_offset()

2019-05-20 Thread Steven Price
. CC: Alyssa Rosenzweig Signed-off-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_drv.c | 16 ++-- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c

Re: [PATCH 2/6] arm64/mm: Enable memory hot remove

2019-04-04 Thread Steven Price
On 04/04/2019 08:07, Anshuman Khandual wrote: > > > On 04/03/2019 11:02 PM, Logan Gunthorpe wrote: >> >> >> On 2019-04-02 10:30 p.m., Anshuman Khandual wrote: >>> Memory removal from an arch perspective involves tearing down two different >>> kernel based mappings i.e vmemmap and linear while rel

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

2019-03-28 Thread Steven Price
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) Steven Price (20): arc: mm: Add p?d_large() definitions arm64: mm: Add p?d_large() definitions mips: mm

[PATCH v7 02/20] arm64: mm: Add p?d_large() definitions

2019-03-28 Thread Steven Price
cros which 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..6eef345db

[PATCH v7 03/20] mips: mm: Add p?d_large() definitions

2019-03-28 Thread Steven Price
C: linux-m...@vger.kernel.org Signed-off-by: Steven Price Acked-by: Paul Burton --- 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/i

[PATCH v7 06/20] riscv: mm: Add p?d_large() definitions

2019-03-28 Thread Steven Price
, write 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/i

[PATCH v7 07/20] s390: mm: Add p?d_large() definitions

2019-03-28 Thread Steven Price
re already 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 change

[PATCH v7 09/20] x86: mm: Add p?d_large() definitions

2019-03-28 Thread Steven Price
ctions, so simply add #defines to prevent the generic versions (added in a later patch) from being picked up. We also need to add corresponding #undefs in dump_pagetables.c. This code will be removed when x86 is switched over to using the generic pagewalk code in a later patch. Signed-off-by: St

[PATCH v7 10/20] mm: Add generic p?d_large() macros

2019-03-28 Thread Steven Price
g defaults. 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 fa782fba51ee..9c5d0f73db67 100644 --- a/include/asm-generic/pgtable.h +++ b/i

[PATCH v7 15/20] x86: mm: Don't display pages which aren't present in debugfs

2019-03-28 Thread Steven Price
#x27;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 ca270fb00805..e2b53db92c34 100644 --

[PATCH v7 14/20] arm64: mm: Convert mm/dump.c to use walk_page_range()

2019-03-28 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 | 117 ++- 1 file changed, 59 insertions(+), 58 deletions(-) diff --git a

[PATCH v7 11/20] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-03-28 Thread Steven Price
for all entries, not just transparent huge pages. Signed-off-by: Steven Price --- include/linux/mm.h | 15 +-- mm/pagewalk.c | 27 --- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 76769749

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

2019-03-28 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 v7 18/20] x86: mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct

2019-03-28 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 v7 17/20] x86: mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct

2019-03-28 Thread Steven Price
ned-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 v7 16/20] x86: mm: Point to struct seq_file from struct pg_state

2019-03-28 Thread Steven Price
: 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 e2b53db92c34..3d12ac031144 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch

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

2019-03-28 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 | 280 ++ 1 file changed, 146 insertions(+), 134 deletions(-) diff --git a/arch/x86/mm/dump_pagetables.c b/arch/x86/mm/dump_pagetables.c index

[PATCH v7 19/20] x86: mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-03-28 Thread Steven Price
user 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/x

[PATCH v7 12/20] mm: pagewalk: Allow walking without vma

2019-03-28 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 v7 08/20] sparc: mm: Add p?d_large() definitions

2019-03-28 Thread Steven Price
re already provided, so add #defines to prevent the generic versions (added in a later patch) from being used. CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Steven Price Acked-by: David S. Miller --- arch/sparc/include/asm/pgtable_64.h | 2 ++ 1 file changed, 2

Re: [PATCH 2/3] pagewalk: seperate function pointers from iterator data

2019-08-09 Thread Steven Price
ntry(), and/or hugetlb_entry(). If you don't set up for some of these Missing context: > * > * Before starting to walk page table, some callers want to check whether > * they really want to walk over the current vma, typically by checking > * its vm_flags. walk_page_test() and @walk->test_walk() are used for this > * purpose. @walk->test_walk() should now be @ops->test_walk() > @@ -283,42 +293,48 @@ static int __walk_page_range(unsigned long start, > unsigned long end, > * > * struct mm_walk keeps current values of some common data like vma and pmd, > * which are useful for the access from callbacks. If you want to pass some > - * caller-specific data to callbacks, @walk->private should be helpful. > + * caller-specific data to callbacks, @private should be helpful. > * > * Locking: > * Callers of walk_page_range() and walk_page_vma() should hold > * @walk->mm->mmap_sem, because these function traverse vma list and/or s/walk->// Otherwise looks good - I've rebased my series on it and the initial testing is fine. So for the series: Reviewed-by: Steven Price Thanks, Steve

Re: [PATCH v9 00/21] Generic page walk and ptdump

2019-07-31 Thread Steven Price
On 31/07/2019 10:27, Sven Schnelle wrote: > Hi Steven, > > On Mon, Jul 29, 2019 at 12:32:25PM +0100, Steven Price wrote: >> >> parisc is more interesting and I'm not sure if this is necessarily >> correct. I originally proposed a patch with the line "For pa

[PATCH v10 00/22] Generic page walk and ptdump

2019-07-31 Thread Steven Price
ped patches migrating arm64/x86 custom walkers to walk_page_range() in favour of adding a generic PTDUMP implementation and migrating arm64/x86 to that instead. * Rebased to v5.3-rc1 Steven Price (22): mm: Add generic p?d_leaf() macros arc: mm: Add p?d_leaf() definitions arm: mm: Add

[PATCH v10 01/22] mm: Add generic p?d_leaf() macros

2019-07-31 Thread Steven Price
mean that the entry is a leaf (for example it may be a set of contiguous entries that only take 1 TLB slot). For the purpose of walking the page tables we don't need to know how it will be represented in the TLB, but we do need to know for sure if it is a leaf of the tree. Signed-off-by: S

[PATCH v10 03/22] arm: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
at we want. So simply provide the generic pmd_leaf() name. CC: Russell King CC: linux-arm-ker...@lists.infradead.org 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/i

[PATCH v10 02/22] arc: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
y pmd_leaf() 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 1d87c18a2976..8c425cf796db 100644

[PATCH v10 09/22] sparc: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
re already provided, so add macros to provide the p?d_leaf names required by the generic code. CC: "David S. Miller" CC: sparcli...@vger.kernel.org Signed-off-by: Steven Price --- arch/sparc/include/asm/pgtable_64.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sparc/incl

[PATCH v10 08/22] s390: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
re already implemented as static inline functions. Add a macro to provide the p?d_leaf names for the generic code to use. CC: Heiko Carstens CC: Vasily Gorbik CC: Christian Borntraeger CC: linux-s...@vger.kernel.org Signed-off-by: Steven Price --- arch/s390/include/asm/pgtable.h | 2 ++ 1 file

[PATCH v10 04/22] arm64: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
these page walking macros is implicitly relying on the page size/number of levels being the same as the kernel. So it is safe to reuse this for p?d_leaf() as it is an architectural restriction. CC: Catalin Marinas CC: Will Deacon Signed-off-by: Steven Price --- arch/arm64/include/asm/pgtabl

[PATCH v10 07/22] riscv: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
ead, write 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/i

[PATCH v10 16/22] x86: mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct

2019-07-31 Thread Steven Price
ned-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 v10 17/22] x86: mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct

2019-07-31 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 v10 12/22] mm: pagewalk: Allow walking without vma

2019-07-31 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..1cbef99e9258 10064

[PATCH v10 10/22] x86: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
so simply add macros to provide the generic p?d_leaf() names for the generic code. Signed-off-by: Steven Price --- arch/x86/include/asm/pgtable.h | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 0bc530c4eb13..6986a4516

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

2019-07-31 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 v10 06/22] powerpc: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
ned-off-by: Steven Price --- arch/powerpc/include/asm/book3s/64/pgtable.h | 30 ++-- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 8308f32e9782..84270666355c 100644

[PATCH v10 05/22] mips: mm: Add p?d_leaf() definitions

2019-07-31 Thread Steven Price
r it. When not defined we can be confident that there are no leaf pages in existence and fall back on the generic implementation (added in a later patch) which returns 0. CC: Ralf Baechle CC: Paul Burton CC: James Hogan CC: linux-m...@vger.kernel.org Signed-off-by: Steven Price --- arch/mips/i

[PATCH v10 18/22] x86: mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-07-31 Thread Steven Price
user 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/x

[PATCH v10 20/22] x86: mm: Convert dump_pagetables to use walk_page_range

2019-07-31 Thread Steven Price
callbacks which can decide to skip an entire tree of entries Signed-off-by: Steven Price --- arch/x86/Kconfig | 1 + arch/x86/Kconfig.debug| 20 +-- arch/x86/mm/Makefile | 4 +- arch/x86/mm/dump_pagetables.c | 285 +++--- 4 files changed, 64

[PATCH v10 19/22] mm: Add generic ptdump

2019-07-31 Thread Steven Price
Add a generic version of page table dumping that architectures can opt-in to Signed-off-by: Steven Price --- include/linux/ptdump.h | 19 ++ mm/Kconfig.debug | 21 ++ mm/Makefile| 1 + mm/ptdump.c| 151 + 4 files

[PATCH v10 22/22] arm64: mm: Display non-present entries in ptdump

2019-07-31 Thread Steven Price
. 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

[PATCH v10 11/22] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-07-31 Thread Steven Price
for all entries, not just transparent huge pages. Signed-off-by: Steven Price --- include/linux/mm.h | 18 -- mm/pagewalk.c | 27 --- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 0334ca97

[PATCH v10 15/22] x86: mm: Point to struct seq_file from struct pg_state

2019-07-31 Thread Steven Price
: 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 ab67822fd2f4..4dc6f4df40af 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch

[PATCH v10 14/22] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-07-31 Thread Steven Price
at 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 --

[PATCH v10 21/22] arm64: mm: Convert mm/dump.c to use walk_page_range()

2019-07-31 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/Kconfig | 1 + arch/arm64/Kconfig.debug | 19 + arch/arm64/include/asm/ptdump.h| 8

Re: [PATCH v9 10/21] mm: Add generic p?d_leaf() macros

2019-08-01 Thread Steven Price
On 01/08/2019 07:09, Anshuman Khandual wrote: > > > On 07/29/2019 05:08 PM, Steven Price wrote: >> On 28/07/2019 12:44, Anshuman Khandual wrote: >>> >>> >>> On 07/23/2019 03:11 PM, Mark Rutland wrote: >>>> On Mon, Jul 22, 2019 at 04:41:59PM

Re: [PATCH v9 00/21] Generic page walk and ptdump

2019-07-25 Thread Steven Price
On 25/07/2019 10:09, Anshuman Khandual wrote: > > > On 07/24/2019 07:05 PM, Steven Price wrote: >> On 23/07/2019 07:39, Anshuman Khandual wrote: >>> Hello Steven, >>> >>> On 07/22/2019 09:11 PM, Steven Price wrote: >>>> This is a s

[PATCH 2/9] KVM: arm/arm64: Factor out hypercall handling from PSCI code

2019-08-02 Thread Steven Price
functionality into a separate hypercall handler file. Signed-off-by: Christoffer Dall [steven.pr...@arm.com: rebased] Signed-off-by: Steven Price --- arch/arm/kvm/Makefile| 2 +- arch/arm/kvm/handle_exit.c | 2 +- arch/arm64/kvm/Makefile | 1 + arch/arm64/kvm/handle_exit.c | 4

[PATCH 4/9] KVM: arm64: Support stolen time reporting via shared structure

2019-08-02 Thread Steven Price
_info structure maintained by the Linux scheduler code. We enable SCHEDSTATS when selecting KVM Kconfig to ensure this value is meaningful. Signed-off-by: Steven Price --- arch/arm64/include/asm/kvm_host.h | 13 +- arch/arm64/kvm/Kconfig| 1 + include/kvm/arm_hypercalls.h

[PATCH 8/9] arm/arm64: Make use of the SMCCC 1.1 wrapper

2019-08-02 Thread Steven Price
Rather than directly choosing which function to use based on psci_ops.conduit, use the new arm_smccc_1_1 wrapper instead. In some cases we still need to do some operations based on the conduit, but the code duplication is removed. No functional change. Signed-off-by: Steven Price --- arch/arm

[PATCH 3/9] KVM: arm64: Implement PV_FEATURES call

2019-08-02 Thread Steven Price
This provides a mechanism for querying which paravirtualized features are available in this hypervisor. Also add the header file which defines the ABI for the paravirtualized clock features we're about to add. Signed-off-by: Steven Price --- arch/arm64/include/asm/pvclock-abi.h

[PATCH 9/9] arm64: Retrieve stolen time as paravirtualized guest

2019-08-02 Thread Steven Price
reads the stolen value from the shared page for a VCPU. We guarantee single-copy atomicity using READ_ONCE which means we can also read the stolen time for another VCPU than the currently running one while it is potentially being updated by the hypervisor. Signed-off-by: Steven Price --- arch

[PATCH 7/9] arm/arm64: Provide a wrapper for SMCCC 1.1 calls

2019-08-02 Thread Steven Price
the conduit used for the call. This allow us to remove some duplicated code and will be useful later when adding paravirtualized time hypervisor calls. Signed-off-by: Steven Price --- include/linux/arm-smccc.h | 44 +++ 1 file changed, 44 insertions(+) diff

[PATCH 6/9] KVM: arm64: Provide a PV_TIME device to user space

2019-08-02 Thread Steven Price
memory available at this location. The address is given in terms of the physical address visible to the guest and must be 64 byte aligned. The memory should be marked as reserved to the guest to stop it allocating it for other purposes. Signed-off-by: Steven Price --- arch/arm64/include/asm

Re: [PATCH 0/9] arm64: Stolen time support

2019-08-05 Thread Steven Price
On 03/08/2019 19:05, Marc Zyngier wrote: > On Fri, 2 Aug 2019 15:50:08 +0100 > Steven Price wrote: > > Hi Steven, > >> This series add support for paravirtualized time for arm64 guests and >> KVM hosts following the specification in Arm's document DEN 0057A:

Re: [PATCH 3/9] KVM: arm64: Implement PV_FEATURES call

2019-08-05 Thread Steven Price
On 03/08/2019 12:21, Marc Zyngier wrote: > On Fri, 2 Aug 2019 15:50:11 +0100 > Steven Price wrote: > >> This provides a mechanism for querying which paravirtualized features >> are available in this hypervisor. >> >> Also add the header file which define

Re: [PATCH 1/9] KVM: arm64: Document PV-time interface

2019-08-05 Thread Steven Price
On 03/08/2019 12:13, Marc Zyngier wrote: > On Fri, 2 Aug 2019 15:50:09 +0100 > Steven Price wrote: > > [+Peter for the userspace aspect of things] > > Hi Steve, > >> Introduce a paravirtualization interface for KVM/arm64 based on the >> "Arm Par

Re: [PATCH 4.19] Revert "initramfs: free initrd memory if opening /initrd.image fails"

2019-08-07 Thread Steven Price
On 06/08/2019 22:36, Stephen Boyd wrote: > Quoting Sasha Levin (2019-08-06 13:47:52) >> On Tue, Aug 06, 2019 at 10:59:40AM -0700, Stephen Boyd wrote: >>> This reverts commit 25511676362d8f7d4b8805730a3d29484ceab1ec in the 4.19 >>> stable trees. From what I can tell this commit doesn't do anything t

Re: [PATCH v10 20/22] x86: mm: Convert dump_pagetables to use walk_page_range

2019-08-07 Thread Steven Price
On 07/08/2019 00:58, Andrew Morton wrote: > On Wed, 31 Jul 2019 16:46:01 +0100 Steven Price wrote: > >> Make use of the new functionality in walk_page_range to remove the >> arch page walking code and use the generic code to walk the page tables. >> >> The effecti

Re: [PATCH 1/9] KVM: arm64: Document PV-time interface

2019-08-07 Thread Steven Price
On 05/08/2019 17:40, Christophe de Dinechin wrote: > > Steven Price writes: > >> Introduce a paravirtualization interface for KVM/arm64 based on the >> "Arm Paravirtualized Time for Arm-Base Systems" specification DEN 0057A. >> >> This only adds the de

Re: [PATCH 6/9] KVM: arm64: Provide a PV_TIME device to user space

2019-08-07 Thread Steven Price
On 03/08/2019 18:34, Marc Zyngier wrote: > On Sat, 3 Aug 2019 13:51:13 +0100 > Marc Zyngier wrote: > > [forgot that one] > >> On Fri, 2 Aug 2019 15:50:14 +0100 >> Steven Price wrote: > > [...] > >>> +static int __init kvm_pvtime_init(void) >&

Re: [PATCH 1/9] KVM: arm64: Document PV-time interface

2019-08-07 Thread Steven Price
On 07/08/2019 15:28, Christophe de Dinechin wrote: > > >> On 7 Aug 2019, at 15:21, Steven Price > <mailto:steven.pr...@arm.com>> wrote: >> >> On 05/08/2019 17:40, Christophe de Dinechin wrote: >>> >>> Steven Price writes: >>> >&

Re: [PATCH v9 04/21] mips: mm: Add p?d_leaf() definitions

2019-07-24 Thread Steven Price
On 22/07/2019 22:47, Paul Burton wrote: > Hi Steven, > > On Mon, Jul 22, 2019 at 04:41:53PM +0100, 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 >&g

<    1   2   3   4   5   6   7   >