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

2019-08-19 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 v2 5/9] KVM: Allow kvm_device_ops to be const

2019-08-19 Thread Steven Price
Currently a kvm_device_ops structure cannot be const without triggering compiler warnings. However the structure doesn't need to be written to and, by marking it const, it can be read-only in memory. Add some more const keywords to allow this. Signed-off-by: Steven Price --- include/linux

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

2019-08-09 Thread Steven Price
te_entry(), 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 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: >>> &g

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

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

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

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

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

[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 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 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 | 20

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

2019-08-02 Thread Steven Price
this 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
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 | 1

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

[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

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

2019-07-31 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 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
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 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
ll 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 0334ca97c584.

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

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

2019-07-31 Thread Steven Price
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/include/asm

[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
-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 --- a/arch

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

2019-07-31 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 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
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..6986a451619e 100644

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

2019-07-31 Thread Steven Price
ing 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/pgtable.h | 2 ++ 1 f

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

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

2019-07-31 Thread Steven Price
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/include/asm/pg

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

2019-07-31 Thread Steven Price
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 changed, 2

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

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

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

2019-07-31 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 1d87c18a2976..8c425cf796db 100644 --- a/arch

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

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

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

2019-07-31 Thread Steven Price
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 p?d_leaf() definitions arm64: mm

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 parisc,

Re: [PATCH v9 19/21] mm: Add generic ptdump

2019-07-29 Thread Steven Price
On 29/07/2019 03:59, Anshuman Khandual wrote: > > On 07/22/2019 09:12 PM, Steven Price wrote: >> Add a generic version of page table dumping that architectures can >> opt-in to >> >> Signed-off-by: Steven Price >> --- >> include/linux/ptdump.h |

Re: [PATCH v9 13/21] mm: pagewalk: Add test_p?d callbacks

2019-07-29 Thread Steven Price
On 28/07/2019 14:41, Anshuman Khandual wrote: > > > On 07/22/2019 09:12 PM, Steven Price wrote: >> 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 b

Re: [PATCH v9 12/21] mm: pagewalk: Allow walking without vma

2019-07-29 Thread Steven Price
On 28/07/2019 15:20, Anshuman Khandual wrote: > > > On 07/22/2019 09:12 PM, Steven Price wrote: >> Since 48684a65b4e3: "mm: pagewalk: fix misbehavior of walk_page_range >> for vma(VM_PFNMAP)", page_table_walk() will report any kernel area as >> a hole, bec

Re: [PATCH v9 11/21] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-07-29 Thread Steven Price
On 28/07/2019 13:33, Anshuman Khandual wrote: > > > On 07/22/2019 09:12 PM, Steven Price wrote: >> pgd_entry() and pud_entry() were removed by commit 0b1fbfe50006c410 >> ("mm/pagewalk: remove pgd_entry() and pud_entry()") because there were >> no users. We

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

2019-07-29 Thread Steven Price
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 +0100, Steven Price wrote: >>> Exposing the pud/pgd levels of the page tables to walk_page_range() means >>> we may come

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

2019-07-29 Thread Steven Price
On 28/07/2019 12:20, Anshuman Khandual wrote: > On 07/22/2019 09:11 PM, Steven Price wrote: >> Steven Price (21): >> arc: mm: Add p?d_leaf() definitions >> arm: mm: Add p?d_leaf() definitions >> arm64: mm: Add p?d_leaf() definitions >> mips: mm: Add p?d_le

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

Re: [PATCH v9 19/21] mm: Add generic ptdump

2019-07-24 Thread Steven Price
On 23/07/2019 10:57, Mark Rutland wrote: > On Mon, Jul 22, 2019 at 04:42:08PM +0100, Steven Price wrote: >> Add a generic version of page table dumping that architectures can >> opt-in to >> >> Signed-off-by: Steven Price > > [...] > >> +#ifdef CONFIG_K

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

2019-07-24 Thread Steven Price
On 24/07/2019 14:57, Thomas Gleixner wrote: > On Wed, 24 Jul 2019, Steven Price wrote: >> On 23/07/2019 11:16, Mark Rutland wrote: >>> Are there any visible changes to the arm64 output? >> >> arm64 output shouldn't change. I've confirmed that "efi_page_table

Re: [PATCH v9 11/21] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-07-24 Thread Steven Price
On 23/07/2019 11:14, Mark Rutland wrote: > On Mon, Jul 22, 2019 at 04:42:00PM +0100, Steven Price wrote: >> pgd_entry() and pud_entry() were removed by commit 0b1fbfe50006c410 >> ("mm/pagewalk: remove pgd_entry() and pud_entry()") because there were >> no use

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

2019-07-24 Thread Steven Price
On 23/07/2019 10:41, Mark Rutland wrote: > On Mon, Jul 22, 2019 at 04:41:59PM +0100, Steven Price wrote: >> Exposing the pud/pgd levels of the page tables to walk_page_range() means >> we may come across the exotic large mappings that come with large areas >>

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

2019-07-24 Thread Steven Price
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 numberi

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

2019-07-24 Thread Steven Price
On 23/07/2019 07:39, Anshuman Khandual wrote: > Hello Steven, > > On 07/22/2019 09:11 PM, 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 n

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

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

2019-07-22 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

[PATCH v9 17/21] x86: mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct

2019-07-22 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 v9 19/21] mm: Add generic ptdump

2019-07-22 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| 161 + 4 files

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

2019-07-22 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 v9 18/21] x86: mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-07-22 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 v9 20/21] x86: mm: Convert dump_pagetables to use walk_page_range

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

