[PATCH] powerpc/nvdimm: Add support for multibyte read/write for metadata

2019-06-01 Thread Aneesh Kumar K.V
SCM_READ/WRITE_MEATADATA hcall supports multibyte read/write. This patch updates the metadata read/write to use 1, 2, 4 or 8 byte read/write as mentioned in PAPR document. READ/WRITE_METADATA hcall supports the 1, 2, 4, or 8 bytes read/write. For other values hcall results H_P3. Hypervisor stores

Re: RFC: switch the remaining architectures to use generic GUP v2

2019-06-01 Thread David Miller
From: Christoph Hellwig Date: Sat, 1 Jun 2019 09:49:43 +0200 > below is a series to switch mips, sh and sparc64 to use the generic > GUP code so that we only have one codebase to touch for further > improvements to this code. I don't have hardware for any of these > architectures, and generally

Re: [PATCH 00/12] Secure Virtual Machine Enablement

2019-06-01 Thread Thiago Jung Bauermann
Hello, Thiago Jung Bauermann writes: > This series enables Secure Virtual Machines (SVMs) on powerpc. SVMs use the > Protected Execution Facility (PEF) and request to be migrated to secure > memory during prom_init() so by default all of their memory is inaccessible > to the hypervisor. There

Re: [PATCH 08/16] sparc64: add the missing pgd_page definition

2019-06-01 Thread Linus Torvalds
Both sparc64 and sh had this pattern, but now that I look at it more closely, I think your version is wrong, or at least nonoptimal. On Sat, Jun 1, 2019 at 12:50 AM Christoph Hellwig wrote: > > +#define pgd_page(pgd) virt_to_page(__va(pgd_val(pgd))) Going through the virtual add

Re: [PATCH 03/16] mm: simplify gup_fast_permitted

2019-06-01 Thread Linus Torvalds
On Sat, Jun 1, 2019 at 12:50 AM Christoph Hellwig wrote: > > Pass in the already calculated end value instead of recomputing it, and > leave the end > start check in the callers instead of duplicating them > in the arch code. Good cleanup, except it's wrong. > - if (nr_pages <= 0) > +

[PATCH AUTOSEL 4.4 39/56] PCI: rpadlpar: Fix leaked device_node references in add/remove paths

2019-06-01 Thread Sasha Levin
From: Tyrel Datwyler [ Upstream commit fb26228bfc4ce3951544848555c0278e2832e618 ] The find_dlpar_node() helper returns a device node with its reference incremented. Both the add and remove paths use this helper for find the appropriate node, but fail to release the reference when done. Annotat

[PATCH AUTOSEL 4.14 23/99] EDAC/mpc85xx: Prevent building as a module

2019-06-01 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit 2b8358a951b1e2a534a54924cd8245e58a1c5fb8 ] The mpc85xx EDAC driver can be configured as a module but then fails to build because it uses two unexported symbols: ERROR: ".pci_find_hose_for_OF_device" [drivers/edac/mpc85xx_edac_mod.ko] undefined! ERRO

[PATCH AUTOSEL 4.19 029/141] EDAC/mpc85xx: Prevent building as a module

2019-06-01 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit 2b8358a951b1e2a534a54924cd8245e58a1c5fb8 ] The mpc85xx EDAC driver can be configured as a module but then fails to build because it uses two unexported symbols: ERROR: ".pci_find_hose_for_OF_device" [drivers/edac/mpc85xx_edac_mod.ko] undefined! ERRO

[PATCH AUTOSEL 5.0 035/173] EDAC/mpc85xx: Prevent building as a module

2019-06-01 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit 2b8358a951b1e2a534a54924cd8245e58a1c5fb8 ] The mpc85xx EDAC driver can be configured as a module but then fails to build because it uses two unexported symbols: ERROR: ".pci_find_hose_for_OF_device" [drivers/edac/mpc85xx_edac_mod.ko] undefined! ERRO

[PATCH AUTOSEL 5.1 038/186] EDAC/mpc85xx: Prevent building as a module

2019-06-01 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit 2b8358a951b1e2a534a54924cd8245e58a1c5fb8 ] The mpc85xx EDAC driver can be configured as a module but then fails to build because it uses two unexported symbols: ERROR: ".pci_find_hose_for_OF_device" [drivers/edac/mpc85xx_edac_mod.ko] undefined! ERRO

[PATCH 16/16] mm: mark the page referenced in gup_hugepte

2019-06-01 Thread Christoph Hellwig
All other get_user_page_fast cases mark the page referenced, so do this here as well. Signed-off-by: Christoph Hellwig --- mm/gup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/gup.c b/mm/gup.c index 6090044227f1..d1fc008de292 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -2020,6 +2020,7 @@

[PATCH 15/16] mm: switch gup_hugepte to use try_get_compound_head

2019-06-01 Thread Christoph Hellwig
This applies the overflow fixes from 8fde12ca79aff ("mm: prevent get_user_pages() from overflowing page refcount") to the powerpc hugepd code and brings it back in sync with the other GUP cases. Signed-off-by: Christoph Hellwig --- mm/gup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH 14/16] mm: move the powerpc hugepd code to mm/gup.c

2019-06-01 Thread Christoph Hellwig
While only powerpc supports the hugepd case, the code is pretty generic and I'd like to keep all GUP internals in one place. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 1 + arch/powerpc/mm/hugetlbpage.c | 72 -- include/linux/hugetlb.h

[PATCH 13/16] mm: validate get_user_pages_fast flags

