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

2019-06-25 Thread Christoph Hellwig
On Tue, Jun 25, 2019 at 12:37:57PM -0700, Andrew Morton wrote: > On Tue, 25 Jun 2019 16:37:13 +0200 Christoph Hellwig wrote: > > > +static int gup_huge_pd(hugepd_t hugepd > > Naming nitlet: we have hugepd and we also have huge_pd. We have > hugepte and we also have huge_pte. It make things a

Re: Bisected regression in v5.1 on PowerBook G3 (Wallstreet)

2019-06-25 Thread Christophe Leroy
Hi Finn, On 06/26/2019 02:06 AM, Finn Thain wrote: Hi Christophe, I received a report of a regression between v5.0 and v5.1 which causes the current release to crash during boot with a machine check exception. Please see console log below. Stan (whom I've Cc'd) tells me that this happens on

Re: [PATCH v2 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-25 Thread Oliver O'Halloran
On Tue, Jun 25, 2019 at 10:27 PM Vaibhav Jain wrote: > > The new hcall named H_SCM_UNBIND_ALL has been introduce that can > unbind all the memory drc memory-blocks assigned to an lpar. This is a little muddy. For normal memory each block has a DRC so you can add/remove individual blocks by

Re: [PATCH v2 3/3] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails

2019-06-25 Thread Oliver O'Halloran
On Tue, Jun 25, 2019 at 10:27 PM Vaibhav Jain wrote: > > In some cases initial bind of scm memory for an lpar can fail if > previously it wasn't released using a scm-unbind hcall. This situation > can arise due to panic of the previous kernel or forced lpar > fadump. In such cases the

Re: [PATCH v2 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-25 Thread Oliver O'Halloran
On Tue, Jun 25, 2019 at 10:27 PM Vaibhav Jain wrote: > > Update the hvcalls.h to include op-codes for new hcalls introduce to > manage SCM memory. Also update existing hcall definitions to reflect > current papr specification for SCM. > > Signed-off-by: Vaibhav Jain > --- > Change-log: > > v2: >

[PATCH kernel v2] powerpc/pci/of: Parse unassigned resources

2019-06-25 Thread Alexey Kardashevskiy
The pseries platform uses the PCI_PROBE_DEVTREE method of PCI probing which reads "assigned-addresses" of every PCI device and initializes the device resources. However if the property is missing or zero sized, then there is no fallback of any kind and the PCI resources remain undiscovered, i.e.

Re: [PATCH 3/4] powerpc/powernv: remove unused NPU DMA code

2019-06-25 Thread Alexey Kardashevskiy
On 26/06/2019 00:52, Christoph Hellwig wrote: > None of these routines were ever used anywhere in the kernel tree > since they were added to the kernel. So none of my comments has been addressed. Nice. > > Signed-off-by: Christoph Hellwig > --- > arch/powerpc/include/asm/book3s/64/mmu.h

Re: [PATCH 0/5] Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-06-25 Thread Linus Torvalds
This is not a comment on the patch series itself, it is a comment on the emails. Your email is mis-configured and ends up all being marked as spam for me, because you go through the wrong smtp server (or maybe your smtp server itself is miconfigured) All your emails fail dmarc, because the

[PATCH 5/5] s390: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES

2019-06-25 Thread Hoan Tran OS
This patch removes CONFIG_NODES_SPAN_OTHER_NODES as it's enabled by default with NUMA. Signed-off-by: Hoan Tran --- arch/s390/Kconfig | 8 1 file changed, 8 deletions(-) diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 109243f..788a8e9 100644 --- a/arch/s390/Kconfig +++

[PATCH 4/5] sparc: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES

2019-06-25 Thread Hoan Tran OS
This patch removes CONFIG_NODES_SPAN_OTHER_NODES as it's enabled by default with NUMA. Signed-off-by: Hoan Tran --- arch/sparc/Kconfig | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 26ab6f5..13449ea 100644 --- a/arch/sparc/Kconfig +++

[PATCH 3/5] x86: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES

2019-06-25 Thread Hoan Tran OS
This patch removes CONFIG_NODES_SPAN_OTHER_NODES as it's enabled by default with NUMA. Signed-off-by: Hoan Tran --- arch/x86/Kconfig | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 2bbbd4d..fa9318c 100644 --- a/arch/x86/Kconfig +++

[PATCH 2/5] powerpc: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES

2019-06-25 Thread Hoan Tran OS
This patch removes CONFIG_NODES_SPAN_OTHER_NODES as it's enabled by default with NUMA. Signed-off-by: Hoan Tran --- arch/powerpc/Kconfig | 9 - 1 file changed, 9 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 8c1c636..bdde8bc 100644 ---

[PATCH 1/5] mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-06-25 Thread Hoan Tran OS
This patch enables CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA. As some NUMA nodes have memory ranges that span other nodes. Even though a pfn is valid and between a node's start and end pfns, it may not reside on that node. Signed-off-by: Hoan Tran --- mm/page_alloc.c | 2 +- 1 file

[PATCH 0/5] Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

2019-06-25 Thread Hoan Tran OS
This patch set enables CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA. The original patch [1] [1] arm64: Kconfig: Enable NODES_SPAN_OTHER_NODES config for NUMA https://www.spinics.net/lists/arm-kernel/msg737306.html Hoan Tran (5): mm: Enable CONFIG_NODES_SPAN_OTHER_NODES by default for NUMA

[PATCH RFC] generic ELF support for kexec

2019-06-25 Thread Sven Schnelle
Hi List, i recently started working on kexec for PA-RISC. While doing so, i figured that powerpc already has support for reading ELF images inside of the Kernel. My first attempt was to steal the source code and modify it for PA-RISC, but it turned out that i didn't had to change much. Only ARM

Re: [PATCH 3/5] x86: Kconfig: Remove CONFIG_NODES_SPAN_OTHER_NODES

2019-06-25 Thread Thomas Gleixner
Hoan, On Tue, 25 Jun 2019, Hoan Tran OS wrote: Please use 'x86/Kconfig: ' as prefix. > This patch removes CONFIG_NODES_SPAN_OTHER_NODES as it's > enabled by default with NUMA. Please do not use 'This patch' in changelogs. It's pointless because we already know that this is a patch. See also

[PATCH v3 16/16] powernv/fadump: update documentation about option to release opalcore

2019-06-25 Thread Hari Bathini
With /proc/opalcore support available on OPAL based machines and an option to release memory used by kernel in exporting /proc/opalcore, update FADump documentation with these details. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.txt | 19 +++ 1

[PATCH v3 15/16] powernv/fadump: consider f/w load area

2019-06-25 Thread Hari Bathini
OPAL loads kernel & initrd at 512MB offset (256MB size), also exported as ibm,opal/dump/fw-load-area. So, if boot memory size of FADump is less than 768MB, kernel memory to be exported as '/proc/vmcore' would be overwritten by f/w while loading kernel & initrd. To avoid such a scenario, enforce a

[PATCH v3 14/16] powernv/opalcore: provide an option to invalidate /sys/firmware/opal/core file

2019-06-25 Thread Hari Bathini
Writing '1' to /sys/kernel/fadump_release_opalcore would release the memory held by kernel in exporting /sys/firmware/opal/core file. Signed-off-by: Hari Bathini --- arch/powerpc/platforms/powernv/opal-core.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-)

[PATCH v3 13/16] powernv/fadump: Skip processing /proc/vmcore when only OPAL core exists

2019-06-25 Thread Hari Bathini
If OPAL crashes when the kernel is not registered for FADump, F/W still provides info to export OPAL core. Make sure '/proc/vmcore' processing is skipped as only data relevant to OPAL core is exported in such scenario. Signed-off-by: Hari Bathini --- arch/powerpc/platforms/powernv/opal-fadump.c

[PATCH v3 12/16] powerpc/powernv: export /sys/firmware/opal/core for analysing opal crashes

2019-06-25 Thread Hari Bathini
From: Hari Bathini Export /sys/firmware/opal/core file to analyze opal crashes. Since OPAL core can be generated independent of CONFIG_FA_DUMP support in kernel, add this support under a new kernel config option CONFIG_OPAL_CORE. Also, avoid code duplication by moving common code used while

[PATCH v3 11/16] powerpc/fadump: update documentation about CONFIG_PRESERVE_FA_DUMP

2019-06-25 Thread Hari Bathini
Kernel config option CONFIG_PRESERVE_FA_DUMP is introduced to ensure crash data, from previously crash'ed kernel, is preserved. Update documentation with this details. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.txt |9 + 1 file changed, 9

[PATCH v3 10/16] powernv/fadump: add support to preserve crash data on FADUMP disabled kernel

2019-06-25 Thread Hari Bathini
Add a new kernel config option, CONFIG_PRESERVE_FA_DUMP that ensures that crash data, from previously crash'ed kernel, is preserved. This helps in cases where FADump is not enabled but the subsequent memory preserving kernel boot is likely to process this crash data. One typical usecase for this

[PATCH v3 09/16] powernv/fadump: process architected register state data provided by firmware

2019-06-25 Thread Hari Bathini
From: Hari Bathini Firmware provides architected register state data at the time of crash. Process this data and build CPU notes to append to ELF core. Signed-off-by: Hari Bathini Signed-off-by: Vasant Hegde --- arch/powerpc/include/asm/opal-api.h | 31

[PATCH v3 08/16] powerpc/fadump: consider reserved ranges while releasing memory

2019-06-25 Thread Hari Bathini
Commit 0962e8004e97 ("powerpc/prom: Scan reserved-ranges node for memory reservations") enabled support to parse 'reserved-ranges' DT node to reserve kernel memory falling in these ranges for firmware purposes. Along with the preserved area memory, also ensure memory in reserved ranges is not

[PATCH v3 07/16] powerpc/fadump: consider reserved ranges while reserving memory

2019-06-25 Thread Hari Bathini
Commit 0962e8004e97 ("powerpc/prom: Scan reserved-ranges node for memory reservations") enabled support to parse reserved-ranges DT node and reserve kernel memory falling in these ranges for F/W purposes. Ensure memory in these ranges is not overlapped with memory reserved for FADump. Also, use a

[PATCH v3 06/16] powerpc/fadump: Update documentation about OPAL platform support

2019-06-25 Thread Hari Bathini
With FADump support now available on both pseries and OPAL platforms, update FADump documentation with these details. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.txt | 90 -- 1 file changed, 51 insertions(+), 39 deletions(-) diff --git

[PATCH v3 05/16] powerpc/fadump: enable fadump support on OPAL based POWER platform

2019-06-25 Thread Hari Bathini
From: Hari Bathini Firmware-assisted dump support is enabled for OPAL based POWER platforms in P9 firmware. Make the corresponding updates in kernel to enable fadump support for such platforms. Signed-off-by: Hari Bathini --- arch/powerpc/Kconfig |5

[PATCH v3 04/16] powerpc/fadump: use FADump instead of fadump for how it is pronounced

2019-06-25 Thread Hari Bathini
Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.txt | 56 +++--- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/Documentation/powerpc/firmware-assisted-dump.txt b/Documentation/powerpc/firmware-assisted-dump.txt index

[PATCH v3 03/16] pseries/fadump: move out platform specific support from generic code

2019-06-25 Thread Hari Bathini
Introduce callbacks for platform specific operations like register, unregister, invalidate & such, and move pseries specific code into platform code. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/fadump.h| 75 arch/powerpc/kernel/fadump-common.h | 38 ++

[PATCH v3 02/16] powerpc/fadump: Improve fadump documentation

2019-06-25 Thread Hari Bathini
The figures depicting FADump's (Firmware-Assisted Dump) memory layout are missing some finer details like different memory regions and what they represent. Improve the documentation by updating those details. Signed-off-by: Hari Bathini --- Documentation/powerpc/firmware-assisted-dump.txt |

[PATCH v3 01/16] powerpc/fadump: move internal fadump code to a new file

2019-06-25 Thread Hari Bathini
Refactoring fadump code means internal fadump code is referenced from different places. For ease, move internal code to a new file. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/fadump.h | 112 arch/powerpc/kernel/Makefile|2

[PATCH v3 00/16] Add FADump support on PowerNV platform

2019-06-25 Thread Hari Bathini
Firmware-Assisted Dump (FADump) is currently supported only on pseries platform. This patch series adds support for powernv platform too. The first and third patches refactor the FADump code to make use of common code across multiple platforms. The fifth patch adds basic FADump support for

Re: [PATCH v2 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-25 Thread kbuild test robot
Hi Vaibhav, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on powerpc/next] [also build test WARNING on v5.2-rc6 next-20190625] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day

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

2019-06-25 Thread Andrew Morton
On Tue, 25 Jun 2019 16:37:13 +0200 Christoph Hellwig wrote: > +static int gup_huge_pd(hugepd_t hugepd Naming nitlet: we have hugepd and we also have huge_pd. We have hugepte and we also have huge_pte. It make things a bit hard to remember and it would be nice to make it all consistent

Re: [PATCH] powerpc/rtas: retry when cpu offline races with suspend/migration

2019-06-25 Thread Nathan Lynch
Juliet Kim writes: > There's some concern this could retry forever, resulting in live lock. First of all the system will make progress in other areas even if there are repeated retries; we're not indefinitely holding locks or anything like that. Second, Linux checks the H_VASI_STATE result on

[PATCH REPOST] powerpc/rtas: Fix hang in race against concurrent cpu offline

2019-06-25 Thread Juliet Kim
The commit (“powerpc/rtas: Fix a potential race between CPU-Offline & Migration) attempted to fix a hang in Live Partition Mobility(LPM) by abandoning the LPM attempt if a race between LPM and concurrent CPU offline was detected. However, that fix failed to notify Hypervisor that the LPM

Re: [PATCH] powerpc/rtas: Fix hang in race against concurrent cpu offline

2019-06-25 Thread Nathan Lynch
Juliet Kim writes: > The commit > (“powerpc/rtas: Fix a potential race between CPU-Offline & Migration) > attempted to fix a hang in Live Partition Mobility(LPM) by abandoning > the LPM attempt if a race between LPM and concurrent CPU offline was > detected. > > However, that fix failed to notify

Re: DMA coherency in drivers/tty/serial/mpsc.c

2019-06-25 Thread Mark Greer
On Tue, Jun 25, 2019 at 02:26:41PM +0200, Christoph Hellwig wrote: > Hi Paul, Dale and Mark (I hope this reaches the right Mark), Hi Christoph. Yes, you did reach the right Mark. :) > I've started auditing all users of DMA_ATTR_NON_CONSISTENT ot prepare > for major API improvements in that

Re: [PATCH 1/1] powerpc: fix off by one in max_zone_pfn initialization for ZONE_DMA

2019-06-25 Thread Christoph Hellwig
Thanks. This looks good and seems to match what I couple of other random architectures I checked do: Reviewed-by: Christoph Hellwig

[PATCH 4/4] powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions

2019-06-25 Thread Christoph Hellwig
These two function have never been used anywhere in the kernel tree since they were added to the kernel. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/vas.h | 10 -- arch/powerpc/platforms/powernv/vas-window.c | 19 ---

[PATCH 3/4] powerpc/powernv: remove unused NPU DMA code

2019-06-25 Thread Christoph Hellwig
None of these routines were ever used anywhere in the kernel tree since they were added to the kernel. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/book3s/64/mmu.h | 2 - arch/powerpc/include/asm/powernv.h | 22 - arch/powerpc/mm/book3s64/mmu_context.c | 1 -

[PATCH 2/4] powerpc/powernv: remove the unused tunneling exports

2019-06-25 Thread Christoph Hellwig
These have been unused anywhere in the kernel tree ever since they've been added to the kernel. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pnv-pci.h| 4 -- arch/powerpc/platforms/powernv/pci-ioda.c | 4 +- arch/powerpc/platforms/powernv/pci.c | 71

[PATCH 1/4] powerpc/powernv: remove the unused pnv_pci_set_p2p function

2019-06-25 Thread Christoph Hellwig
This function has never been used anywhere in the kernel tree since it was added to the tree. We also now have proper PCIe P2P APIs in the core kernel, and any new P2P support should be using those. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/opal.h| 2 -

remove unused powernv code v3

2019-06-25 Thread Christoph Hellwig
Hi all, the powerpc powernv port has a fairly large chunk of code that never had any upstream user. We generally strive to not keep dead code around, and this was affirmed at least years Maintainer summit. Changes since v2: - fix incorrect opal stub removals that crept in in a rebase Changes

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

2019-06-25 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 e06447cff635..d9d022d835ca 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-25 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

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

2019-06-25 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-25 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 0e83dba98dfd..37a2083b1ed8 100644 --- a/mm/gup.c +++ b/mm/gup.c

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

2019-06-25 Thread Christoph Hellwig
Always build mm/gup.c so that we don't have to provide separate nommu stubs. Also merge the get_user_pages_fast and __get_user_pages_fast stubs when HAVE_FAST_GUP into the main implementations, which will never call the fast path if HAVE_FAST_GUP is not set. This also ensures the new

[PATCH 11/16] mm: reorder code blocks in gup.c

2019-06-25 Thread Christoph Hellwig
This moves the actually exported functions towards the end of the file, and reorders some functions to be in more logical blocks as a preparation for moving various stubs inline into the main functionality using IS_ENABLED(). Signed-off-by: Christoph Hellwig --- mm/gup.c | 410

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

2019-06-25 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 Reviewed-by: Khalid Aziz Reviewed-by: Jason Gunthorpe --- arch/arm/Kconfig | 5

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

2019-06-25 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 Reviewed-by: Khalid Aziz --- arch/sparc/Kconfig | 1 + arch/sparc/include/asm/pgtable_64.h | 18 ++

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

2019-06-25 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 Reviewed-by: Khalid Aziz --- arch/sparc/include/asm/pgtable_64.h | 22 ++ 1 file changed, 22 insertions(+) diff --git

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

2019-06-25 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

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

2019-06-25 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..3c7ff20f3f94 100644 ---

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

2019-06-25 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..f0dcf991d27f 100644 ---

[PATCH 02/16] mm: simplify gup_fast_permitted

2019-06-25 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 Reviewed-by: Jason Gunthorpe --- arch/s390/include/asm/pgtable.h | 8 +---

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

2019-06-25 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 +-

switch the remaining architectures to use generic GUP v4

2019-06-25 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,

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

2019-06-25 Thread Christoph Hellwig
This will allow sparc64, or any future architecture with memory tagging to override its tags for get_user_pages and get_user_pages_fast. Signed-off-by: Christoph Hellwig Reviewed-by: Khalid Aziz Reviewed-by: Jason Gunthorpe --- mm/gup.c | 4 ++-- 1 file changed, 2 insertions(+), 2

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

2019-06-25 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 Reviewed-by: Jason Gunthorpe --- arch/x86/Kconfig

[PATCH 1/1] powerpc: fix off by one in max_zone_pfn initialization for ZONE_DMA

2019-06-25 Thread Andrea Arcangeli
25078dc1f74be16b858e914f52cc8f4d03c2271a first introduced an off by one error in the ZONE_DMA initialization of PPC_BOOK3E_64=y and since 9739ab7eda459f0669ec9807e0d9be5020bab88c the off by one applies to PPC32=y too. This simply corrects the off by one and should resolve crashes like below: [

Re: [RFC PATCH v1 11/13] powerpc/ptrace: create ppc_gethwdinfo()

2019-06-25 Thread Mathieu Malaterre
On Tue, Jun 25, 2019 at 1:22 PM Christophe Leroy wrote: > > Create ippc_gethwdinfo() to handle PPC_PTRACE_GETHWDBGINFO and s/ippc_gethwdinfo/ppc_gethwdinfo/ > reduce ifdef mess > > Signed-off-by: Christophe Leroy > --- > arch/powerpc/kernel/ptrace/ptrace-adv.c | 15 +++ >

[PATCH v2 3/3] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails

2019-06-25 Thread Vaibhav Jain
In some cases initial bind of scm memory for an lpar can fail if previously it wasn't released using a scm-unbind hcall. This situation can arise due to panic of the previous kernel or forced lpar fadump. In such cases the H_SCM_BIND_MEM return a H_OVERLAP error. To mitigate such cases the patch

[PATCH v2 2/3] powerpc/papr_scm: Update drc_pmem_unbind() to use H_SCM_UNBIND_ALL

2019-06-25 Thread Vaibhav Jain
The new hcall named H_SCM_UNBIND_ALL has been introduce that can unbind all the memory drc memory-blocks assigned to an lpar. This is more efficient than using H_SCM_UNBIND_MEM as currently we don't support partial unbind of drc memory-blocks. Hence this patch proposes following changes to

[PATCH v2 0/3] powerpc/papr_scm: Workaround for failure of drc bind after kexec

2019-06-25 Thread Vaibhav Jain
Presently an error is returned in response to hcall H_SCM_BIND_MEM when a new kernel boots on lpar via kexec. This prevents papr_scm from registering drc memory regions with nvdimm. The error reported is of the form below: "papr_scm ibm,persistent-memory:ibm,pmemory@4412: bind err: -68" On

[PATCH v2 1/3] powerpc/pseries: Update SCM hcall op-codes in hvcall.h

2019-06-25 Thread Vaibhav Jain
Update the hvcalls.h to include op-codes for new hcalls introduce to manage SCM memory. Also update existing hcall definitions to reflect current papr specification for SCM. Signed-off-by: Vaibhav Jain --- Change-log: v2: * None new patch in this series. --- arch/powerpc/include/asm/hvcall.h |

DMA coherency in drivers/tty/serial/mpsc.c

2019-06-25 Thread Christoph Hellwig
Hi Paul, Dale and Mark (I hope this reaches the right Mark), I've started auditing all users of DMA_ATTR_NON_CONSISTENT ot prepare for major API improvements in that area. One of the odd users is the mpsc ѕerial driver, which allocates DMA memory with the above flag, and then actually properly

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

2019-06-25 Thread Jason Gunthorpe
On Tue, Jun 25, 2019 at 09:56:50AM +0200, Christoph Hellwig wrote: > On Fri, Jun 21, 2019 at 11:41:31AM -0300, Jason Gunthorpe wrote: > > > static bool gup_fast_permitted(unsigned long start, unsigned long end) > > > { > > > - return true; > > > + return IS_ENABLED(CONFIG_HAVE_FAST_GUP) ? true :

[RFC PATCH v1 13/13] powerpc/hw_breakpoint: move instruction stepping out of hw_breakpoint_handler()

2019-06-25 Thread Christophe Leroy
On 8xx, breakpoints stop after executing the instruction, so stepping/emulation is not needed. Move it into a sub-function and remove the #ifdefs. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/hw_breakpoint.c | 60 - 1 file changed, 33

[RFC PATCH v1 12/13] powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c

2019-06-25 Thread Christophe Leroy
ptrace_triggered() is declared in asm/hw_breakpoint.h and only needed when CONFIG_HW_BREAKPOINT is set, so move it into hw_breakpoint.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/hw_breakpoint.c | 16 arch/powerpc/kernel/ptrace/ptrace.c | 18 -- 2

[RFC PATCH v1 11/13] powerpc/ptrace: create ppc_gethwdinfo()

2019-06-25 Thread Christophe Leroy
Create ippc_gethwdinfo() to handle PPC_PTRACE_GETHWDBGINFO and reduce ifdef mess Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace-adv.c | 15 +++ arch/powerpc/kernel/ptrace/ptrace-decl.h | 1 + arch/powerpc/kernel/ptrace/ptrace-noadv.c | 20

[RFC PATCH v1 07/13] powerpc/ptrace: split out TRANSACTIONAL_MEM related functions.

2019-06-25 Thread Christophe Leroy
Move TRANSACTIONAL_MEM functions out of ptrace.c, into ptrace-tm.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 1 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 63 +++ arch/powerpc/kernel/ptrace/ptrace-tm.c | 877 ++

[RFC PATCH v1 09/13] powerpc/ptrace: split out ADV_DEBUG_REGS related functions.

2019-06-25 Thread Christophe Leroy
Move ADV_DEBUG_REGS functions out of ptrace.c, into ptrace-adv.c and ptrace-noadv.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 4 + arch/powerpc/kernel/ptrace/ptrace-adv.c | 487 ++ arch/powerpc/kernel/ptrace/ptrace-decl.h | 6 +

[RFC PATCH v1 08/13] powerpc/ptrace: move register viewing functions out of ptrace.c

2019-06-25 Thread Christophe Leroy
Create a dedicated ptrace-view.c file. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 4 +- arch/powerpc/kernel/ptrace/ptrace-decl.h | 42 ++ arch/powerpc/kernel/ptrace/ptrace-view.c | 966 ++ arch/powerpc/kernel/ptrace/ptrace.c

[RFC PATCH v1 05/13] powerpc/ptrace: split out ALTIVEC related functions.

2019-06-25 Thread Christophe Leroy
Move CONFIG_ALTIVEC functions out of ptrace.c, into ptrace-altivec.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 1 + arch/powerpc/kernel/ptrace/ptrace-altivec.c | 151 arch/powerpc/kernel/ptrace/ptrace-decl.h| 9 ++

[RFC PATCH v1 10/13] powerpc/ptrace: create ptrace_get_debugreg()

2019-06-25 Thread Christophe Leroy
Create ptrace_get_debugreg() to handle PTRACE_GET_DEBUGREG and reduce ifdef mess Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace-adv.c | 9 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 2 ++ arch/powerpc/kernel/ptrace/ptrace-noadv.c | 13 +

[RFC PATCH v1 06/13] powerpc/ptrace: split out SPE related functions.

2019-06-25 Thread Christophe Leroy
Move CONFIG_SPE functions out of ptrace.c, into ptrace-spe.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 1 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 9 +++ arch/powerpc/kernel/ptrace/ptrace-spe.c | 94

[RFC PATCH v1 00/13] Reduce ifdef mess in ptrace

2019-06-25 Thread Christophe Leroy
The purpose of this series is to reduce the amount of #ifdefs in ptrace.c This is a first try. Most of it is done, there are still some #ifdefs that could go away. Please comment and tell whether it is worth continuing in that direction. Christophe Leroy (13): powerpc: move ptrace into a

[RFC PATCH v1 02/13] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64

2019-06-25 Thread Christophe Leroy
Drop a bunch of #ifdefs CONFIG_PPC64 that are not vital. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 9 - arch/powerpc/include/uapi/asm/ptrace.h | 12 arch/powerpc/kernel/ptrace/ptrace.c| 24 +++- 3 files changed, 11

[RFC PATCH v1 03/13] powerpc/ptrace: drop PARAMETER_SAVE_AREA_OFFSET

2019-06-25 Thread Christophe Leroy
PARAMETER_SAVE_AREA_OFFSET is not used, drop it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/ptrace.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c index 0afb223c4d57..cc8efcb404d6

[RFC PATCH v1 04/13] powerpc/ptrace: split out VSX related functions.

2019-06-25 Thread Christophe Leroy
Move CONFIG_VSX functions out of ptrace.c, into ptrace-vsx.c and ptrace-novsx.c Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/ptrace/Makefile | 4 + arch/powerpc/kernel/ptrace/ptrace-decl.h | 18 +++ arch/powerpc/kernel/ptrace/ptrace-novsx.c | 83 ++

[RFC PATCH v1 01/13] powerpc: move ptrace into a subdirectory.

2019-06-25 Thread Christophe Leroy
In order to allow splitting of ptrace depending on the different CONFIG_ options, create a subdirectory dedicated to ptrace and move ptrace.c and ptrace32.c into it. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/Makefile| 7 +++ arch/powerpc/kernel/ptrace/Makefile

Re: [PATCH 1/4] powerpc/powernv: remove the unused pnv_pci_set_p2p function

2019-06-25 Thread Cédric Le Goater
Hello Christoph, On 25/06/2019 10:15, Christoph Hellwig wrote: > This function has never been used anywhere in the kernel tree since it > was added to the tree. We also now have proper PCIe P2P APIs in the core > kernel, and any new P2P support should be using those. > > Signed-off-by:

Re: [PATCH 1/4] powerpc/powernv: remove the unused pnv_pci_set_p2p function

2019-06-25 Thread Christoph Hellwig
On Tue, Jun 25, 2019 at 10:26:03AM +0200, Cédric Le Goater wrote: > > @@ -280,13 +280,6 @@ int64_t opal_xive_allocate_irq(uint32_t chip_id); > > int64_t opal_xive_free_irq(uint32_t girq); > > int64_t opal_xive_sync(uint32_t type, uint32_t id); > > int64_t opal_xive_dump(uint32_t type, uint32_t

Re: [PATCH] ocxl: Fix concurrent AFU open and device removal

2019-06-25 Thread Frederic Barrat
Le 24/06/2019 à 17:50, Greg Kurz a écrit : On Mon, 24 Jun 2019 17:39:26 +0200 Frederic Barrat wrote: Le 24/06/2019 à 17:24, Greg Kurz a écrit : On Mon, 24 Jun 2019 16:41:48 +0200 Frederic Barrat wrote: If an ocxl device is unbound through sysfs at the same time its AFU is being

[PATCH 4/4] powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions

2019-06-25 Thread Christoph Hellwig
These two function have never been used anywhere in the kernel tree since they were added to the kernel. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/vas.h | 10 -- arch/powerpc/platforms/powernv/vas-window.c | 19 ---

[PATCH 2/4] powerpc/powernv: remove the unused tunneling exports

2019-06-25 Thread Christoph Hellwig
These have been unused anywhere in the kernel tree ever since they've been added to the kernel. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/pnv-pci.h| 4 -- arch/powerpc/platforms/powernv/pci-ioda.c | 4 +- arch/powerpc/platforms/powernv/pci.c | 71

[PATCH 3/4] powerpc/powernv: remove unused NPU DMA code

2019-06-25 Thread Christoph Hellwig
None of these routines were ever used anywhere in the kernel tree since they were added to the kernel. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/book3s/64/mmu.h | 2 - arch/powerpc/include/asm/powernv.h | 22 - arch/powerpc/mm/book3s64/mmu_context.c | 1 -

[PATCH 1/4] powerpc/powernv: remove the unused pnv_pci_set_p2p function

2019-06-25 Thread Christoph Hellwig
This function has never been used anywhere in the kernel tree since it was added to the tree. We also now have proper PCIe P2P APIs in the core kernel, and any new P2P support should be using those. Signed-off-by: Christoph Hellwig --- arch/powerpc/include/asm/opal.h| 7 --

remove unused powernv code v2

2019-06-25 Thread Christoph Hellwig
Hi all, the powerpc powernv port has a fairly large chunk of code that never had any upstream user. We generally strive to not keep dead code around, and this was affirmed at least years Maintainer summit. Changes since v1: - reword some commit message

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

2019-06-25 Thread Christoph Hellwig
On Fri, Jun 21, 2019 at 11:41:31AM -0300, Jason Gunthorpe wrote: > > static bool gup_fast_permitted(unsigned long start, unsigned long end) > > { > > - return true; > > + return IS_ENABLED(CONFIG_HAVE_FAST_GUP) ? true : false; > > The ?: is needed with IS_ENABLED? It shouldn't, I'll fix it

Re: [PATCH 10/16] mm: rename CONFIG_HAVE_GENERIC_GUP to CONFIG_HAVE_FAST_GUP

2019-06-25 Thread Christoph Hellwig
On Fri, Jun 21, 2019 at 11:28:24AM -0300, Jason Gunthorpe wrote: > On Tue, Jun 11, 2019 at 04:40:56PM +0200, Christoph Hellwig wrote: > > 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

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

2019-06-25 Thread Christoph Hellwig
On Fri, Jun 21, 2019 at 11:05:42AM -0300, Jason Gunthorpe wrote: > Today this check is only being done on the get_user_pages_fast() - > after this patch it is also done for __get_user_pages_fast(). > > Which means __get_user_pages_fast is now non-functional on a range of > MIPS CPUs, but that

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

2019-06-25 Thread Christoph Hellwig
On Fri, Jun 21, 2019 at 10:39:11AM -0300, Jason Gunthorpe wrote: > Hmm, this function, and the other, goes on to do: > > if (unlikely(!access_ok((void __user *)start, len))) > return 0; > > and I thought that access_ok takes in the tagged pointer? > > How about re-order

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

2019-06-25 Thread Christoph Hellwig
On Fri, Jun 21, 2019 at 10:39:11AM -0300, Jason Gunthorpe wrote: > > Hmm, this function, and the other, goes on to do: > > if (unlikely(!access_ok((void __user *)start, len))) > return 0; > > and I thought that access_ok takes in the tagged pointer? > > How about