2019-07-22 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 v9 08/21] sparc: mm: Add p?d_leaf() definitions

2019-07-22 Thread Steven Price
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/include/asm/pg

[PATCH v9 11/21] mm: pagewalk: Add p4d_entry() and pgd_entry()

2019-07-22 Thread Steven Price
ll 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 0334ca97c584.

[PATCH v9 14/21] x86: mm: Don't display pages which aren't present in debugfs

2019-07-22 Thread Steven Price
' 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 ab67822fd2f4..95728027dd3b 100644 --- a/arch/x86/mm

[PATCH v9 07/21] s390: mm: Add p?d_leaf() definitions

2019-07-22 Thread Steven Price
implemented as static inline functions. Add a macro to provide the p?d_leaf names for the generic code to use. 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(+) diff --git

[PATCH v9 15/21] x86: mm: Point to struct seq_file from struct pg_state

2019-07-22 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 95728027dd3b..fe21b57f629f 100644 --- a/arch/x86/mm/dump_pagetables.c +++ b/arch

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

2019-07-22 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 v9 10/21] mm: Add generic p?d_leaf() macros

2019-07-22 Thread Steven Price
that are suitable where there cannot be leaf pages that that level. 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 75d9d68a6de7..46275896ca66

[PATCH v9 09/21] x86: mm: Add p?d_leaf() definitions

2019-07-22 Thread Steven Price
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..6986a451619e 100644

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

2019-07-22 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..2bdbf8652b5f 100644 --- a/arch/mips/include/asm/pgtable-64.h +++ b/arch

[PATCH v9 01/21] arc: mm: Add p?d_leaf() definitions

2019-07-22 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 1d87c18a2976..8c425cf796db 100644 --- a/arch

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

2019-07-22 Thread Steven Price
ting arm64/x86 to that instead. * Rebased to v5.3-rc1 Steven Price (21): arc: mm: Add p?d_leaf() definitions arm: mm: Add p?d_leaf() definitions arm64: mm: Add p?d_leaf() definitions mips: mm: Add p?d_leaf() definitions powerpc: mm: Add p?d_leaf() definitions riscv: mm: Add p?d_leaf() definiti

[PATCH v9 05/21] powerpc: mm: Add p?d_leaf() definitions

2019-07-22 Thread Steven Price
-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 --- a/arch

[PATCH v9 06/21] riscv: mm: Add p?d_leaf() definitions

2019-07-22 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 v9 03/21] arm64: mm: Add p?d_leaf() definitions

2019-07-22 Thread Steven Price
ing 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/pgtable.h | 2 ++ 1 f

[PATCH v9 02/21] arm: mm: Add p?d_leaf() definitions

2019-07-22 Thread Steven Price
. 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/include/asm

Re: [PATCH] rqchip/stm32: Remove unneeded call to kfree

2019-07-22 Thread Steven Price
On 19/07/2019 19:46, Hariprasad Kelam wrote: > Memory allocated by devm_ alloc will be freed upon device detachment. So > we may not require free memory. > > Signed-off-by: Hariprasad Kelam > --- > drivers/irqchip/irq-stm32-exti.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git

Re: [PATCH 5/6] firmware: arm_scmi: Use the term 'message' instead of 'command'

2019-07-08 Thread Steven Price
On 08/07/2019 16:43, Sudeep Holla wrote: > In preparation to adding support for other two types of messages that > SCMI specification mentions, let's replace the term 'command' with the > correct term 'message'. > > As per the specification the messages are of 3 types: > commands(synchronous or

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 you

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

2019-05-20 Thread Steven Price
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 | 6 +++--- drivers/gpu/drm