2019-06-01 Thread Christoph Hellwig
We can only deal with FOLL_WRITE and/or FOLL_LONGTERM in get_user_pages_fast, so reject all other flags. Signed-off-by: Christoph Hellwig --- mm/gup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/gup.c b/mm/gup.c index c8da7764de9c..53b50c63ba51 100644 --- a/mm/gup.c +++ b/mm/gup.c

[PATCH 12/16] mm: consolidate the get_user_pages* implementations

2019-06-01 Thread Christoph Hellwig
Always build mm/gup.c, and move the nommu versions and replace the separate stubs for various functions by the default ones, with the _fast version always falling back to the slow path because gup_fast_permitted always returns false now if HAVE_FAST_GUP is not set, and we use the nommu version of _

[PATCH 11/16] mm: rename CONFIG_HAVE_GENERIC_GUP to CONFIG_HAVE_FAST_GUP

2019-06-01 Thread Christoph Hellwig
We only support the generic GUP now, so rename the config option to be more clear, and always use the mm/Kconfig definition of the symbol and select it from the arch Kconfigs. Signed-off-by: Christoph Hellwig --- arch/arm/Kconfig | 5 + arch/arm64/Kconfig | 4 +--- arch/mips/Kconfig

[PATCH 10/16] sparc64: use the generic get_user_pages_fast code

2019-06-01 Thread Christoph Hellwig
The sparc64 code is mostly equivalent to the generic one, minus various bugfixes and two arch overrides that this patch adds to pgtable.h. Signed-off-by: Christoph Hellwig --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/pgtable_64.h | 18 ++ arch/sparc/mm/Makefile

[PATCH 09/16] sparc64: define untagged_addr()

2019-06-01 Thread Christoph Hellwig
Add a helper to untag a user pointer. This is needed for ADI support in get_user_pages_fast. Signed-off-by: Christoph Hellwig --- arch/sparc/include/asm/pgtable_64.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/inc

[PATCH 04/16] mm: lift the x86_32 PAE version of gup_get_pte to common code

2019-06-01 Thread Christoph Hellwig
The split low/high access is the only non-READ_ONCE version of gup_get_pte that did show up in the various arch implemenations. Lift it to common code and drop the ifdef based arch override. Signed-off-by: Christoph Hellwig --- arch/x86/Kconfig | 1 + arch/x86/include/asm/p

[PATCH 07/16] sh: use the generic get_user_pages_fast code

2019-06-01 Thread Christoph Hellwig
The sh code is mostly equivalent to the generic one, minus various bugfixes and two arch overrides that this patch adds to pgtable.h. Signed-off-by: Christoph Hellwig --- arch/sh/Kconfig | 2 + arch/sh/include/asm/pgtable.h | 37 + arch/sh/mm/Makefile | 2 +- arc

[PATCH 08/16] sparc64: add the missing pgd_page definition

2019-06-01 Thread Christoph Hellwig
sparc64 only had pgd_page_vaddr, but not pgd_page. Signed-off-by: Christoph Hellwig --- arch/sparc/include/asm/pgtable_64.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 22500c3be7a9..dcf970e82262 100644 --- a

[PATCH 05/16] MIPS: use the generic get_user_pages_fast code

2019-06-01 Thread Christoph Hellwig
The mips code is mostly equivalent to the generic one, minus various bugfixes and an arch override for gup_fast_permitted. Note that this defines ARCH_HAS_PTE_SPECIAL for mips as mips has pte_special and pte_mkspecial implemented and used in the existing gup code. They are no-op stubs, though whi

[PATCH 03/16] mm: simplify gup_fast_permitted

2019-06-01 Thread Christoph Hellwig
Pass in the already calculated end value instead of recomputing it, and leave the end > start check in the callers instead of duplicating them in the arch code. Signed-off-by: Christoph Hellwig --- arch/s390/include/asm/pgtable.h | 8 +--- arch/x86/include/asm/pgtable_64.h | 8 +---

[PATCH 06/16] sh: add the missing pud_page definition

2019-06-01 Thread Christoph Hellwig
sh only had pud_page_vaddr, but not pud_page. Signed-off-by: Christoph Hellwig --- arch/sh/include/asm/pgtable-3level.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/sh/include/asm/pgtable-3level.h b/arch/sh/include/asm/pgtable-3level.h index 7d8587eb65ff..8ff6fb6b4d19 100644 --- a/a

RFC: switch the remaining architectures to use generic GUP v2

2019-06-01 Thread Christoph Hellwig
Hi Linus and maintainers, below is a series to switch mips, sh and sparc64 to use the generic GUP code so that we only have one codebase to touch for further improvements to this code. I don't have hardware for any of these architectures, and generally no clue about their page table management, s

[PATCH 01/16] uaccess: add untagged_addr definition for other arches

2019-06-01 Thread Christoph Hellwig
From: Andrey Konovalov To allow arm64 syscalls to accept tagged pointers from userspace, we must untag them when they are passed to the kernel. Since untagging is done in generic parts of the kernel, the untagged_addr macro needs to be defined for all architectures. Define it as a noop for archi

[PATCH 02/16] mm: use untagged_addr() for get_user_pages_fast addresses

2019-06-01 Thread Christoph Hellwig
This will allow sparc64 to override its ADI tags for get_user_pages and get_user_pages_fast. Signed-off-by: Christoph Hellwig --- mm/gup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index f173fcbaf1b2..9775f7675653 100644 --- a/mm/gup.c +++ b/mm/g