[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

[PATCH] initramfs: Don't free a non-existent initrd

2019-05-16 Thread Steven Price
rt_to_phys() with a NULL address. Instead we should check that the initrd actually exists and only attempt to free it if it does. Fixes: 54c7a8916a88 ("initramfs: free initrd memory if opening /initrd.image fails") Reported-by: Mark Rutland Tested-by: Mark Rutland Signed-off-by: Ste

[PATCH v2 3/3] drm/panfrost: Use drm_gem_shmem_map_offset()

2019-05-16 Thread Steven Price
. CC: Alyssa Rosenzweig Signed-off-by: Steven Price --- 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 index 94b0819ad50b..a261b59208d0

[PATCH v2 2/3] drm: shmem: Add drm_gem_shmem_map_offset() wrapper

2019-05-16 Thread Steven Price
Provide a wrapper for drm_gem_map_offset() for clients of shmem. This wrapper provides the correct semantics for the drm_gem_shmem_mmap() callback. Signed-off-by: Steven Price --- drivers/gpu/drm/drm_gem_shmem_helper.c | 20 include/drm/drm_gem_shmem_helper.h | 2 ++ 2

Re: Bad virt_to_phys since commit 54c7a8916a887f35

2019-05-16 Thread Steven Price
On 16/05/2019 15:16, Mark Rutland wrote: > On Thu, May 16, 2019 at 03:05:31PM +0100, Steven Price wrote: >> On 16/05/2019 14:41, Mark Rutland wrote: >>> On Thu, May 16, 2019 at 02:38:20PM +0100, Mark Rutland wrote: >>>> Hi, >>>> >>>> Since

Re: Bad virt_to_phys since commit 54c7a8916a887f35

2019-05-16 Thread Steven Price
On 16/05/2019 14:41, Mark Rutland wrote: > On Thu, May 16, 2019 at 02:38:20PM +0100, Mark Rutland wrote: >> Hi, >> >> Since commit: >> >> 54c7a8916a887f35 ("initramfs: free initrd memory if opening /initrd.image >> fails") > > Ugh, I dropped a paragarph here. > > Since that commit, I'm seeing

[PATCH -next] drm/panfrost: depend on !GENERIC_ATOMIC64 when using COMPILE_TEST

2019-04-17 Thread Steven Price
[=y] Reported-by: kbuild test robot Signed-off-by: Steven Price --- drivers/gpu/drm/panfrost/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/Kconfig b/drivers/gpu/drm/panfrost/Kconfig index 7f5e572daa2d..591611dc4e34 100644 --- a/drivers/gpu/drm

[RFC PATCH 3/3] x86: mm: Switch to using generic pt_dump

2019-04-17 Thread Steven Price
Instead of providing our own callbacks for walking the page tables, switch to using the generic version instead. 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

[RFC PATCH 2/3] arm64: mm: Switch to using generic pt_dump

2019-04-17 Thread Steven Price
Instead of providing our own callbacks for walking the page tables, switch to using the generic version instead. Signed-off-by: Steven Price --- arch/arm64/Kconfig | 1 + arch/arm64/Kconfig.debug| 19 +- arch/arm64/include/asm/ptdump.h | 8 +-- arch/arm64/mm

[RFC PATCH 1/3] mm: Add generic ptdump

2019-04-17 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| 159 + 4 files

Re: [PATCH v8 00/20] Convert x86 & arm64 to use generic page walk

2019-04-17 Thread Steven Price
On 12/04/2019 15:44, Dave Hansen wrote: > On 4/10/19 7:56 AM, Steven Price wrote: >> Gentle ping: who can take this? Is there anything blocking this series? > > First of all, I really appreciate that you tried this. Every open-coded > page walk has a set of common pitfa

Re: [PATCH v8 00/20] Convert x86 & arm64 to use generic page walk

2019-04-10 Thread Steven Price
Hi all, Gentle ping: who can take this? Is there anything blocking this series? Thanks, Steve On 03/04/2019 15:16, Steven Price wrote: > Most architectures current have a debugfs file for dumping the kernel > page tables. Currently each architecture has to implement custom >

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

[PATCH] PM / devfreq: return PTR_ERR not NULL in try_then_request_governor()

2019-04-03 Thread Steven Price
it. Fixes: 23c7b54ca1cd ("PM / devfreq: Fix devfreq_add_device() when drivers are built as modules.") Signed-off-by: Steven Price --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfr

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

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

2019-04-03 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 v8 19/20] x86: mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct

2019-04-03 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

<    1   2   3   4   5   6   7   >